6 |
#include "stochasticdata.h" |
#include "stochasticdata.h" |
7 |
#include "interrupthandler.h" |
#include "interrupthandler.h" |
8 |
#include "global.h" |
#include "global.h" |
9 |
#ifdef GADGET_OPENMP |
#ifndef NO_OPENMP |
10 |
#include <omp.h> |
#include <omp.h> |
11 |
#endif |
#endif |
12 |
|
|
13 |
Ecosystem* EcoSystem; |
Ecosystem* EcoSystem; |
|
//FIXME need? |
|
14 |
StochasticData* data = 0; |
StochasticData* data = 0; |
15 |
Ecosystem** EcoSystems; |
Ecosystem** EcoSystems; |
16 |
|
|
149 |
EcoSystem->writeStatus(main.getPrintInitialFile()); |
EcoSystem->writeStatus(main.getPrintInitialFile()); |
150 |
} |
} |
151 |
|
|
|
if (main.runOmp()) |
|
|
{ |
|
|
#ifdef GADGET_OPENMP |
|
|
int numThr = omp_get_max_threads ( ); |
|
|
//FIXME OJO! ml |
|
|
EcoSystems = new Ecosystem*[numThr]; |
|
|
int i; |
|
|
//EcoSystems[0] = EcoSystem; |
|
|
for (i=0; i<numThr; i++) |
|
|
{ |
|
|
EcoSystems[i] = new Ecosystem(main); |
|
|
EcoSystems[i]->Update(data); |
|
|
EcoSystems[i]->Initialise(); |
|
|
} |
|
|
EcoSystem->OptimiseOMP(); |
|
|
//////optimiseOMP main.runPrint() |
|
|
#endif |
|
|
|
|
|
} else { |
|
152 |
#ifndef NO_OPENMP |
#ifndef NO_OPENMP |
153 |
int numThr = omp_get_max_threads ( ); |
int numThr = omp_get_max_threads ( ); |
|
//FIXME OJO! ml |
|
154 |
EcoSystems = new Ecosystem*[numThr]; |
EcoSystems = new Ecosystem*[numThr]; |
155 |
int i; |
int i; |
|
//EcoSystems[0] = EcoSystem; |
|
156 |
for (i=0; i<numThr; i++) |
for (i=0; i<numThr; i++) |
157 |
{ |
{ |
158 |
EcoSystems[i] = new Ecosystem(main); |
EcoSystems[i] = new Ecosystem(main); |
161 |
} |
} |
162 |
#endif |
#endif |
163 |
EcoSystem->Optimise(); |
EcoSystem->Optimise(); |
|
} |
|
164 |
delete data; |
delete data; |
165 |
if (main.getForcePrint()) |
if (main.getForcePrint()) |
166 |
EcoSystem->Simulate(main.getForcePrint()); |
EcoSystem->Simulate(main.getForcePrint()); |