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

Comparing trunk/mdtools/md_code/DumpWriter.cpp (file contents):
Revision 249 by chuckv, Mon Jan 27 21:28:19 2003 UTC vs.
Revision 254 by chuckv, Thu Jan 30 20:03:37 2003 UTC

# Line 130 | Line 130 | void DumpWriter::writeDump( double currentTime ){
130    // write out header and node 0's coordinates
131  
132    if( worldRank == 0 ){
133 <    outFile << entry_plug->mpiSim->getTotAtoms() << "\n";
133 >    outFile << mpiSim->getTotAtoms() << "\n";
134        
135      outFile << currentTime << "\t"
136              << entry_plug->box_x << "\t"
# Line 170 | Line 170 | void DumpWriter::writeDump( double currentTime ){
170        else
171          strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
172          
173 <      outfile << writeLine;
173 >      outFile << writeLine;
174        masterIndex++;
175      }
176      outFile.flush();
177    }
178      
179 <  for (procIndex = 1; procIndex < entry_plug->mpiSim->getNumberProcessors();
179 >  for (procIndex = 1; procIndex < mpiSim->getNumberProcessors();
180         procIndex++){
181  
182      if( worldRank == 0 ){
# Line 208 | Line 208 | void DumpWriter::writeDump( double currentTime ){
208  
209        // recieve the nodes writeLines
210  
211 <      for ( i = nodeAtomStart; i <= nodeAtomEnd, i++){
211 >      for ( i = nodeAtomsStart; i <= nodeAtomsEnd; i++){
212            
213 <        mpiErr = MPI_Recv(&read_buffer,BUFFERSIZE,MPI_CHAR,procIndex,
213 >        mpiErr = MPI_Recv(writeLine,BUFFERSIZE,MPI_CHAR,procIndex,
214                            MPI_ANY_TAG,MPI_COMM_WORLD,istatus );
215  
216          outFile << writeLine;
# Line 220 | Line 220 | void DumpWriter::writeDump( double currentTime ){
220  
221      else if( worldRank == procIndex ){
222  
223 <      nodeAtomStart = entry_plug->mpiSim->getMyAtomStart();
224 <      nodeAtomEnd = entry_plug->mpiSim->getMyAtomEnd();
223 >      nodeAtomsStart = mpiSim->getMyAtomStart();
224 >      nodeAtomsEnd = mpiSim->getMyAtomEnd();
225          
226        mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,MPI_ANY_TAG,
227                          MPI_COMM_WORLD);
# Line 230 | Line 230 | void DumpWriter::writeDump( double currentTime ){
230          
231        mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,MPI_ANY_TAG,
232                          MPI_COMM_WORLD, istatus);
233 <      if (sendError) mpiCheckpoint();
233 >      if (sendError) MPIcheckPoint();
234  
235        // send current node's configuration line by line.
236  
# Line 273 | Line 273 | void DumpWriter::writeDump( double currentTime ){
273        
274      sprintf(checkPointMsg,"Node %d sent dump configuration.",
275              procIndex);
276 <    mpiCheckPoint();
276 >    MPIcheckPoint();
277    }
278      
279   #endif // is_mpi
# Line 318 | Line 318 | void DumpWriter::writeFinal(){
318   #ifdef IS_MPI
319    }
320    
321 <  sprintf(checkPointMsg,"Opened file for final configuration\n",procIndex);
322 <  mpiCheckPoint();  
321 >  sprintf(checkPointMsg,"Opened file for final configuration\n");
322 >  MPIcheckPoint();  
323    
324   #endif //is_mpi
325  
# Line 384 | Line 384 | void DumpWriter::writeFinal(){
384    // write out header and node 0's coordinates
385  
386    if( worldRank == 0 ){
387 <    finalOut << entry_plug->mpiSim->getTotAtoms() << "\n";
387 >    finalOut << mpiSim->getTotAtoms() << "\n";
388        
389      finalOut << entry_plug->box_x << "\t"
390               << entry_plug->box_y << "\t"
# Line 423 | Line 423 | void DumpWriter::writeFinal(){
423        else
424          strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
425          
426 <      outfile << writeLine;
426 >      outFile << writeLine;
427        masterIndex++;
428      }
429      finalOut.flush();
430    }
431      
432 <  for (procIndex = 1; procIndex < entry_plug->mpiSim->getNumberProcessors();
432 >  for (procIndex = 1; procIndex < mpiSim->getNumberProcessors();
433         procIndex++){
434  
435      if( worldRank == 0 ){
# Line 461 | Line 461 | void DumpWriter::writeFinal(){
461  
462        // recieve the nodes writeLines
463  
464 <      for ( i = nodeAtomStart; i <= nodeAtomEnd, i++){
464 >      for ( i = nodeAtomsStart; i <= nodeAtomsEnd; i++){
465            
466 <        mpiErr = MPI_Recv(&read_buffer,BUFFERSIZE,MPI_CHAR,procIndex,
466 >        mpiErr = MPI_Recv(writeLine,BUFFERSIZE,MPI_CHAR,procIndex,
467                            MPI_ANY_TAG,MPI_COMM_WORLD,istatus );
468  
469          finalOut << writeLine;
# Line 475 | Line 475 | void DumpWriter::writeFinal(){
475  
476      else if( worldRank == procIndex ){
477  
478 <      nodeAtomStart = entry_plug->mpiSim->getMyAtomStart();
479 <      nodeAtomEnd = entry_plug->mpiSim->getMyAtomEnd();
478 >      nodeAtomsStart = mpiSim->getMyAtomStart();
479 >      nodeAtomsEnd = mpiSim->getMyAtomEnd();
480          
481        mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,MPI_ANY_TAG,
482                          MPI_COMM_WORLD);
# Line 485 | Line 485 | void DumpWriter::writeFinal(){
485          
486        mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,MPI_ANY_TAG,
487                          MPI_COMM_WORLD, istatus);
488 <      if (sendError) mpiCheckpoint();
488 >      if (sendError) MPIcheckPoint();
489  
490        // send current node's configuration line by line.
491  
# Line 528 | Line 528 | void DumpWriter::writeFinal(){
528        
529      sprintf(checkPointMsg,"Node %d sent dump configuration.",
530              procIndex);
531 <    mpiCheckPoint();
531 >    MPIcheckPoint();
532    }
533  
534    if( worldRank == 0 ) finalOut.close();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines