--- trunk/mdtools/mpi_implementation/mpiSimulation.cpp 2002/12/19 21:59:51 215 +++ trunk/mdtools/mpi_implementation/mpiSimulation.cpp 2003/01/24 21:25:08 245 @@ -5,6 +5,15 @@ i#include #include "mpiSimulation.hpp" #include "simError.h" +extern "C"{ + void wrapsimparallelmod_( void (*wrapFunction)(void (*fSub)( mpiSimData*, + int*, int*, + int*))); +} + +void wrapSimParallel((void (*fSub)(mpiSimData*, int*, int*, int*))); + + mpiSimulation* mpiSim; mpiSimulation::mpiSimulation(SimInfo* the_entryPlug) @@ -15,6 +24,8 @@ mpiSimulation::mpiSimulation(SimInfo* the_entryPlug) mpiPlug->numberProcessors = MPI::COMM_WORLD.Get_size(); mpiPlug->myNode = worldRank; + mpiSim = this; + wrapMe(); } @@ -26,7 +37,13 @@ mpiSimulation::~mpiSimulation(){ } +void mpiSimulation::wrapMe(){ + wrapsimparallelmod_( wrapSimParallel ); +} + + + void mpiSimulation::divideLabor( void ){ int nComponents; @@ -167,3 +184,9 @@ void mpiSimulation::divideLabor( void ){ // lets create the identity array } + + +void wrapSimParallel((void (*fSub)(mpiSimData*, int*, int*, int*))){ + + mpiSim->setInternal( fSub ); +}