ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libBASS/mpiBASS.c
(Generate patch)

Comparing trunk/OOPSE/libBASS/mpiBASS.c (file contents):
Revision 957 by gezelter, Mon Jan 19 16:08:21 2004 UTC vs.
Revision 998 by gezelter, Thu Jan 29 23:01:17 2004 UTC

# Line 15 | Line 15 | void mpiEventInit(void)
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;
# Line 105 | Line 105 | void throwMPIEvent(event* the_event)
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:
# Line 115 | Line 115 | void throwMPIEvent(event* the_event)
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
121 <      mpiEventContainer.i2 = the_event->evt.mbr.b;
122 <      mpiEventContainer.i3 = the_event->evt.mbr.c;  
123 <      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:
# Line 163 | Line 160 | void throwMPIEvent(event* the_event)
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   }
# Line 186 | Line 193 | void mpiEventLoop(void)
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            "  ZCONSTRAINT %d\n"
# Line 195 | Line 202 | void mpiEventLoop(void)
202            "\n",
203            worldRank,
204            MOLECULE, ATOM, BOND, BEND, TORSION, COMPONENT,
205 <          POSITION, ASSIGNMENT, MEMBER, CONSTRAINT, ORIENTATION,
205 >          POSITION, ASSIGNMENT, MEMBERS, CONSTRAINT, ORIENTATION,
206            ZCONSTRAINT, RIGIDBODY, BLOCK_END );
207   #endif
208  
# Line 273 | Line 280 | void mpiCatchEvent(void)
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:
# Line 283 | Line 290 | void mpiCatchEvent(void)
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:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines