--- trunk/gadget/keeper.cc 2014/02/10 17:09:07 1 +++ trunk/gadget/keeper.cc 2015/10/13 11:29:01 16 @@ -7,6 +7,10 @@ extern Ecosystem* EcoSystem; +#ifdef _OPENMP +extern Ecosystem** EcoSystems; +#endif + Keeper::Keeper() { stack = new StrStack(); boundsgiven = 0; @@ -285,7 +289,13 @@ handle.logMessage(LOGFAIL, "Error in keeper - cannot write to output file"); //JMB - print the number of function evaluations at the start of the line - outfile << EcoSystem->getFuncEval() << TAB; + int iters = EcoSystem->getFuncEval(); +#ifdef _OPENMP + int numThr = omp_get_max_threads ( ); + for (int i = 0; i < numThr; i++) + iters += EcoSystems[i]->getFuncEval(); +#endif + outfile << iters << TAB; int i, p, w; p = prec; @@ -412,7 +422,13 @@ RUNID.Print(paramfile); if (interrupt) { - paramfile << "; Gadget was interrupted after " << EcoSystem->getFuncEval() + int iters = EcoSystem->getFuncEval(); +#ifdef _OPENMP + int numThr = omp_get_max_threads ( ); + for (i = 0; i < numThr; i++) + iters += EcoSystems[i]->getFuncEval(); +#endif + paramfile << "; Gadget was interrupted after a total of " << iters << " function evaluations\n; the best likelihood value found so far is " << setprecision(p) << bestlikelihood << endl;