Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Diff of /trunk/gadget/keeper.cc
[mareframe] / trunk / gadget / keeper.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/keeper.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1, Mon Feb 10 17:09:07 2014 UTC revision 19, Wed May 25 16:36:33 2016 UTC
# Line 7  Line 7 
7    
8  extern Ecosystem* EcoSystem;  extern Ecosystem* EcoSystem;
9    
10    #ifdef _OPENMP
11    extern Ecosystem** EcoSystems;
12    #endif
13    
14  Keeper::Keeper() {  Keeper::Keeper() {
15    stack = new StrStack();    stack = new StrStack();
16    boundsgiven = 0;    boundsgiven = 0;
# Line 285  Line 289 
289      handle.logMessage(LOGFAIL, "Error in keeper - cannot write to output file");      handle.logMessage(LOGFAIL, "Error in keeper - cannot write to output file");
290    
291    //JMB - print the number of function evaluations at the start of the line    //JMB - print the number of function evaluations at the start of the line
292    outfile << EcoSystem->getFuncEval() << TAB;    int iters = EcoSystem->getFuncEval();
293    #ifdef _OPENMP
294      if(EcoSystems != NULL) {
295        int numThr = omp_get_max_threads ( );
296        for (int i = 0; i < numThr; i++)
297          iters += EcoSystems[i]->getFuncEval();
298      }
299    #endif
300      outfile << iters << TAB;
301    
302    int i, p, w;    int i, p, w;
303    p = prec;    p = prec;
# Line 412  Line 424 
424    RUNID.Print(paramfile);    RUNID.Print(paramfile);
425    
426    if (interrupt) {    if (interrupt) {
427      paramfile << "; Gadget was interrupted after " << EcoSystem->getFuncEval()          int iters = EcoSystem->getFuncEval();
428    #ifdef _OPENMP
429            int numThr = omp_get_max_threads ( );
430        for (i = 0; i < numThr; i++)
431              iters += EcoSystems[i]->getFuncEval();
432    #endif
433        paramfile << "; Gadget was interrupted after a total of " << iters
434        << " function evaluations\n; the best likelihood value found so far is "        << " function evaluations\n; the best likelihood value found so far is "
435        << setprecision(p) << bestlikelihood << endl;        << setprecision(p) << bestlikelihood << endl;
   
436    } else if (EcoSystem->getFuncEval() == 0) {    } else if (EcoSystem->getFuncEval() == 0) {
437      paramfile << "; a simulation run was performed giving a likelihood value of "      paramfile << "; a simulation run was performed giving a likelihood value of "
438        << setprecision(p) << EcoSystem->getLikelihood() << endl;        << setprecision(p) << EcoSystem->getLikelihood() << endl;

Legend:
Removed from v.1  
changed lines
  Added in v.19

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge