--- trunk/OOPSE/libmdtools/DumpReader.cpp 2004/04/21 05:32:17 1128 +++ trunk/OOPSE/libmdtools/DumpReader.cpp 2004/04/22 03:29:30 1129 @@ -273,7 +273,9 @@ void DumpReader :: readSet( int whichFrame ){ int *MolToProcMap = mpiSim->getMolToProcMap(); int localIndex; int nCurObj; + int nitems; + nTotObjs = simnfo->getTotIntegrableObjects(); haveError = 0; if (worldRank == 0) { fsetpos(inFile, framePos[whichFrame]); @@ -286,12 +288,12 @@ void DumpReader :: readSet( int whichFrame ){ simError(); } - nTotObjs = atoi( read_buffer ); + nitems = atoi( read_buffer ); // Check to see that the number of integrable objects in the intial configuration file is the // same as declared in simBass. - if( nTotObjs != simnfo->getTotIntegrableObjects()){ + if( nTotObjs != nitems){ sprintf( painCave.errMsg, "DumpReadererror. %s n_atoms, %d, " "does not match the BASS file's n_atoms, %d.\n", @@ -354,7 +356,7 @@ void DumpReader :: readSet( int whichFrame ){ if(haveError) nodeZeroError(); - parseDumpLine(read_buffer, integrableObjects[i]); + parseDumpLine(read_buffer, integrableObjects[j]); } @@ -363,7 +365,7 @@ void DumpReader :: readSet( int whichFrame ){ else{ //molecule belongs to slave nodes - MPI_Recv(&nCurObj, 1, MPI_INT, 0, + MPI_Recv(&nCurObj, 1, MPI_INT, which_node, TAKE_THIS_TAG_INT, MPI_COMM_WORLD, &istatus); for(j=0; j < integrableObjects.size(); j++){ @@ -393,6 +395,16 @@ void DumpReader :: readSet( int whichFrame ){ } else{ //actions taken at slave nodes + MPI_Bcast(read_buffer, BUFFERSIZE, MPI_CHAR, 0, MPI_COMM_WORLD); + + parseErr = parseCommentLine( read_buffer, simnfo); + + if( parseErr != NULL ){ + strcpy( painCave.errMsg, parseErr ); + haveError = 1; + simError(); + } + for (i=0 ; i < mpiSim->getTotNmol(); i++) { which_node = MolToProcMap[i]; @@ -411,8 +423,8 @@ void DumpReader :: readSet( int whichFrame ){ nCurObj = integrableObjects.size(); - MPI_Recv(&nCurObj, 1, MPI_INT, 0, - TAKE_THIS_TAG_INT, MPI_COMM_WORLD, &istatus); + MPI_Send(&nCurObj, 1, MPI_INT, 0, + TAKE_THIS_TAG_INT, MPI_COMM_WORLD); for(j = 0; j < integrableObjects.size(); j++){