--- trunk/mdtools/md_code/DumpWriter.cpp 2003/01/30 15:20:21 253 +++ trunk/mdtools/md_code/DumpWriter.cpp 2003/01/30 20:03:37 254 @@ -130,7 +130,7 @@ void DumpWriter::writeDump( double currentTime ){ // write out header and node 0's coordinates if( worldRank == 0 ){ - outFile << entry_plug->mpiSim->getTotAtoms() << "\n"; + outFile << mpiSim->getTotAtoms() << "\n"; outFile << currentTime << "\t" << entry_plug->box_x << "\t" @@ -170,13 +170,13 @@ void DumpWriter::writeDump( double currentTime ){ else strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); - outfile << writeLine; + outFile << writeLine; masterIndex++; } outFile.flush(); } - for (procIndex = 1; procIndex < entry_plug->mpiSim->getNumberProcessors(); + for (procIndex = 1; procIndex < mpiSim->getNumberProcessors(); procIndex++){ if( worldRank == 0 ){ @@ -208,9 +208,9 @@ void DumpWriter::writeDump( double currentTime ){ // recieve the nodes writeLines - for ( i = nodeAtomStart; i <= nodeAtomEnd, i++){ + for ( i = nodeAtomsStart; i <= nodeAtomsEnd; i++){ - mpiErr = MPI_Recv(&read_buffer,BUFFERSIZE,MPI_CHAR,procIndex, + mpiErr = MPI_Recv(writeLine,BUFFERSIZE,MPI_CHAR,procIndex, MPI_ANY_TAG,MPI_COMM_WORLD,istatus ); outFile << writeLine; @@ -220,8 +220,8 @@ void DumpWriter::writeDump( double currentTime ){ else if( worldRank == procIndex ){ - nodeAtomStart = entry_plug->mpiSim->getMyAtomStart(); - nodeAtomEnd = entry_plug->mpiSim->getMyAtomEnd(); + nodeAtomsStart = mpiSim->getMyAtomStart(); + nodeAtomsEnd = mpiSim->getMyAtomEnd(); mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,MPI_ANY_TAG, MPI_COMM_WORLD); @@ -230,7 +230,7 @@ void DumpWriter::writeDump( double currentTime ){ mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,MPI_ANY_TAG, MPI_COMM_WORLD, istatus); - if (sendError) mpiCheckpoint(); + if (sendError) MPIcheckPoint(); // send current node's configuration line by line. @@ -273,7 +273,7 @@ void DumpWriter::writeDump( double currentTime ){ sprintf(checkPointMsg,"Node %d sent dump configuration.", procIndex); - mpiCheckPoint(); + MPIcheckPoint(); } #endif // is_mpi @@ -318,8 +318,8 @@ void DumpWriter::writeFinal(){ #ifdef IS_MPI } - sprintf(checkPointMsg,"Opened file for final configuration\n",procIndex); - mpiCheckPoint(); + sprintf(checkPointMsg,"Opened file for final configuration\n"); + MPIcheckPoint(); #endif //is_mpi @@ -384,7 +384,7 @@ void DumpWriter::writeFinal(){ // write out header and node 0's coordinates if( worldRank == 0 ){ - finalOut << entry_plug->mpiSim->getTotAtoms() << "\n"; + finalOut << mpiSim->getTotAtoms() << "\n"; finalOut << entry_plug->box_x << "\t" << entry_plug->box_y << "\t" @@ -423,13 +423,13 @@ void DumpWriter::writeFinal(){ else strcat( writeLine, "0.0\t0.0\t0.0\t0.0\t0.0\t0.0\t0.0\n" ); - outfile << writeLine; + outFile << writeLine; masterIndex++; } finalOut.flush(); } - for (procIndex = 1; procIndex < entry_plug->mpiSim->getNumberProcessors(); + for (procIndex = 1; procIndex < mpiSim->getNumberProcessors(); procIndex++){ if( worldRank == 0 ){ @@ -461,9 +461,9 @@ void DumpWriter::writeFinal(){ // recieve the nodes writeLines - for ( i = nodeAtomStart; i <= nodeAtomEnd, i++){ + for ( i = nodeAtomsStart; i <= nodeAtomsEnd; i++){ - mpiErr = MPI_Recv(&read_buffer,BUFFERSIZE,MPI_CHAR,procIndex, + mpiErr = MPI_Recv(writeLine,BUFFERSIZE,MPI_CHAR,procIndex, MPI_ANY_TAG,MPI_COMM_WORLD,istatus ); finalOut << writeLine; @@ -475,8 +475,8 @@ void DumpWriter::writeFinal(){ else if( worldRank == procIndex ){ - nodeAtomStart = entry_plug->mpiSim->getMyAtomStart(); - nodeAtomEnd = entry_plug->mpiSim->getMyAtomEnd(); + nodeAtomsStart = mpiSim->getMyAtomStart(); + nodeAtomsEnd = mpiSim->getMyAtomEnd(); mpiErr = MPI_Send(&nodeAtomsStart,1,MPI_INT,0,MPI_ANY_TAG, MPI_COMM_WORLD); @@ -485,7 +485,7 @@ void DumpWriter::writeFinal(){ mpiErr = MPI_Recv(&sendError,1,MPI_INT,0,MPI_ANY_TAG, MPI_COMM_WORLD, istatus); - if (sendError) mpiCheckpoint(); + if (sendError) MPIcheckPoint(); // send current node's configuration line by line. @@ -528,7 +528,7 @@ void DumpWriter::writeFinal(){ sprintf(checkPointMsg,"Node %d sent dump configuration.", procIndex); - mpiCheckPoint(); + MPIcheckPoint(); } if( worldRank == 0 ) finalOut.close();