--- trunk/mdtools/md_code/DumpWriter.cpp 2003/01/31 21:04:27 260 +++ trunk/mdtools/md_code/DumpWriter.cpp 2003/02/03 21:15:59 261 @@ -17,16 +17,16 @@ DumpWriter::DumpWriter( SimInfo* the_entry_plug ){ DumpWriter::DumpWriter( SimInfo* the_entry_plug ){ + entry_plug = the_entry_plug; + #ifdef IS_MPI if(worldRank == 0 ){ #endif // is_mpi - entry_plug = the_entry_plug; + strcpy( outName, entry_plug->sampleName ); - std::cerr << "Opening " << outName << " for dumping.\n"; - outFile.open(outName, ios::out | ios::trunc ); if( !outFile ){ @@ -86,6 +86,7 @@ void DumpWriter::writeDump( double currentTime ){ for( i=0; igetType(), @@ -231,30 +232,22 @@ void DumpWriter::writeDump( double currentTime ){ nodeAtomsStart = mpiSim->getMyAtomStart(); nodeAtomsEnd = mpiSim->getMyAtomEnd(); - - fprintf( stderr, - "node %d: myatomStart-> %d; myatomEnd-> %d\n", - worldRank, nodeAtomsStart, nodeAtomsEnd ); mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,TAKE_THIS_TAG, MPI_COMM_WORLD); mpiErr = MPI_Send(&nodeAtomsEnd,1,MPI_INT,0,TAKE_THIS_TAG, MPI_COMM_WORLD); - fprintf( stderr, "node %d: sent off the start and end\n", worldRank ); - sendError = -1; mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,TAKE_THIS_TAG, MPI_COMM_WORLD, istatus); - fprintf( stderr, "node %d: value of sendError is %d\n", worldRank, sendError ); - if (sendError) MPIcheckPoint(); // send current node's configuration line by line. for( i=0; igetType(), @@ -263,7 +256,7 @@ void DumpWriter::writeDump( double currentTime ){ atoms[i]->getZ(), atoms[i]->get_vx(), atoms[i]->get_vy(), - atoms[i]->get_vz()); + atoms[i]->get_vz()); // check here. strcpy( writeLine, tempBuffer ); if( atoms[i]->isDirectional() ){ @@ -285,9 +278,6 @@ void DumpWriter::writeDump( double currentTime ){ else strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); - fprintf( stderr, - "node %d: I'm sending the line:\n->%s\n", worldRank, writeLine ); - mpiErr = MPI_Send(writeLine,BUFFERSIZE,MPI_CHAR,0,TAKE_THIS_TAG, MPI_COMM_WORLD); } @@ -414,8 +404,6 @@ void DumpWriter::writeFinal(){ masterIndex = 0; - std::cerr << "about to write node 0 aztoms. nAtoms = " << nAtoms << "\n"; - for( i=0; i