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 916 by gezelter, Fri Jan 9 20:29:32 2004 UTC vs.
Revision 920 by tim, Sat Jan 10 09:46:47 2004 UTC

# Line 161 | Line 161 | void DumpWriter::writeDump( double currentTime ){
161   #else // is_mpi
162  
163    /* code to find maximum tag value */
164 +  
165    int *tagub, flag, MAXTAG;
166    MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, &tagub, &flag);
167    if (flag) {
# Line 227 | Line 228 | void DumpWriter::writeDump( double currentTime ){
228          MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node,
229                   myPotato, MPI_COMM_WORLD, &istatus);
230          
231 <        strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE);
231 >        //strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE);
232          
233          // Null terminate the atomTypeString just in case:
234  
235 <        atomTypeString[strlen(atomTypeString) - 1] = '\0';
236 <
235 >        //atomTypeString[strlen(atomTypeString) - 1] = '\0';
236 >        atomTypeString = MPIatomTypeString;
237 >        
238          myPotato++;
239  
240          MPI_Recv(&isDirectional, 1, MPI_INT, which_node,
# Line 357 | Line 359 | void DumpWriter::writeDump( double currentTime ){
359      sprintf( checkPointMsg,
360               "Sucessfully took a dump.\n");
361      MPIcheckPoint();        
362 <    
362 >    delete[] potatoes;
363    } else {
364  
365      // worldRank != 0, so I'm a remote node.  
# Line 381 | Line 383 | void DumpWriter::writeDump( double currentTime ){
383            MPI_Recv(&myPotato, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &istatus);
384            
385          }
386 <
387 <        local_index=-1;
386 >        which_atom = i;
387 >        local_index=-1;
388          for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) {
389            if (atoms[j]->getGlobalIndex() == which_atom) local_index = j;
390          }
# Line 659 | Line 661 | void DumpWriter::writeFinal(double finalTime){
661          MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node,
662                   myPotato, MPI_COMM_WORLD, &istatus);
663          
664 <        strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE);
665 <        
664 <        // Null terminate the atomTypeString just in case:
665 <
666 <        atomTypeString[strlen(atomTypeString) - 1] = '\0';
667 <
664 >        atomTypeString = MPIatomTypeString;
665 >                
666          myPotato++;
667  
668          MPI_Recv(&isDirectional, 1, MPI_INT, which_node,
# Line 788 | Line 786 | void DumpWriter::writeFinal(double finalTime){
786      finalOut.flush();
787      sprintf( checkPointMsg,
788               "Sucessfully took a dump.\n");
789 +    delete[] potatoes;
790 +      
791      MPIcheckPoint();        
792      
793    } else {
# Line 813 | Line 813 | void DumpWriter::writeFinal(double finalTime){
813            MPI_Recv(&myPotato, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &istatus);
814            
815          }
816 <
816 >        which_atom = i;  
817          local_index=-1;
818          for (j=0; (j<mpiSim->getMyNlocal()) && (local_index < 0); j++) {
819            if (atoms[j]->getGlobalIndex() == which_atom) local_index = j;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines