--- trunk/OOPSE/libBASS/mpiBASS.c 2004/01/19 16:08:21 957 +++ trunk/OOPSE/libBASS/mpiBASS.c 2004/05/11 04:21:52 1153 @@ -15,7 +15,7 @@ void mpiEventInit(void) void mpiEventInit(void) { - int blockCounts[5] = {1,3,4,120,80}; + int blockCounts[5] = {1,3,1,120,80}; MPI_Aint dspls[5]; MPI_Datatype types[5]; mBEvent protoEvent; @@ -66,6 +66,11 @@ void throwMPIEvent(event* the_event) mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int break; + case CUTOFFGROUP: + mpiEventContainer.type = mpiCUTOFFGROUP; + mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int + break; + case ATOM: mpiEventContainer.type = mpiATOM; mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int @@ -105,9 +110,9 @@ void throwMPIEvent(event* the_event) case ORIENTATION: mpiEventContainer.type = mpiORIENTATION; - mpiEventContainer.d1 = the_event->evt.ornt.x; // pack orientation coord into d - mpiEventContainer.d2 = the_event->evt.ornt.y; - mpiEventContainer.d3 = the_event->evt.ornt.z; + mpiEventContainer.d1 = the_event->evt.ornt.phi; // pack orientation coord into d + mpiEventContainer.d2 = the_event->evt.ornt.theta; + mpiEventContainer.d3 = the_event->evt.ornt.psi; break; case CONSTRAINT: @@ -115,12 +120,9 @@ void throwMPIEvent(event* the_event) mpiEventContainer.d1 = the_event->evt.cnstr; // pack constraint coord into d break; - case MEMBER: - mpiEventContainer.type = mpiMEMBER; - mpiEventContainer.i1 = the_event->evt.mbr.a ; // pack member ints into i - mpiEventContainer.i2 = the_event->evt.mbr.b; - mpiEventContainer.i3 = the_event->evt.mbr.c; - mpiEventContainer.i4 = the_event->evt.mbr.d; + case MEMBERS: + mpiEventContainer.type = mpiMEMBERS; + mpiEventContainer.i1 = the_event->evt.mbrs.nMembers ; // pack member ints into i break; case ASSIGNMENT: @@ -163,8 +165,18 @@ void throwMPIEvent(event* the_event) MPI_Bcast(&mpiEventContainer,1,mpiBASSEventType,0,MPI_COMM_WORLD); + if (the_event->event_type == MEMBERS) { + + // For member lists, we need a separate broadcast to spew out the + // membership array: + MPI_Bcast(the_event->evt.mbrs.memberList, the_event->evt.mbrs.nMembers, + MPI_INT, 0, MPI_COMM_WORLD); + + } + sprintf( checkPointMsg, "BASS Event broadcast successful" ); + MPIcheckPoint(); } } @@ -186,17 +198,18 @@ void mpiEventLoop(void) " COMPONENT %d\n" " POSITION %d\n" " ASSIGNMENT %d\n" - " MEMBER %d\n" + " MEMBERS %d\n" " CONSTRAINT %d\n" " ORIENTATION %d\n" " ZCONSTRAINT %d\n" " RIGIDBODY %d\n" + " CUTOFFGROUP %d\n" " BLOCK_END %d\n" "\n", worldRank, MOLECULE, ATOM, BOND, BEND, TORSION, COMPONENT, - POSITION, ASSIGNMENT, MEMBER, CONSTRAINT, ORIENTATION, - ZCONSTRAINT, RIGIDBODY, BLOCK_END ); + POSITION, ASSIGNMENT, MEMBERS, CONSTRAINT, ORIENTATION, + ZCONSTRAINT, RIGIDBODY, CUTOFFGROUP, BLOCK_END ); #endif MPI_Bcast(&mpiContinue,1,MPI_INT,0,MPI_COMM_WORLD); @@ -232,6 +245,11 @@ void mpiCatchEvent(void) the_event.event_type = RIGIDBODY; the_event.evt.blk_index = mpiEventContainer.i1; break; + + case mpiCUTOFFGROUP: + the_event.event_type = CUTOFFGROUP; + the_event.evt.blk_index = mpiEventContainer.i1; + break; case mpiATOM: the_event.event_type = ATOM; @@ -273,9 +291,9 @@ void mpiCatchEvent(void) case mpiORIENTATION: the_event.event_type = ORIENTATION; - the_event.evt.ornt.x = mpiEventContainer.d1; - the_event.evt.ornt.y = mpiEventContainer.d2; - the_event.evt.ornt.z = mpiEventContainer.d3; + the_event.evt.ornt.phi = mpiEventContainer.d1; + the_event.evt.ornt.theta = mpiEventContainer.d2; + the_event.evt.ornt.psi = mpiEventContainer.d3; break; case mpiCONSTRAINT: @@ -283,12 +301,17 @@ void mpiCatchEvent(void) the_event.evt.cnstr = mpiEventContainer.d1; break; - case mpiMEMBER: - the_event.event_type = MEMBER; - the_event.evt.mbr.a = mpiEventContainer.i1; - the_event.evt.mbr.b = mpiEventContainer.i2; - the_event.evt.mbr.c = mpiEventContainer.i3; - the_event.evt.mbr.d = mpiEventContainer.i4; + case mpiMEMBERS: + the_event.event_type = MEMBERS; + the_event.evt.mbrs.nMembers = mpiEventContainer.i1; + + the_event.evt.mbrs.memberList = (int *) calloc(the_event.evt.mbrs.nMembers, + sizeof(int)); + + // Grab the member list since we have a number of members: + MPI_Bcast(the_event.evt.mbrs.memberList, the_event.evt.mbrs.nMembers, + MPI_INT, 0, MPI_COMM_WORLD); + break; case mpiASSIGNMENT_s: