| 15 |
|
|
| 16 |
|
void mpiEventInit(void) |
| 17 |
|
{ |
| 18 |
< |
int blockCounts[5] = {1,3,4,120,80}; |
| 18 |
> |
int blockCounts[5] = {1,3,1,120,80}; |
| 19 |
|
MPI_Aint dspls[5]; |
| 20 |
|
MPI_Datatype types[5]; |
| 21 |
|
mBEvent protoEvent; |
| 47 |
|
{ |
| 48 |
|
mBEvent mpiEventContainer; |
| 49 |
|
int mpiStatus; |
| 50 |
– |
int mpiError; |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
if (the_event == NULL) mpiStatus = MPI_INTERFACE_DONE; |
| 61 |
|
mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int |
| 62 |
|
break; |
| 63 |
|
|
| 64 |
+ |
case RIGIDBODY: |
| 65 |
+ |
mpiEventContainer.type = mpiRIGIDBODY; |
| 66 |
+ |
mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int |
| 67 |
+ |
break; |
| 68 |
+ |
|
| 69 |
|
case ATOM: |
| 70 |
|
mpiEventContainer.type = mpiATOM; |
| 71 |
|
mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int |
| 86 |
|
mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int |
| 87 |
|
break; |
| 88 |
|
|
| 89 |
+ |
case ZCONSTRAINT: |
| 90 |
+ |
mpiEventContainer.type = mpiZCONSTRAINT; |
| 91 |
+ |
mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int |
| 92 |
+ |
break; |
| 93 |
+ |
|
| 94 |
|
case COMPONENT: |
| 95 |
|
mpiEventContainer.type = mpiCOMPONENT; |
| 96 |
|
mpiEventContainer.i1 = the_event->evt.blk_index; // pack block index into first int |
| 105 |
|
|
| 106 |
|
case ORIENTATION: |
| 107 |
|
mpiEventContainer.type = mpiORIENTATION; |
| 108 |
< |
mpiEventContainer.d1 = the_event->evt.ornt.x; // pack orientation coord into d |
| 109 |
< |
mpiEventContainer.d2 = the_event->evt.ornt.y; |
| 110 |
< |
mpiEventContainer.d3 = the_event->evt.ornt.z; |
| 108 |
> |
mpiEventContainer.d1 = the_event->evt.ornt.phi; // pack orientation coord into d |
| 109 |
> |
mpiEventContainer.d2 = the_event->evt.ornt.theta; |
| 110 |
> |
mpiEventContainer.d3 = the_event->evt.ornt.psi; |
| 111 |
|
break; |
| 112 |
|
|
| 113 |
|
case CONSTRAINT: |
| 115 |
|
mpiEventContainer.d1 = the_event->evt.cnstr; // pack constraint coord into d |
| 116 |
|
break; |
| 117 |
|
|
| 118 |
< |
case MEMBER: |
| 119 |
< |
mpiEventContainer.type = mpiMEMBER; |
| 120 |
< |
mpiEventContainer.i1 = the_event->evt.mbr.a ; // pack member ints into i |
| 112 |
< |
mpiEventContainer.i2 = the_event->evt.mbr.b; |
| 113 |
< |
mpiEventContainer.i3 = the_event->evt.mbr.c; |
| 114 |
< |
mpiEventContainer.i4 = the_event->evt.mbr.d; |
| 118 |
> |
case MEMBERS: |
| 119 |
> |
mpiEventContainer.type = mpiMEMBERS; |
| 120 |
> |
mpiEventContainer.i1 = the_event->evt.mbrs.nMembers ; // pack member ints into i |
| 121 |
|
break; |
| 122 |
|
|
| 123 |
|
case ASSIGNMENT: |
| 160 |
|
|
| 161 |
|
MPI_Bcast(&mpiEventContainer,1,mpiBASSEventType,0,MPI_COMM_WORLD); |
| 162 |
|
|
| 163 |
+ |
if (the_event->event_type == MEMBERS) { |
| 164 |
+ |
|
| 165 |
+ |
// For member lists, we need a separate broadcast to spew out the |
| 166 |
+ |
// membership array: |
| 167 |
+ |
MPI_Bcast(the_event->evt.mbrs.memberList, the_event->evt.mbrs.nMembers, |
| 168 |
+ |
MPI_INT, 0, MPI_COMM_WORLD); |
| 169 |
+ |
|
| 170 |
+ |
} |
| 171 |
+ |
|
| 172 |
|
sprintf( checkPointMsg, |
| 173 |
|
"BASS Event broadcast successful" ); |
| 174 |
+ |
|
| 175 |
|
MPIcheckPoint(); |
| 176 |
|
} |
| 177 |
|
} |
| 180 |
|
// Everybody but node 0 runs this |
| 181 |
|
void mpiEventLoop(void) |
| 182 |
|
{ |
| 167 |
– |
int mpiError; |
| 183 |
|
int mpiContinue; |
| 184 |
|
|
| 185 |
|
#ifdef MPIBASS_VERBOSE |
| 193 |
|
" COMPONENT %d\n" |
| 194 |
|
" POSITION %d\n" |
| 195 |
|
" ASSIGNMENT %d\n" |
| 196 |
< |
" MEMBER %d\n" |
| 196 |
> |
" MEMBERS %d\n" |
| 197 |
|
" CONSTRAINT %d\n" |
| 198 |
|
" ORIENTATION %d\n" |
| 199 |
< |
" START_INDEX %d\n" |
| 199 |
> |
" ZCONSTRAINT %d\n" |
| 200 |
> |
" RIGIDBODY %d\n" |
| 201 |
|
" BLOCK_END %d\n" |
| 202 |
|
"\n", |
| 203 |
|
worldRank, |
| 204 |
|
MOLECULE, ATOM, BOND, BEND, TORSION, COMPONENT, |
| 205 |
< |
POSITION, ASSIGNMENT, MEMBER, CONSTRAINT, ORIENTATION, |
| 206 |
< |
START_INDEX, BLOCK_END ); |
| 205 |
> |
POSITION, ASSIGNMENT, MEMBERS, CONSTRAINT, ORIENTATION, |
| 206 |
> |
ZCONSTRAINT, RIGIDBODY, BLOCK_END ); |
| 207 |
|
#endif |
| 208 |
|
|
| 209 |
|
MPI_Bcast(&mpiContinue,1,MPI_INT,0,MPI_COMM_WORLD); |
| 225 |
|
{ |
| 226 |
|
event the_event; |
| 227 |
|
mBEvent mpiEventContainer; |
| 212 |
– |
int mpiError; |
| 228 |
|
|
| 214 |
– |
|
| 229 |
|
|
| 230 |
|
MPI_Bcast(&mpiEventContainer,1,mpiBASSEventType,0,MPI_COMM_WORLD); |
| 231 |
|
|
| 234 |
|
the_event.event_type = MOLECULE; |
| 235 |
|
the_event.evt.blk_index = mpiEventContainer.i1; |
| 236 |
|
break; |
| 237 |
+ |
|
| 238 |
+ |
case mpiRIGIDBODY: |
| 239 |
+ |
the_event.event_type = RIGIDBODY; |
| 240 |
+ |
the_event.evt.blk_index = mpiEventContainer.i1; |
| 241 |
+ |
break; |
| 242 |
|
|
| 243 |
|
case mpiATOM: |
| 244 |
|
the_event.event_type = ATOM; |
| 259 |
|
the_event.event_type = TORSION; |
| 260 |
|
the_event.evt.blk_index = mpiEventContainer.i1; |
| 261 |
|
break; |
| 262 |
+ |
|
| 263 |
+ |
case mpiZCONSTRAINT: |
| 264 |
+ |
the_event.event_type = ZCONSTRAINT; |
| 265 |
+ |
the_event.evt.blk_index = mpiEventContainer.i1; |
| 266 |
+ |
break; |
| 267 |
|
|
| 268 |
|
case mpiCOMPONENT: |
| 269 |
|
the_event.event_type = COMPONENT; |
| 280 |
|
|
| 281 |
|
case mpiORIENTATION: |
| 282 |
|
the_event.event_type = ORIENTATION; |
| 283 |
< |
the_event.evt.ornt.x = mpiEventContainer.d1; |
| 284 |
< |
the_event.evt.ornt.y = mpiEventContainer.d2; |
| 285 |
< |
the_event.evt.ornt.z = mpiEventContainer.d3; |
| 283 |
> |
the_event.evt.ornt.phi = mpiEventContainer.d1; |
| 284 |
> |
the_event.evt.ornt.theta = mpiEventContainer.d2; |
| 285 |
> |
the_event.evt.ornt.psi = mpiEventContainer.d3; |
| 286 |
|
break; |
| 287 |
|
|
| 288 |
|
case mpiCONSTRAINT: |
| 290 |
|
the_event.evt.cnstr = mpiEventContainer.d1; |
| 291 |
|
break; |
| 292 |
|
|
| 293 |
< |
case mpiMEMBER: |
| 294 |
< |
the_event.event_type = MEMBER; |
| 295 |
< |
the_event.evt.mbr.a = mpiEventContainer.i1; |
| 296 |
< |
the_event.evt.mbr.b = mpiEventContainer.i2; |
| 297 |
< |
the_event.evt.mbr.c = mpiEventContainer.i3; |
| 298 |
< |
the_event.evt.mbr.d = mpiEventContainer.i4; |
| 293 |
> |
case mpiMEMBERS: |
| 294 |
> |
the_event.event_type = MEMBERS; |
| 295 |
> |
the_event.evt.mbrs.nMembers = mpiEventContainer.i1; |
| 296 |
> |
|
| 297 |
> |
the_event.evt.mbrs.memberList = (int *) calloc(the_event.evt.mbrs.nMembers, |
| 298 |
> |
sizeof(int)); |
| 299 |
> |
|
| 300 |
> |
// Grab the member list since we have a number of members: |
| 301 |
> |
MPI_Bcast(the_event.evt.mbrs.memberList, the_event.evt.mbrs.nMembers, |
| 302 |
> |
MPI_INT, 0, MPI_COMM_WORLD); |
| 303 |
> |
|
| 304 |
|
break; |
| 305 |
|
|
| 306 |
|
case mpiASSIGNMENT_s: |
| 373 |
|
|
| 374 |
|
|
| 375 |
|
void mpiInterfaceExit(void){ |
| 347 |
– |
int mpiError; |
| 376 |
|
int mpiStatus = MPI_INTERFACE_ABORT; |
| 377 |
|
|
| 378 |
|
MPI_Bcast(&mpiStatus,1,MPI_INT,0,MPI_COMM_WORLD); |