--- trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/01/09 20:29:32 916 +++ trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/01/10 09:46:47 920 @@ -161,6 +161,7 @@ void DumpWriter::writeDump( double currentTime ){ #else // is_mpi /* code to find maximum tag value */ + int *tagub, flag, MAXTAG; MPI_Attr_get(MPI_COMM_WORLD, MPI_TAG_UB, &tagub, &flag); if (flag) { @@ -227,12 +228,13 @@ void DumpWriter::writeDump( double currentTime ){ MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, myPotato, MPI_COMM_WORLD, &istatus); - strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE); + //strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE); // Null terminate the atomTypeString just in case: - atomTypeString[strlen(atomTypeString) - 1] = '\0'; - + //atomTypeString[strlen(atomTypeString) - 1] = '\0'; + atomTypeString = MPIatomTypeString; + myPotato++; MPI_Recv(&isDirectional, 1, MPI_INT, which_node, @@ -357,7 +359,7 @@ void DumpWriter::writeDump( double currentTime ){ sprintf( checkPointMsg, "Sucessfully took a dump.\n"); MPIcheckPoint(); - + delete[] potatoes; } else { // worldRank != 0, so I'm a remote node. @@ -381,8 +383,8 @@ void DumpWriter::writeDump( double currentTime ){ MPI_Recv(&myPotato, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &istatus); } - - local_index=-1; + which_atom = i; + local_index=-1; for (j=0; (jgetMyNlocal()) && (local_index < 0); j++) { if (atoms[j]->getGlobalIndex() == which_atom) local_index = j; } @@ -659,12 +661,8 @@ void DumpWriter::writeFinal(double finalTime){ MPI_Recv(MPIatomTypeString, MINIBUFFERSIZE, MPI_CHAR, which_node, myPotato, MPI_COMM_WORLD, &istatus); - strncpy(atomTypeString, MPIatomTypeString, MINIBUFFERSIZE); - - // Null terminate the atomTypeString just in case: - - atomTypeString[strlen(atomTypeString) - 1] = '\0'; - + atomTypeString = MPIatomTypeString; + myPotato++; MPI_Recv(&isDirectional, 1, MPI_INT, which_node, @@ -788,6 +786,8 @@ void DumpWriter::writeFinal(double finalTime){ finalOut.flush(); sprintf( checkPointMsg, "Sucessfully took a dump.\n"); + delete[] potatoes; + MPIcheckPoint(); } else { @@ -813,7 +813,7 @@ void DumpWriter::writeFinal(double finalTime){ MPI_Recv(&myPotato, 1, MPI_INT, 0, 0, MPI_COMM_WORLD, &istatus); } - + which_atom = i; local_index=-1; for (j=0; (jgetMyNlocal()) && (local_index < 0); j++) { if (atoms[j]->getGlobalIndex() == which_atom) local_index = j;