--- trunk/OOPSE/libBASS/mpiBASS.c 2004/01/27 19:37:48 988 +++ trunk/OOPSE/libBASS/mpiBASS.c 2004/01/29 23:01:17 998 @@ -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; @@ -86,11 +86,6 @@ void throwMPIEvent(event* the_event) mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int break; - case MEMBER: - mpiEventContainer.type = mpiMEMBER; - mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int - break; - case ZCONSTRAINT: mpiEventContainer.type = mpiZCONSTRAINT; mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int @@ -110,9 +105,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: @@ -122,10 +117,7 @@ void throwMPIEvent(event* the_event) case MEMBERS: mpiEventContainer.type = mpiMEMBERS; - mpiEventContainer.i1 = the_event->evt.mbrs.a ; // pack member ints into i - mpiEventContainer.i2 = the_event->evt.mbrs.b; - mpiEventContainer.i3 = the_event->evt.mbrs.c; - mpiEventContainer.i4 = the_event->evt.mbrs.d; + mpiEventContainer.i1 = the_event->evt.mbrs.nMembers ; // pack member ints into i break; case ASSIGNMENT: @@ -168,8 +160,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(); } } @@ -196,13 +198,12 @@ void mpiEventLoop(void) " ORIENTATION %d\n" " ZCONSTRAINT %d\n" " RIGIDBODY %d\n" - " MEMBER %d\n" " BLOCK_END %d\n" "\n", worldRank, MOLECULE, ATOM, BOND, BEND, TORSION, COMPONENT, POSITION, ASSIGNMENT, MEMBERS, CONSTRAINT, ORIENTATION, - ZCONSTRAINT, RIGIDBODY, MEMBER, BLOCK_END ); + ZCONSTRAINT, RIGIDBODY, BLOCK_END ); #endif MPI_Bcast(&mpiContinue,1,MPI_INT,0,MPI_COMM_WORLD); @@ -259,11 +260,6 @@ void mpiCatchEvent(void) the_event.evt.blk_index = mpiEventContainer.i1; break; - case mpiMEMBER: - the_event.event_type = MEMBER; - the_event.evt.blk_index = mpiEventContainer.i1; - break; - case mpiZCONSTRAINT: the_event.event_type = ZCONSTRAINT; the_event.evt.blk_index = mpiEventContainer.i1; @@ -284,9 +280,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: @@ -296,10 +292,15 @@ void mpiCatchEvent(void) case mpiMEMBERS: the_event.event_type = MEMBERS; - the_event.evt.mbrs.a = mpiEventContainer.i1; - the_event.evt.mbrs.b = mpiEventContainer.i2; - the_event.evt.mbrs.c = mpiEventContainer.i3; - the_event.evt.mbrs.d = mpiEventContainer.i4; + 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: