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 |
|
local_index = 0; |
276 |
|
for (i = 0; i < mpiPlug->nAtomsGlobal; i++) { |
277 |
|
if (AtomToProcMap[i] == mpiPlug->myNode) { |
278 |
< |
globalIndex[local_index] = i; |
278 |
> |
globalAtomIndex[local_index] = i; |
279 |
> |
|
280 |
> |
globalToLocalAtom[i] = local_index; |
281 |
|
local_index++; |
282 |
+ |
|
283 |
|
} |
284 |
+ |
else |
285 |
+ |
globalToLocalAtom[i] = -1; |
286 |
|
} |
287 |
+ |
|
288 |
+ |
globalMolIndex.resize(mpiPlug->myNMol); |
289 |
+ |
local_index = 0; |
290 |
+ |
for (i = 0; i < mpiPlug->nMolGlobal; i++) { |
291 |
+ |
if (MolToProcMap[i] == mpiPlug->myNode) { |
292 |
+ |
globalMolIndex[local_index] = i; |
293 |
+ |
globalToLocalMol[i] = local_index; |
294 |
+ |
local_index++; |
295 |
+ |
} |
296 |
+ |
else |
297 |
+ |
globalToLocalMol[i] = -1; |
298 |
+ |
} |
299 |
|
|
286 |
– |
return globalIndex; |
300 |
|
} |
301 |
|
|
302 |
|
|