| 248 | 
  | 
   | 
| 249 | 
  | 
  int localMol, allMol; | 
| 250 | 
  | 
  int local_atoms, local_bonds, local_bends, local_torsions, local_SRI; | 
| 251 | 
+ | 
 | 
| 252 | 
+ | 
  int* mol2proc = mpiSim->getMolToProcMap(); | 
| 253 | 
+ | 
  int* molCompType = mpiSim->getMolComponentType(); | 
| 254 | 
  | 
   | 
| 255 | 
  | 
  allMol = 0; | 
| 256 | 
  | 
  localMol = 0; | 
| 262 | 
  | 
 | 
| 263 | 
  | 
    for( j=0; j<components_nmol[i]; j++ ){ | 
| 264 | 
  | 
       | 
| 265 | 
< | 
      if( mpiSim->getMyMolStart() <= allMol && | 
| 263 | 
< | 
          allMol <= mpiSim->getMyMolEnd() ){ | 
| 265 | 
> | 
      if( mol2proc[j] == worldRank ){ | 
| 266 | 
  | 
         | 
| 267 | 
  | 
        local_atoms +=    comp_stamps[i]->getNAtoms(); | 
| 268 | 
  | 
        local_bonds +=    comp_stamps[i]->getNBonds(); | 
| 281 | 
  | 
  if( local_atoms != simnfo->n_atoms ){ | 
| 282 | 
  | 
    sprintf( painCave.errMsg, | 
| 283 | 
  | 
             "SimSetup error: mpiSim's localAtom (%d) and SimSetup's" | 
| 284 | 
< | 
             " localAtom (%d) are note equal.\n", | 
| 284 | 
> | 
             " localAtom (%d) are not equal.\n", | 
| 285 | 
  | 
             simnfo->n_atoms, | 
| 286 | 
  | 
             local_atoms ); | 
| 287 | 
  | 
    painCave.isFatal = 1; | 
| 306 | 
  | 
  Atom::createArrays(simnfo->n_atoms); | 
| 307 | 
  | 
  the_atoms = new Atom*[simnfo->n_atoms]; | 
| 308 | 
  | 
  the_molecules = new Molecule[simnfo->n_mol]; | 
| 309 | 
+ | 
  int molIndex; | 
| 310 | 
+ | 
 | 
| 311 | 
+ | 
  // initialize the molecule's stampID's | 
| 312 | 
+ | 
 | 
| 313 | 
+ | 
#ifdef IS_MPI | 
| 314 | 
+ | 
   | 
| 315 | 
+ | 
 | 
| 316 | 
+ | 
  molIndex = 0; | 
| 317 | 
+ | 
  for(i=0; i<mpiSim->getTotNmol(); i++){ | 
| 318 | 
+ | 
     | 
| 319 | 
+ | 
    if(mol2proc[i] == worldRank ){ | 
| 320 | 
+ | 
      the_molecules[molIndex].setStampID( molCompType[i] ); | 
| 321 | 
+ | 
      molIndex++; | 
| 322 | 
+ | 
    } | 
| 323 | 
+ | 
  } | 
| 324 | 
+ | 
 | 
| 325 | 
+ | 
#else // is_mpi | 
| 326 | 
+ | 
   | 
| 327 | 
+ | 
  molIndex = 0; | 
| 328 | 
+ | 
  for(i=0; i<n_components; i++){ | 
| 329 | 
+ | 
    for(j=0; j<components_nmol[i]; j++ ){ | 
| 330 | 
+ | 
      the_molecules[molIndex].setStampID( i ); | 
| 331 | 
+ | 
      molIndex++; | 
| 332 | 
+ | 
    } | 
| 333 | 
+ | 
  } | 
| 334 | 
+ | 
     | 
| 335 | 
  | 
 | 
| 336 | 
+ | 
#endif // is_mpi | 
| 337 | 
  | 
 | 
| 338 | 
+ | 
 | 
| 339 | 
  | 
  if( simnfo->n_SRI ){ | 
| 340 | 
  | 
    Exclude::createArray(simnfo->n_SRI); | 
| 341 | 
  | 
    the_excludes = new Exclude*[simnfo->n_SRI]; | 
| 356 | 
  | 
  // set the arrays into the SimInfo object | 
| 357 | 
  | 
 | 
| 358 | 
  | 
  simnfo->atoms = the_atoms; | 
| 329 | 
– | 
  simnfo->sr_interactions = the_sris; | 
| 359 | 
  | 
  simnfo->nGlobalExcludes = 0; | 
| 360 | 
  | 
  simnfo->excludes = the_excludes; | 
| 361 | 
  | 
 | 
| 412 | 
  | 
 | 
| 413 | 
  | 
  the_ff->setSimInfo( simnfo ); | 
| 414 | 
  | 
 | 
| 415 | 
< | 
  makeAtoms(); | 
| 415 | 
> | 
  makeMolecules(); | 
| 416 | 
  | 
  simnfo->identArray = new int[simnfo->n_atoms]; | 
| 417 | 
  | 
  for(i=0; i<simnfo->n_atoms; i++){ | 
| 418 | 
  | 
    simnfo->identArray[i] = the_atoms[i]->getIdent(); | 
| 419 | 
  | 
  } | 
| 420 | 
  | 
   | 
| 392 | 
– | 
  if( tot_bonds ){ | 
| 393 | 
– | 
    makeBonds(); | 
| 394 | 
– | 
  } | 
| 395 | 
– | 
 | 
| 396 | 
– | 
  if( tot_bends ){ | 
| 397 | 
– | 
    makeBends(); | 
| 398 | 
– | 
  } | 
| 399 | 
– | 
 | 
| 400 | 
– | 
  if( tot_torsions ){ | 
| 401 | 
– | 
    makeTorsions(); | 
| 402 | 
– | 
  } | 
| 403 | 
– | 
 | 
| 404 | 
– | 
 | 
| 421 | 
  | 
  if (the_globals->getUseRF() ) { | 
| 422 | 
  | 
    simnfo->useReactionField = 1; | 
| 423 | 
  | 
   |