--- trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/04/14 15:37:41 1108 +++ trunk/OOPSE/libmdtools/DumpWriter.cpp 2004/04/22 03:29:30 1129 @@ -91,7 +91,7 @@ void DumpWriter::sortByGlobalIndex(){ Molecule* mols = entry_plug->molecules; indexArray.clear(); - for(int i = 0; i < mpiSim->getMyNlocal();i++) + for(int i = 0; i < entry_plug->n_mol;i++) indexArray.push_back(make_pair(i, mols[i].getGlobalIndex())); sort(indexArray.begin(), indexArray.end(), indexSortingCriterion); @@ -366,7 +366,7 @@ void DumpWriter::writeFrame( vector& outFil // so wrap this processor potato back to 0: potatoes[which_node] = 0; - MPI_Send(0, 1, MPI_INT, which_node, 0, MPI_COMM_WORLD); + MPI_Send(&potatoes[which_node], 1, MPI_INT, which_node, 0, MPI_COMM_WORLD); } @@ -375,6 +375,7 @@ void DumpWriter::writeFrame( vector& outFil //recieve the number of integrableObject in current molecule MPI_Recv(&nCurObj, 1, MPI_INT, which_node, myPotato, MPI_COMM_WORLD, &istatus); + myPotato++; for(int l = 0; l < nCurObj; l++){ @@ -383,7 +384,7 @@ void DumpWriter::writeFrame( vector& outFil // so wrap this processor potato back to 0: potatoes[which_node] = 0; - MPI_Send(0, 1, MPI_INT, which_node, 0, MPI_COMM_WORLD); + MPI_Send(&potatoes[which_node], 1, MPI_INT, which_node, 0, MPI_COMM_WORLD); } @@ -544,6 +545,7 @@ void DumpWriter::writeFrame( vector& outFil MPI_Send(&nCurObj, 1, MPI_INT, 0, myPotato, MPI_COMM_WORLD); + myPotato++; for( iter = integrableObjects.begin(); iter != integrableObjects.end(); iter++){ @@ -630,13 +632,14 @@ void DumpWriter::writeFrame( vector& outFil } } - - } sprintf( checkPointMsg, "Sucessfully took a dump.\n"); - MPIcheckPoint(); + MPIcheckPoint(); + } + + #endif // is_mpi }