--- trunk/mdtools/headers/mpiSimulation.hpp 2002/12/10 21:41:23 201 +++ trunk/mdtools/headers/mpiSimulation.hpp 2003/01/30 15:20:21 253 @@ -3,48 +3,63 @@ #include "SimInfo.hpp" #include "MakeStamps.hpp" +#define __C +#include "mpiComponentPlan.h" + class mpiSimulation{ public: mpiSimulation(SimInfo* the_entryPlug); ~mpiSimulation(); - void divideLabor( void ); + int *divideLabor( void ); - int getMyNode(void) { return myNode; } - int getMyMolStart( void ) { return myMolStart; } - int getMyMolEnd( void ) { return myMlEnd; } - int getMyMol( void ) { return myMol; } - int getMyAtomStart( void ) { return myAtomStart; } - int getMyAtomEnd( void ) { return myAtomEnd; } - int getMyNlocal( void ) { return myNlocal; } + int getMyNode(void) { return mpiPlug->myNode; } + int getNumberProcessors(void) { return mpiPlug->numberProcessors; } + int getMyMolStart( void ) { return mpiPlug->myMolStart; } + int getMyMolEnd( void ) { return mpiPlug->myMolEnd; } + int getMyMol( void ) { return mpiPlug->myMol; } + int getMyAtomStart( void ) { return mpiPlug->myAtomStart; } + int getMyAtomEnd( void ) { return mpiPlug->myAtomEnd; } + int getMyNlocal( void ) { return mpiPlug->myNlocal; } + int getTotAtoms( void ) { return mpiPlug->nAtomsGlobal; } -private: + // sets the internal function pointer to fortran. + void setInternal( void (*fSetup)( mpiSimData*, int*, int*, int*) ){ + setFsimParallel = fSetup; + } + + + // call at the begining and after load balancing + + void mpiRefresh( void ); + protected: SimInfo* entryPlug; + mpiSimData* mpiPlug; + + // function to wrap the fortran function + void wrapMe(); - int myMolStart; - int myMolEnd; - int myAtomStart, myAtomEnd; - int myMol; - int myNlocal; - int *myIdents; - int numberProcessors; - int myNode; - // int processorNameLen; - // char* processorName; - int natomsRow,natomsCol; - int numberCols,numberRows; - int nmolsRow,nmolsCol,nmolsLocal; + // private function to initialize the fortran side of the simulation + void (*setFsimParallel)(mpiSimData* the_mpiPlug, int *nLocal, + int* globalIndex, int* isError ); + // int *myIdents; // is needed by Cpp only. It tells the molecule which stamp it is. - int simTotAtoms, simTotBonds, simTotBends, simTotTorsions; - int simTotSRI, simTotNmol; - }; +/** + The following pointer is the global declaration of the mpiSim + object created when the mpiSimulation creation routine is + called. Every one who includes the header file will then have + access to all of the routines in mpiSimulation class. +*/ + +extern mpiSimulation* mpiSim; + #endif