4 |
#include "gadget.h" |
#include "gadget.h" |
5 |
|
|
6 |
extern Ecosystem* EcoSystem; |
extern Ecosystem* EcoSystem; |
7 |
|
extern volatile int interrupted; |
8 |
#ifdef _OPENMP |
#ifdef _OPENMP |
9 |
extern Ecosystem** EcoSystems; |
extern Ecosystem** EcoSystems; |
10 |
|
extern MainInfo _main; |
11 |
#endif |
#endif |
12 |
|
|
13 |
void InterruptInterface::printMenu() { |
void InterruptInterface::printMenu() { |
15 |
{ |
{ |
16 |
int iters = EcoSystem->getFuncEval(); |
int iters = EcoSystem->getFuncEval(); |
17 |
#ifdef _OPENMP |
#ifdef _OPENMP |
18 |
|
if (_main.runParallel()){ |
19 |
int numThr = omp_get_max_threads ( ); |
int numThr = omp_get_max_threads ( ); |
20 |
for (int i = 0; i < numThr; i++) |
for (int i = 0; i < numThr; i++) |
21 |
iters += EcoSystems[i]->getFuncEval(); |
iters += EcoSystems[i]->getFuncEval(); |
22 |
|
} |
23 |
#endif |
#endif |
24 |
cout << "\nInterrupted after a total of " << iters << " iterations ..."; |
cout << "\nInterrupted after a total of " << iters << " iterations ..."; |
25 |
} |
} |
34 |
} |
} |
35 |
|
|
36 |
int InterruptInterface::menu() { |
int InterruptInterface::menu() { |
37 |
|
interrupted = 0; |
38 |
char userinput[MaxStrLength]; |
char userinput[MaxStrLength]; |
39 |
char interruptfile[MaxStrLength]; |
char interruptfile[MaxStrLength]; |
40 |
strncpy(userinput, "", MaxStrLength); |
strncpy(userinput, "", MaxStrLength); |