ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DumpWriter.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/DumpWriter.cpp (file contents):
Revision 912 by gezelter, Thu Jan 8 18:59:36 2004 UTC vs.
Revision 913 by chuckv, Thu Jan 8 22:25:52 2004 UTC

# Line 158 | Line 158 | void DumpWriter::writeDump( double currentTime ){
158  
159   #else // is_mpi
160  
161 <  // first thing first, suspend fatalities.
162 <  painCave.isEventLoop = 1;
161 >  /* code to find maximum tag value */
162 >  int *tagub, flag, MAXTAG;
163 >  MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, &tagub, &flag);
164 >  if (flag) {
165 >    MAXTAG = *tagub;
166 >  } else {
167 >    MAXTAG = 32767;
168 >  }
169  
164  int myStatus; // 1 = wakeup & success; 0 = error; -1 = AllDone
170    int haveError;
171  
172    MPI_Status istatus;
# Line 188 | Line 193 | void DumpWriter::writeDump( double currentTime ){
193      outFile << entry_plug->the_integrator->getAdditionalParameters();
194      outFile << endl;
195      outFile.flush();
196 +
197 +    tag = 0;
198 +
199      for (i = 0 ; i < mpiSim->getTotAtoms(); i++ ) {
192      // Get the Node number which has this atom;
200  
201 +      if (tag + 2 >= MAXTAG) {
202 +        // The tag was going to exceed the maximum value, so wrap around to 0:
203 +        tag = 0;
204 +        // Send the newly zeroed tag on to the other nodes:
205 +        MPI_Bcast(&tag, 1, MPI_INT, 0, MPI_COMM_WORLD);
206 +      }
207 +      
208 +      // Get the Node number which has this atom;
209 +      
210        which_node = AtomToProcMap[i];
211 <
211 >      
212        if (which_node != 0) {
213          
198        atomTypeTag          = 4*i;
199        atomIsDirectionalTag = 4*i + 1;
200        atomTransDataTag     = 4*i + 2;
201        atomOrientDataTag    = 4*i + 3;
202
214          MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node,
215                   atomTypeTag, MPI_COMM_WORLD, &istatus);
216          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines