ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/DumpReader.cpp
(Generate patch)

Comparing trunk/OOPSE/libmdtools/DumpReader.cpp (file contents):
Revision 1130 by tim, Thu Apr 22 14:55:17 2004 UTC vs.
Revision 1268 by tim, Fri Jun 11 17:16:21 2004 UTC

# Line 84 | Line 84 | void DumpReader::scanFile( void ){
84  
85   void DumpReader::scanFile( void ){
86  
87 <  int vectorSize;
88 <  int i, j, k;
87 >  int i, j;
88    int lineNum = 0;
89    char readBuffer[2000];
91  char* foo;
90    fpos_t *currPos;
93  double time;
94
95
91  
92   #ifdef IS_MPI
93    if( worldRank == 0 ){
# Line 176 | Line 171 | void DumpReader :: readSet( int whichFrame ){
171  
172   void DumpReader :: readSet( int whichFrame ){
173  
174 <   int i, j;
174 >  int i;
175 >  unsigned int j;
176  
177   #ifdef IS_MPI
178    int done, which_node, which_atom; // loop counter
# Line 327 | Line 323 | void DumpReader :: readSet( int whichFrame ){
323        simError();
324      }
325  
326 <    for (i=0 ; i < mpiSim->getTotNmol(); i++) {
326 >    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) {
327        which_node = MolToProcMap[i];
328        if(which_node == 0){
329         //molecules belong to master node
# Line 405 | Line 401 | void DumpReader :: readSet( int whichFrame ){
401        simError();
402      }
403    
404 <    for (i=0 ; i < mpiSim->getTotNmol(); i++) {
404 >    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) {
405        which_node = MolToProcMap[i];
406        
407        if(which_node == worldRank){
# Line 615 | Line 611 | char* DumpReader::parseDumpLine(char* readLine, StuntD
611      // check that the quaternion vector is normalized
612  
613      qSqr = (q[0] * q[0]) + (q[1] * q[1]) + (q[2] * q[2]) + (q[3] * q[3]);
614 +
615 +    if (fabs(qSqr) < 1e-6) {
616 +      sprintf(painCave.errMsg,
617 +          "initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2 ~ 0).\n");
618 +       return strdup(painCave.errMsg);
619 +    }
620  
621      qLength = sqrt( qSqr );
622      q[0] = q[0] / qLength;
# Line 744 | Line 746 | void DumpReader::nodeZeroError( void ){
746    int j, myStatus;
747  
748    myStatus = 0;
749 <  for (j = 0; j < mpiSim->getNumberProcessors(); j++) {
749 >  for (j = 0; j < mpiSim->getNProcessors(); j++) {
750      MPI_Send( &myStatus, 1, MPI_INT, j,
751                TAKE_THIS_TAG_INT, MPI_COMM_WORLD);
752    }
# Line 760 | Line 762 | void DumpReader::anonymousNodeDie( void ){
762    MPI_Finalize();
763    exit (0);
764   }
765 < #endif
765 > #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines