| 229 | 
  | 
      simError(); | 
| 230 | 
  | 
    } | 
| 231 | 
  | 
 | 
| 232 | 
< | 
    for (i=0 ; i < mpiSim->getTotNmol(); i++) { | 
| 232 | 
> | 
    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) { | 
| 233 | 
  | 
      which_node = MolToProcMap[i]; | 
| 234 | 
  | 
      if(which_node == 0){ | 
| 235 | 
  | 
       //molecules belong to master node | 
| 308 | 
  | 
      simError(); | 
| 309 | 
  | 
    } | 
| 310 | 
  | 
   | 
| 311 | 
< | 
    for (i=0 ; i < mpiSim->getTotNmol(); i++) { | 
| 311 | 
> | 
    for (i=0 ; i < mpiSim->getNMolGlobal(); i++) { | 
| 312 | 
  | 
      which_node = MolToProcMap[i]; | 
| 313 | 
  | 
       | 
| 314 | 
  | 
      if(which_node == worldRank){ | 
| 518 | 
  | 
 | 
| 519 | 
  | 
    qSqr = (q[0] * q[0]) + (q[1] * q[1]) + (q[2] * q[2]) + (q[3] * q[3]); | 
| 520 | 
  | 
 | 
| 521 | 
+ | 
    if (fabs(qSqr) < 1e-6) { | 
| 522 | 
+ | 
      sprintf(painCave.errMsg, | 
| 523 | 
+ | 
          "initial quaternion error (q0^2 + q1^2 + q2^2 + q3^2 ~ 0).\n"); | 
| 524 | 
+ | 
       return strdup(painCave.errMsg); | 
| 525 | 
+ | 
    } | 
| 526 | 
+ | 
     | 
| 527 | 
  | 
    qLength = sqrt( qSqr ); | 
| 528 | 
  | 
    q[0] = q[0] / qLength; | 
| 529 | 
  | 
    q[1] = q[1] / qLength; | 
| 655 | 
  | 
  int j, myStatus; | 
| 656 | 
  | 
 | 
| 657 | 
  | 
  myStatus = 0; | 
| 658 | 
< | 
  for (j = 0; j < mpiSim->getNumberProcessors(); j++) { | 
| 658 | 
> | 
  for (j = 0; j < mpiSim->getNProcessors(); j++) { | 
| 659 | 
  | 
    MPI_Send( &myStatus, 1, MPI_INT, j, | 
| 660 | 
  | 
              TAKE_THIS_TAG_INT, MPI_COMM_WORLD); | 
| 661 | 
  | 
  } |