| 1 |
|
#include <cstdlib> |
| 2 |
|
#include <cstring> |
| 3 |
|
#include <mpi.h> |
| 4 |
+ |
#include <mpi++.h> |
| 5 |
|
|
| 6 |
|
#include "mpiSimulation.hpp" |
| 7 |
|
#include "simError.h" |
| 8 |
+ |
#include <fortranWrappers.hpp> |
| 9 |
|
|
| 8 |
– |
extern "C"{ |
| 9 |
– |
void wrapsimparallelmod_( void (*wrapFunction)(void (*fSub)( mpiSimData*, |
| 10 |
– |
int*, int*, |
| 11 |
– |
int*))); |
| 12 |
– |
} |
| 10 |
|
|
| 14 |
– |
void wrapSimParallel(void (*fSub)(mpiSimData*, int*, int*, int*)); |
| 11 |
|
|
| 12 |
|
|
| 13 |
|
mpiSimulation* mpiSim; |
| 21 |
|
mpiPlug->myNode = worldRank; |
| 22 |
|
|
| 23 |
|
mpiSim = this; |
| 24 |
< |
wrapMe(); |
| 29 |
< |
|
| 24 |
> |
wrapMeSimParallel( this ); |
| 25 |
|
} |
| 26 |
|
|
| 27 |
|
|
| 32 |
|
|
| 33 |
|
} |
| 34 |
|
|
| 40 |
– |
void mpiSimulation::wrapMe(){ |
| 35 |
|
|
| 42 |
– |
wrapsimparallelmod_( wrapSimParallel ); |
| 43 |
– |
} |
| 36 |
|
|
| 45 |
– |
|
| 46 |
– |
|
| 37 |
|
int* mpiSimulation::divideLabor( void ){ |
| 38 |
|
|
| 39 |
|
int* globalIndex; |
| 187 |
|
} |
| 188 |
|
|
| 189 |
|
|
| 200 |
– |
void wrapSimParallel(void (*fSub)(mpiSimData*, int*, int*, int*)){ |
| 201 |
– |
|
| 202 |
– |
mpiSim->setInternal( fSub ); |
| 203 |
– |
} |
| 204 |
– |
|
| 205 |
– |
|
| 190 |
|
void mpiSimulation::mpiRefresh( void ){ |
| 191 |
|
|
| 192 |
|
int isError, i; |