| 1 | 
gezelter | 
1490 | 
#ifndef __MPISIMULATION__ | 
| 2 | 
  | 
  | 
#define __MPISIMULATION__ | 
| 3 | 
  | 
  | 
 | 
| 4 | 
tim | 
1492 | 
#include "brains/SimInfo.hpp" | 
| 5 | 
  | 
  | 
#include "types/MakeStamps.hpp" | 
| 6 | 
gezelter | 
1490 | 
#define __C | 
| 7 | 
tim | 
1492 | 
#include "UseTheForce/mpiComponentPlan.h" | 
| 8 | 
gezelter | 
1490 | 
 | 
| 9 | 
chuckv | 
1619 | 
#include "UseTheForce/DarkSide/simParallel_interface.h" | 
| 10 | 
gezelter | 
1490 | 
 | 
| 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 | 
  | 
  | 
  // call at the begining and after load balancing | 
| 39 | 
  | 
  | 
   | 
| 40 | 
  | 
  | 
  void mpiRefresh( void ); | 
| 41 | 
  | 
  | 
 | 
| 42 | 
  | 
  | 
protected: | 
| 43 | 
  | 
  | 
  SimInfo* entryPlug; | 
| 44 | 
  | 
  | 
  mpiSimData* parallelData; | 
| 45 | 
  | 
  | 
  int *MolToProcMap; | 
| 46 | 
  | 
  | 
  int *MolComponentType; | 
| 47 | 
  | 
  | 
  int *AtomToProcMap; | 
| 48 | 
  | 
  | 
  int *AtomType; | 
| 49 | 
  | 
  | 
  int *GroupToProcMap; | 
| 50 | 
  | 
  | 
  vector<int> globalAtomIndex; | 
| 51 | 
  | 
  | 
  vector<int> globalMolIndex; | 
| 52 | 
  | 
  | 
  vector<int> globalGroupIndex; | 
| 53 | 
  | 
  | 
 | 
| 54 | 
  | 
  | 
  vector<int> globalToLocalMol; | 
| 55 | 
  | 
  | 
  vector<int> globalToLocalAtom; | 
| 56 | 
  | 
  | 
  vector<int> globalToLocalGroup; | 
| 57 | 
  | 
  | 
 | 
| 58 | 
  | 
  | 
  // int *myIdents; // is needed by Cpp only. It tells the molecule which stamp it is. | 
| 59 | 
  | 
  | 
 | 
| 60 | 
  | 
  | 
}; | 
| 61 | 
  | 
  | 
 | 
| 62 | 
  | 
  | 
/** | 
| 63 | 
  | 
  | 
   The following pointer is the global declaration of the mpiSim | 
| 64 | 
  | 
  | 
   object created when the mpiSimulation creation routine is | 
| 65 | 
  | 
  | 
   called. Every one who includes the header file will then have | 
| 66 | 
  | 
  | 
   access to all of the routines in mpiSimulation class.  | 
| 67 | 
  | 
  | 
*/  | 
| 68 | 
  | 
  | 
 | 
| 69 | 
  | 
  | 
extern mpiSimulation* mpiSim; | 
| 70 | 
  | 
  | 
 | 
| 71 | 
  | 
  | 
#endif |