1 |
|
#ifdef IS_MPI |
2 |
|
#include <iostream> |
3 |
< |
#include <cstdlib> |
4 |
< |
#include <cstring> |
5 |
< |
#include <cmath> |
3 |
> |
#include <stdlib.h> |
4 |
> |
#include <string.h> |
5 |
> |
#include <math.h> |
6 |
|
#include <mpi.h> |
7 |
|
|
8 |
|
#include "mpiSimulation.hpp" |
10 |
|
#include "fortranWrappers.hpp" |
11 |
|
#include "randomSPRNG.hpp" |
12 |
|
|
13 |
– |
#define BASE_SEED 123456789 |
14 |
– |
|
13 |
|
mpiSimulation* mpiSim; |
14 |
|
|
15 |
|
mpiSimulation::mpiSimulation(SimInfo* the_entryPlug) |
57 |
|
int old_atoms, add_atoms, new_atoms; |
58 |
|
|
59 |
|
int nTarget; |
60 |
< |
int molIndex, atomIndex, compIndex, compStart; |
60 |
> |
int molIndex, atomIndex; |
61 |
|
int done; |
64 |
– |
int nLocal, molLocal; |
62 |
|
int i, j, loops, which_proc, nmol_local, natoms_local; |
63 |
|
int nmol_global, natoms_global; |
64 |
< |
int local_index, index; |
65 |
< |
int smallDiff, bigDiff; |
69 |
< |
int baseSeed = BASE_SEED; |
70 |
< |
|
71 |
< |
int testSum; |
64 |
> |
int local_index; |
65 |
> |
int baseSeed = entryPlug->getSeed(); |
66 |
|
|
67 |
|
nComponents = entryPlug->nComponents; |
68 |
|
compStamps = entryPlug->compStamps; |
76 |
|
mpiPlug->nSRIGlobal = entryPlug->n_SRI; |
77 |
|
mpiPlug->nMolGlobal = entryPlug->n_mol; |
78 |
|
|
79 |
+ |
|
80 |
|
myRandom = new randomSPRNG( baseSeed ); |
81 |
|
|
82 |
|
a = 3.0 * (double)mpiPlug->nMolGlobal / (double)mpiPlug->nAtomsGlobal; |
127 |
|
// How many atoms does this processor have? |
128 |
|
|
129 |
|
old_atoms = AtomsPerProc[which_proc]; |
130 |
< |
add_atoms = compStamps[MolComponentType[i]]->getNAtoms(); |
130 |
> |
add_atoms = compStamps[MolComponentType[i]]->getTotAtoms(); |
131 |
|
new_atoms = old_atoms + add_atoms; |
132 |
|
|
133 |
|
// If we've been through this loop too many times, we need |