ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/mdtools/headers/mpiSimulation.hpp
Revision: 253
Committed: Thu Jan 30 15:20:21 2003 UTC (21 years, 7 months ago) by chuckv
File size: 1780 byte(s)
Log Message:
Added a generic util code directory and moved Linux_ifc_machdep to it.
MPI changes to compile MPI modules.

File Contents

# User Rev Content
1 chuckv 131 #ifndef __MPISIMULATION__
2     #define __MPISIMULATION__
3 chuckv 121
4 chuckv 194 #include "SimInfo.hpp"
5 chuckv 195 #include "MakeStamps.hpp"
6 chuckv 215 #define __C
7     #include "mpiComponentPlan.h"
8 chuckv 194
9 chuckv 215
10 chuckv 121 class mpiSimulation{
11     public:
12    
13 chuckv 194 mpiSimulation(SimInfo* the_entryPlug);
14     ~mpiSimulation();
15    
16 chuckv 253 int *divideLabor( void );
17 chuckv 194
18 mmeineke 244 int getMyNode(void) { return mpiPlug->myNode; }
19     int getNumberProcessors(void) { return mpiPlug->numberProcessors; }
20     int getMyMolStart( void ) { return mpiPlug->myMolStart; }
21     int getMyMolEnd( void ) { return mpiPlug->myMolEnd; }
22     int getMyMol( void ) { return mpiPlug->myMol; }
23     int getMyAtomStart( void ) { return mpiPlug->myAtomStart; }
24     int getMyAtomEnd( void ) { return mpiPlug->myAtomEnd; }
25     int getMyNlocal( void ) { return mpiPlug->myNlocal; }
26     int getTotAtoms( void ) { return mpiPlug->nAtomsGlobal; }
27 chuckv 194
28 chuckv 121
29 mmeineke 244 // sets the internal function pointer to fortran.
30    
31     void setInternal( void (*fSetup)( mpiSimData*, int*, int*, int*) ){
32     setFsimParallel = fSetup;
33     }
34    
35 chuckv 121
36 chuckv 253 // call at the begining and after load balancing
37    
38     void mpiRefresh( void );
39    
40 chuckv 121 protected:
41 chuckv 194 SimInfo* entryPlug;
42 chuckv 215 mpiSimData* mpiPlug;
43 chuckv 121
44 mmeineke 244 // function to wrap the fortran function
45     void wrapMe();
46    
47     // private function to initialize the fortran side of the simulation
48     void (*setFsimParallel)(mpiSimData* the_mpiPlug, int *nLocal,
49     int* globalIndex, int* isError );
50    
51 chuckv 215 // int *myIdents; // is needed by Cpp only. It tells the molecule which stamp it is.
52 mmeineke 201
53 chuckv 121 };
54 chuckv 131
55 chuckv 223
56     /**
57     The following pointer is the global declaration of the mpiSim
58     object created when the mpiSimulation creation routine is
59     called. Every one who includes the header file will then have
60 chuckv 253 access to all of the routines in mpiSimulation class.
61 chuckv 223 */
62    
63 chuckv 215 extern mpiSimulation* mpiSim;
64 chuckv 131
65     #endif