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

Comparing trunk/OOPSE/libmdtools/mpiSimulation.cpp (file contents):
Revision 958 by gezelter, Mon Jan 19 16:09:52 2004 UTC vs.
Revision 1129 by tim, Thu Apr 22 03:29:30 2004 UTC

# Line 40 | Line 40 | int* mpiSimulation::divideLabor( void ){
40    
41   }
42  
43 < int* mpiSimulation::divideLabor( void ){
44 <
45 <  int* globalIndex;
43 > void mpiSimulation::divideLabor( ){
44  
45    int nComponents;
46    MoleculeStamp** compStamps;
# Line 76 | Line 74 | int* mpiSimulation::divideLabor( void ){
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;
# Line 127 | Line 124 | int* mpiSimulation::divideLabor( void ){
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
# Line 274 | Line 271 | int* mpiSimulation::divideLabor( void ){
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines