1 |
#ifndef __MPISIMULATION__ |
2 |
#define __MPISIMULATION__ |
3 |
|
4 |
#include "SimInfo.hpp" |
5 |
#include "MakeStamps.hpp" |
6 |
#define __C |
7 |
#include "mpiComponentPlan.h" |
8 |
|
9 |
#include "fortranWrapDefines.hpp" |
10 |
|
11 |
class mpiSimulation{ |
12 |
public: |
13 |
|
14 |
mpiSimulation(SimInfo* the_entryPlug); |
15 |
~mpiSimulation(); |
16 |
|
17 |
int *divideLabor( void ); |
18 |
|
19 |
int getMyNode(void) { return mpiPlug->myNode; } |
20 |
int getNumberProcessors(void) { return mpiPlug->numberProcessors; } |
21 |
int getMyNMol( void ) { return mpiPlug->myNMol; } |
22 |
int getMyNlocal( void ) { return mpiPlug->myNlocal; } |
23 |
int getTotAtoms( void ) { return mpiPlug->nAtomsGlobal; } |
24 |
int* getAtomToProcMap( void ) { return AtomToProcMap; } |
25 |
|
26 |
|
27 |
// sets the internal function pointer to fortran. |
28 |
|
29 |
void setInternal( void (*fSetup) setFortranMPIlist ){ |
30 |
setFsimParallel = fSetup; |
31 |
} |
32 |
|
33 |
|
34 |
// call at the begining and after load balancing |
35 |
|
36 |
void mpiRefresh( void ); |
37 |
|
38 |
protected: |
39 |
SimInfo* entryPlug; |
40 |
mpiSimData* mpiPlug; |
41 |
int *MolToProcMap; |
42 |
int *MolComponentType; |
43 |
int *AtomToProcMap; |
44 |
int *AtomType; |
45 |
|
46 |
// private function to initialize the fortran side of the simulation |
47 |
void (*setFsimParallel) setFortranMPIlist; |
48 |
|
49 |
// int *myIdents; // is needed by Cpp only. It tells the molecule which stamp it is. |
50 |
|
51 |
}; |
52 |
|
53 |
|
54 |
/** |
55 |
The following pointer is the global declaration of the mpiSim |
56 |
object created when the mpiSimulation creation routine is |
57 |
called. Every one who includes the header file will then have |
58 |
access to all of the routines in mpiSimulation class. |
59 |
*/ |
60 |
|
61 |
extern mpiSimulation* mpiSim; |
62 |
|
63 |
#endif |