--- trunk/OOPSE/libmdtools/DumpReader.cpp 2004/04/22 14:55:17 1130 +++ trunk/OOPSE/libmdtools/DumpReader.cpp 2004/06/11 17:16:21 1268 @@ -84,15 +84,10 @@ void DumpReader::scanFile( void ){ void DumpReader::scanFile( void ){ - int vectorSize; - int i, j, k; + int i, j; int lineNum = 0; char readBuffer[2000]; - char* foo; fpos_t *currPos; - double time; - - #ifdef IS_MPI if( worldRank == 0 ){ @@ -176,7 +171,8 @@ void DumpReader :: readSet( int whichFrame ){ void DumpReader :: readSet( int whichFrame ){ - int i, j; + int i; + unsigned int j; #ifdef IS_MPI int done, which_node, which_atom; // loop counter @@ -327,7 +323,7 @@ void DumpReader :: readSet( int whichFrame ){ simError(); } - for (i=0 ; i < mpiSim->getTotNmol(); i++) { + for (i=0 ; i < mpiSim->getNMolGlobal(); i++) { which_node = MolToProcMap[i]; if(which_node == 0){ //molecules belong to master node @@ -405,7 +401,7 @@ void DumpReader :: readSet( int whichFrame ){ simError(); } - for (i=0 ; i < mpiSim->getTotNmol(); i++) { + for (i=0 ; i < mpiSim->getNMolGlobal(); i++) { which_node = MolToProcMap[i]; if(which_node == worldRank){ @@ -615,6 +611,12 @@ char* DumpReader::parseDumpLine(char* readLine, StuntD // check that the quaternion vector is normalized qSqr = (q[0] * q[0]) + (q[1] * q[1]) + (q[2] * q[2]) + (q[3] * q[3]); + + if (fabs(qSqr) < 1e-6) { + sprintf(painCave.errMsg, + "initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2 ~ 0).\n"); + return strdup(painCave.errMsg); + } qLength = sqrt( qSqr ); q[0] = q[0] / qLength; @@ -744,7 +746,7 @@ void DumpReader::nodeZeroError( void ){ int j, myStatus; myStatus = 0; - for (j = 0; j < mpiSim->getNumberProcessors(); j++) { + for (j = 0; j < mpiSim->getNProcessors(); j++) { MPI_Send( &myStatus, 1, MPI_INT, j, TAKE_THIS_TAG_INT, MPI_COMM_WORLD); } @@ -760,4 +762,4 @@ void DumpReader::anonymousNodeDie( void ){ MPI_Finalize(); exit (0); } -#endif \ No newline at end of file +#endif