--- trunk/OOPSE/libmdtools/ZConsWriter.cpp 2003/08/20 14:34:04 701 +++ trunk/OOPSE/libmdtools/ZConsWriter.cpp 2004/05/27 00:48:12 1198 @@ -18,14 +18,14 @@ ZConsWriter::ZConsWriter(const char* filename, vector< if(!output){ sprintf( painCave.errMsg, - "Could not open \"s\" for z constrain output \n", + "Could not open %s for z constrain output \n", filename); painCave.isFatal = 1; simError(); } output << "#number of z constrain molecules" << endl; output << "#global Index of molecule\tzPos" << endl; - output << "every frame will contain below data" <getMolToProcMap(); - for(int i = 0; i < parameters->size(); i++){ + for(int i = 0; i < (int)(parameters->size()); i++){ globalIndexOfCurMol = (*parameters)[i].zconsIndex; whichNode = MolToProcMap[globalIndexOfCurMol]; @@ -107,17 +108,18 @@ void ZConsWriter::writeFZ(double time, int num, int* i status = RequesPosAndForce; MPI_Send(&status, 1, MPI_INT, whichNode, tag, MPI_COMM_WORLD); MPI_Send(&globalIndexOfCurMol, 1, MPI_INT, whichNode, tag, MPI_COMM_WORLD); - MPI_Recv(&force, 1, MPI_DOUBLE_PRECISION, whichNode, tag, MPI_COMM_WORLD, &ierr); - MPI_Recv(&pos, 1, MPI_DOUBLE_PRECISION, whichNode, tag, MPI_COMM_WORLD, &ierr); + MPI_Recv(&force, 1, MPI_DOUBLE, whichNode, tag, MPI_COMM_WORLD, &ierr); + MPI_Recv(&pos, 1, MPI_DOUBLE, whichNode, tag, MPI_COMM_WORLD, &ierr); + MPI_Recv(&zconsPos, 1, MPI_DOUBLE, whichNode, tag, MPI_COMM_WORLD, &ierr); } - output << globalIndexOfCurMol << "\t" << force << "\t" << pos << endl; + output << globalIndexOfCurMol << "\t" << force << "\t" << pos << "\t"<< zconsPos << endl; } //End of Request Loop //Send ending request message to slave nodes status = EndOfRequest; - for(int i =1; i < mpiSim->getNumberProcessors(); i++) + for(int i =1; i < mpiSim->getNprocessors(); i++) MPI_Send(&status, 1, MPI_INT, i, tag, MPI_COMM_WORLD); } @@ -142,8 +144,9 @@ void ZConsWriter::writeFZ(double time, int num, int* i break; } - MPI_Send(&fz[localIndex], 1, MPI_DOUBLE_PRECISION, 0, tag, MPI_COMM_WORLD); - MPI_Send(&curZPos[localIndex], 1, MPI_DOUBLE_PRECISION, 0, tag, MPI_COMM_WORLD); + MPI_Send(&fz[localIndex], 1, MPI_DOUBLE, 0, tag, MPI_COMM_WORLD); + MPI_Send(&curZPos[localIndex], 1, MPI_DOUBLE, 0, tag, MPI_COMM_WORLD); + MPI_Send(&zpos[localIndex], 1, MPI_DOUBLE, 0, tag, MPI_COMM_WORLD); break; case EndOfRequest : @@ -171,7 +174,7 @@ void ZConsWriter::writeZPos(){ output << parameters->size() << endl; - for(int i =0 ; i < parameters->size(); i++) + for(int i =0 ; i < (int)(parameters->size()); i++) output << (*parameters)[i].zconsIndex << "\t" << (*parameters)[i].zPos << endl; #ifdef IS_MPI