--- branches/mmeineke/OOPSE/libBASS/mpiBASS.c 2003/03/21 17:42:12 377 +++ 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; @@ -47,7 +47,6 @@ void throwMPIEvent(event* the_event) { mBEvent mpiEventContainer; int mpiStatus; - int mpiError; if (the_event == NULL) mpiStatus = MPI_INTERFACE_DONE; @@ -62,6 +61,11 @@ void throwMPIEvent(event* the_event) mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int break; + case RIGIDBODY: + mpiEventContainer.type = mpiRIGIDBODY; + 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 @@ -82,6 +86,11 @@ void throwMPIEvent(event* the_event) 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 + break; + case COMPONENT: mpiEventContainer.type = mpiCOMPONENT; mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int @@ -96,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: @@ -106,12 +115,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: @@ -154,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(); } } @@ -164,7 +180,6 @@ void mpiEventLoop(void) // Everybody but node 0 runs this void mpiEventLoop(void) { - int mpiError; int mpiContinue; #ifdef MPIBASS_VERBOSE @@ -178,16 +193,17 @@ void mpiEventLoop(void) " COMPONENT %d\n" " POSITION %d\n" " ASSIGNMENT %d\n" - " MEMBER %d\n" + " MEMBERS %d\n" " CONSTRAINT %d\n" " ORIENTATION %d\n" - " START_INDEX %d\n" + " ZCONSTRAINT %d\n" + " RIGIDBODY %d\n" " BLOCK_END %d\n" "\n", worldRank, MOLECULE, ATOM, BOND, BEND, TORSION, COMPONENT, - POSITION, ASSIGNMENT, MEMBER, CONSTRAINT, ORIENTATION, - START_INDEX, BLOCK_END ); + POSITION, ASSIGNMENT, MEMBERS, CONSTRAINT, ORIENTATION, + ZCONSTRAINT, RIGIDBODY, BLOCK_END ); #endif MPI_Bcast(&mpiContinue,1,MPI_INT,0,MPI_COMM_WORLD); @@ -209,9 +225,7 @@ void mpiCatchEvent(void) { event the_event; mBEvent mpiEventContainer; - int mpiError; - MPI_Bcast(&mpiEventContainer,1,mpiBASSEventType,0,MPI_COMM_WORLD); @@ -220,6 +234,11 @@ void mpiCatchEvent(void) the_event.event_type = MOLECULE; the_event.evt.blk_index = mpiEventContainer.i1; break; + + case mpiRIGIDBODY: + the_event.event_type = RIGIDBODY; + the_event.evt.blk_index = mpiEventContainer.i1; + break; case mpiATOM: the_event.event_type = ATOM; @@ -240,6 +259,11 @@ void mpiCatchEvent(void) the_event.event_type = TORSION; the_event.evt.blk_index = mpiEventContainer.i1; break; + + case mpiZCONSTRAINT: + the_event.event_type = ZCONSTRAINT; + the_event.evt.blk_index = mpiEventContainer.i1; + break; case mpiCOMPONENT: the_event.event_type = COMPONENT; @@ -256,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: @@ -266,12 +290,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: @@ -344,7 +373,6 @@ void mpiInterfaceExit(void){ void mpiInterfaceExit(void){ - int mpiError; int mpiStatus = MPI_INTERFACE_ABORT; MPI_Bcast(&mpiStatus,1,MPI_INT,0,MPI_COMM_WORLD);