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 260 by chuckv, Fri Jan 31 21:04:27 2003 UTC vs.
Revision 261 by chuckv, Mon Feb 3 21:15:59 2003 UTC

# Line 17 | Line 17 | DumpWriter::DumpWriter( SimInfo* the_entry_plug ){
17  
18   DumpWriter::DumpWriter( SimInfo* the_entry_plug ){
19  
20 +  entry_plug = the_entry_plug;
21 +
22   #ifdef IS_MPI
23    if(worldRank == 0 ){
24   #endif // is_mpi
25      
26 <    entry_plug = the_entry_plug;
26 >
27      
28      strcpy( outName, entry_plug->sampleName );
29      
28    std::cerr << "Opening " << outName << " for dumping.\n";
29
30      outFile.open(outName, ios::out | ios::trunc );
31      
32      if( !outFile ){
# Line 86 | Line 86 | void DumpWriter::writeDump( double currentTime ){
86      
87    for( i=0; i<nAtoms; i++ ){
88        
89 +
90      sprintf( tempBuffer,
91               "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
92               atoms[i]->getType(),
# Line 231 | Line 232 | void DumpWriter::writeDump( double currentTime ){
232  
233        nodeAtomsStart = mpiSim->getMyAtomStart();
234        nodeAtomsEnd = mpiSim->getMyAtomEnd();
234        
235      fprintf( stderr,
236               "node %d: myatomStart-> %d; myatomEnd-> %d\n",
237               worldRank, nodeAtomsStart, nodeAtomsEnd );
235  
236        mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,TAKE_THIS_TAG,
237                          MPI_COMM_WORLD);
238        mpiErr = MPI_Send(&nodeAtomsEnd,1,MPI_INT,0,TAKE_THIS_TAG,
239                          MPI_COMM_WORLD);
240          
244      fprintf( stderr, "node %d: sent off the start and end\n", worldRank );
245
241        sendError = -1;
242        mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,TAKE_THIS_TAG,
243                          MPI_COMM_WORLD, istatus);
244  
250      fprintf( stderr, "node %d: value of sendError is %d\n", worldRank, sendError );
251
245        if (sendError) MPIcheckPoint();
246  
247        // send current node's configuration line by line.
248  
249        for( i=0; i<nAtoms; i++ ){
250 <          
250 >
251          sprintf( tempBuffer,
252                   "%s\t%lf\t%lf\t%lf\t%lf\t%lf\t%lf\t",
253                   atoms[i]->getType(),
# Line 263 | Line 256 | void DumpWriter::writeDump( double currentTime ){
256                   atoms[i]->getZ(),
257                   atoms[i]->get_vx(),
258                   atoms[i]->get_vy(),
259 <                 atoms[i]->get_vz());
259 >                 atoms[i]->get_vz()); // check here.
260          strcpy( writeLine, tempBuffer );
261            
262          if( atoms[i]->isDirectional() ){
# Line 285 | Line 278 | void DumpWriter::writeDump( double currentTime ){
278          else
279            strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" );
280            
288        fprintf( stderr,
289                 "node %d: I'm sending the line:\n->%s\n", worldRank, writeLine );
290        
281          mpiErr = MPI_Send(writeLine,BUFFERSIZE,MPI_CHAR,0,TAKE_THIS_TAG,
282                            MPI_COMM_WORLD);
283        }
# Line 414 | Line 404 | void DumpWriter::writeFinal(){
404      
405      masterIndex = 0;
406      
417    std::cerr << "about to write node 0 aztoms. nAtoms = " << nAtoms << "\n";
418    
407      for( i=0; i<nAtoms; i++ ){
408        
409        sprintf( tempBuffer,

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines