| 40 | 
  | 
   | 
| 41 | 
  | 
} | 
| 42 | 
  | 
 | 
| 43 | 
< | 
int* mpiSimulation::divideLabor( void ){ | 
| 44 | 
< | 
 | 
| 45 | 
< | 
  int* globalIndex; | 
| 43 | 
> | 
void mpiSimulation::divideLabor( ){ | 
| 44 | 
  | 
 | 
| 45 | 
  | 
  int nComponents; | 
| 46 | 
  | 
  MoleculeStamp** compStamps; | 
| 74 | 
  | 
  mpiPlug->nSRIGlobal = entryPlug->n_SRI; | 
| 75 | 
  | 
  mpiPlug->nMolGlobal = entryPlug->n_mol; | 
| 76 | 
  | 
 | 
| 79 | 
– | 
   | 
| 77 | 
  | 
  myRandom = new randomSPRNG( baseSeed ); | 
| 78 | 
  | 
 | 
| 79 | 
  | 
  a = 3.0 * (double)mpiPlug->nMolGlobal / (double)mpiPlug->nAtomsGlobal; | 
| 124 | 
  | 
        // How many atoms does this processor have? | 
| 125 | 
  | 
         | 
| 126 | 
  | 
        old_atoms = AtomsPerProc[which_proc]; | 
| 127 | 
< | 
        add_atoms = compStamps[MolComponentType[i]]->getTotAtoms(); | 
| 127 | 
> | 
        add_atoms = compStamps[MolComponentType[i]]->getNAtoms(); | 
| 128 | 
  | 
        new_atoms = old_atoms + add_atoms; | 
| 129 | 
  | 
 | 
| 130 | 
  | 
        // If we've been through this loop too many times, we need | 
| 271 | 
  | 
  mpiPlug->myNMol = nmol_local; | 
| 272 | 
  | 
  mpiPlug->myNlocal = natoms_local; | 
| 273 | 
  | 
 | 
| 274 | 
< | 
  globalIndex = new int[mpiPlug->myNlocal]; | 
| 274 | 
> | 
  globalAtomIndex.resize(mpiPlug->myNlocal); | 
| 275 | 
> | 
  globalToLocalAtom.resize(mpiPlug->nAtomsGlobal); | 
| 276 | 
  | 
  local_index = 0; | 
| 277 | 
  | 
  for (i = 0; i < mpiPlug->nAtomsGlobal; i++) { | 
| 278 | 
  | 
    if (AtomToProcMap[i] == mpiPlug->myNode) { | 
| 279 | 
< | 
      globalIndex[local_index] = i; | 
| 279 | 
> | 
      globalAtomIndex[local_index] = i; | 
| 280 | 
> | 
 | 
| 281 | 
> | 
      globalToLocalAtom[i] = local_index; | 
| 282 | 
> | 
      local_index++; | 
| 283 | 
> | 
       | 
| 284 | 
> | 
    } | 
| 285 | 
> | 
    else | 
| 286 | 
> | 
       globalToLocalAtom[i] = -1; | 
| 287 | 
> | 
  } | 
| 288 | 
> | 
 | 
| 289 | 
> | 
  globalMolIndex.resize(mpiPlug->myNMol); | 
| 290 | 
> | 
  globalToLocalMol.resize(mpiPlug->nMolGlobal); | 
| 291 | 
> | 
   | 
| 292 | 
> | 
  local_index = 0; | 
| 293 | 
> | 
  for (i = 0; i < mpiPlug->nMolGlobal; i++) { | 
| 294 | 
> | 
    if (MolToProcMap[i] == mpiPlug->myNode) { | 
| 295 | 
> | 
      globalMolIndex[local_index] = i; | 
| 296 | 
> | 
      globalToLocalMol[i] = local_index; | 
| 297 | 
  | 
      local_index++; | 
| 298 | 
  | 
    } | 
| 299 | 
+ | 
    else | 
| 300 | 
+ | 
      globalToLocalMol[i] = -1; | 
| 301 | 
  | 
  } | 
| 302 | 
  | 
   | 
| 286 | 
– | 
  return globalIndex; | 
| 303 | 
  | 
} | 
| 304 | 
  | 
 | 
| 305 | 
  | 
 |