ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE/libmdtools/mpiSimulation.hpp
Revision: 1108
Committed: Wed Apr 14 15:37:41 2004 UTC (20 years, 2 months ago) by tim
File size: 2303 byte(s)
Log Message:
Change DumpWriter and InitFromFile

File Contents

# Content
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 void divideLabor();
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 getTotNmol( void ) { return mpiPlug->nMolGlobal; }
25 int* getAtomToProcMap( void ) { return AtomToProcMap; }
26 int* getMolToProcMap( void ) { return MolToProcMap; }
27 int* getMolComponentType(void) { return MolComponentType; }
28 vector<int> getGlobalAtomIndex(void) {return globalAtomIndex; }
29 vector<int> getGlobalMolIndex(void) {return globalMolIndex;}
30 int getGlobalToLocalMol(int globalIndex) {return globalToLocalMol[globalIndex];}
31 int getGlobalToLocalAtom(int globalIndex) {return globalToLocalAtom[globalIndex];}
32
33
34 //void globalToLocalMol(int globalIndex, int& whichNode, int& localIndex);
35 //void globalToLocalAtom(int globalIndex, int& whichNode, int& localIndex);
36
37 // sets the internal function pointer to fortran.
38
39 void setInternal( setFortranMPI_TD fSetup){
40 setFsimParallel = fSetup;
41 }
42
43
44 // call at the begining and after load balancing
45
46 void mpiRefresh( void );
47
48 protected:
49 SimInfo* entryPlug;
50 mpiSimData* mpiPlug;
51 int *MolToProcMap;
52 int *MolComponentType;
53 int *AtomToProcMap;
54 int *AtomType;
55 vector<int> globalAtomIndex;
56 vector<int> globalMolIndex;
57
58 vector<int> globalToLocalMol;
59 vector<int> globalToLocalAtom;
60 // private function to initialize the fortran side of the simulation
61 setFortranMPI_TD setFsimParallel;
62
63 // int *myIdents; // is needed by Cpp only. It tells the molecule which stamp it is.
64
65 };
66
67
68 /**
69 The following pointer is the global declaration of the mpiSim
70 object created when the mpiSimulation creation routine is
71 called. Every one who includes the header file will then have
72 access to all of the routines in mpiSimulation class.
73 */
74
75 extern mpiSimulation* mpiSim;
76
77 #endif