| 1 |
gezelter |
2 |
#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 |
|
|
void divideLabor(); |
| 18 |
|
|
|
| 19 |
|
|
int getMyNode( void ) { return parallelData->myNode; } |
| 20 |
|
|
int getNProcessors( void ) { return parallelData->nProcessors; } |
| 21 |
|
|
int getNMolLocal( void ) { return parallelData->nMolLocal; } |
| 22 |
|
|
int getNMolGlobal( void ) { return parallelData->nMolGlobal; } |
| 23 |
|
|
int getNAtomsLocal( void ) { return parallelData->nAtomsLocal; } |
| 24 |
|
|
int getNAtomsGlobal( void ) { return parallelData->nAtomsGlobal; } |
| 25 |
|
|
int getNGroupsLocal( void ) { return parallelData->nGroupsLocal; } |
| 26 |
|
|
int getNGroupsGlobal( void ) { return parallelData->nGroupsGlobal; } |
| 27 |
|
|
int* getAtomToProcMap( void ) { return AtomToProcMap; } |
| 28 |
|
|
int* getGroupToProcMap( void ) { return GroupToProcMap; } |
| 29 |
|
|
int* getMolToProcMap( void ) { return MolToProcMap; } |
| 30 |
|
|
int* getMolComponentType(void) { return MolComponentType; } |
| 31 |
|
|
vector<int> getGlobalAtomIndex(void) {return globalAtomIndex; } |
| 32 |
|
|
vector<int> getGlobalGroupIndex(void) {return globalGroupIndex; } |
| 33 |
|
|
vector<int> getGlobalMolIndex(void) {return globalMolIndex;} |
| 34 |
|
|
int getGlobalToLocalMol(int globalIndex) {return globalToLocalMol[globalIndex];} |
| 35 |
|
|
int getGlobalToLocalAtom(int globalIndex) {return globalToLocalAtom[globalIndex];} |
| 36 |
|
|
int getGlobalToLocalGroup(int globalIndex) {return globalToLocalGroup[globalIndex];} |
| 37 |
|
|
|
| 38 |
|
|
// sets the internal function pointer to fortran. |
| 39 |
|
|
|
| 40 |
|
|
void setInternal( setFortranMPI_TD fSetup){ |
| 41 |
|
|
setFsimParallel = fSetup; |
| 42 |
|
|
} |
| 43 |
|
|
|
| 44 |
|
|
|
| 45 |
|
|
// call at the begining and after load balancing |
| 46 |
|
|
|
| 47 |
|
|
void mpiRefresh( void ); |
| 48 |
|
|
|
| 49 |
|
|
protected: |
| 50 |
|
|
SimInfo* entryPlug; |
| 51 |
|
|
mpiSimData* parallelData; |
| 52 |
|
|
int *MolToProcMap; |
| 53 |
|
|
int *MolComponentType; |
| 54 |
|
|
int *AtomToProcMap; |
| 55 |
|
|
int *AtomType; |
| 56 |
|
|
int *GroupToProcMap; |
| 57 |
|
|
vector<int> globalAtomIndex; |
| 58 |
|
|
vector<int> globalMolIndex; |
| 59 |
|
|
vector<int> globalGroupIndex; |
| 60 |
|
|
|
| 61 |
|
|
vector<int> globalToLocalMol; |
| 62 |
|
|
vector<int> globalToLocalAtom; |
| 63 |
|
|
vector<int> globalToLocalGroup; |
| 64 |
|
|
|
| 65 |
|
|
// private function to initialize the fortran side of the simulation |
| 66 |
|
|
setFortranMPI_TD setFsimParallel; |
| 67 |
|
|
|
| 68 |
|
|
// int *myIdents; // is needed by Cpp only. It tells the molecule which stamp it is. |
| 69 |
|
|
|
| 70 |
|
|
}; |
| 71 |
|
|
|
| 72 |
|
|
|
| 73 |
|
|
/** |
| 74 |
|
|
The following pointer is the global declaration of the mpiSim |
| 75 |
|
|
object created when the mpiSimulation creation routine is |
| 76 |
|
|
called. Every one who includes the header file will then have |
| 77 |
|
|
access to all of the routines in mpiSimulation class. |
| 78 |
|
|
*/ |
| 79 |
|
|
|
| 80 |
|
|
extern mpiSimulation* mpiSim; |
| 81 |
|
|
|
| 82 |
|
|
#endif |