# | Line 1 | Line 1 | |
---|---|---|
1 | < | #include <mpi++.h> |
2 | < | #include <mpiSimulation.hpp> |
1 | > | #include <cstdlib> |
2 | > | #include <cstring> |
3 | > | #include <mpi.h> |
4 | ||
5 | < | mpiSimulation::mpiSimulation() |
6 | < | { |
6 | < | int mpi_error; |
5 | > | #include "mpiSimulation.hpp" |
6 | > | #include "simError.h" |
7 | ||
8 | – | MPI::Init(); |
8 | ||
10 | – | numberProcessors = MPI::Comm::Get_size(); |
11 | – | myNode = MPI::Comm::Get_rank(); |
12 | – | MPI::Get_processor_name(processorName,&processorNameLen); |
13 | – | } |
9 | ||
10 | < | mpiSimulation::mpiInitSimulation(SimInfo* entry_plug) |
10 | > | mpiSimulation::mpiSimulation(SimInfo* the_entryPlug) |
11 | { | |
12 | + | entryPlug = the_entryPlug |
13 | ||
14 | < | // need to get nmol here...... |
14 | > | numberProcessors = MPI::COMM_WORLD.Get_size(); |
15 | > | myNode = worldRank; |
16 | ||
17 | + | // let the simulkation know were there. |
18 | + | entryPlug->mpiSim = this; |
19 | + | } |
20 | ||
21 | ||
22 | < | myMolStart = nint(float(node)/numberProcessors*entry_plug->n_mol); |
23 | < | myMolEnd = nint(float(node + 1)/numberProcessors*entry_plug->n_mol;); |
24 | < | nMolLocal = myMolEnd - myMolStart + 1 |
22 | > | mpiSimulation::~mpiSimulation(){ |
23 | > | |
24 | > | // empty for now |
25 | > | |
26 | } | |
27 | + | |
28 | + |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |