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/ecosystem.cc
[mareframe] / trunk / gadget / ecosystem.cc Repository:
ViewVC logotype

Diff of /trunk/gadget/ecosystem.cc

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

revision 18, Thu Jan 21 15:52:55 2016 UTC revision 19, Wed May 25 16:36:33 2016 UTC
# Line 1  Line 1 
1  #include "ecosystem.h"  #include "ecosystem.h"
2  #include "runid.h"  #include "runid.h"
3  #include "global.h"  #include "global.h"
4    #include <ctime>
5  #ifdef _OPENMP  #ifdef _OPENMP
6  #include <omp.h>  #include <omp.h>
7  #endif  #endif
# Line 11  Line 12 
12  #endif  #endif
13  extern volatile int interrupted_print;  extern volatile int interrupted_print;
14    
15    time_t starttime, stoptime;
16    
17  Ecosystem::Ecosystem(const MainInfo& main) : printinfo(main.getPI()) {  Ecosystem::Ecosystem(const MainInfo& main) : printinfo(main.getPI()) {
18    
19    funceval = 0;    funceval = 0;
# Line 112  Line 115 
115  void Ecosystem::Optimise() {  void Ecosystem::Optimise() {
116    int i;    int i;
117    for (i = 0; i < optvec.Size(); i++) {    for (i = 0; i < optvec.Size(); i++) {
118              time(&starttime);
119  #ifdef _OPENMP  #ifdef _OPENMP
120            int j, numThr = omp_get_max_threads ( );            int j, numThr = omp_get_max_threads ( );
121            DoubleVector v = this->getValues();            DoubleVector v = this->getValues();
# Line 123  Line 127 
127  #else  #else
128            optvec[i]->OptimiseLikelihood();            optvec[i]->OptimiseLikelihood();
129  #endif  #endif
130              time(&stoptime);
131      this->writeOptValues();      this->writeOptValues();
132    }    }
133  }  }
# Line 183  Line 188 
188      handle.logMessage(LOGINFO, "\nThe overall likelihood score is", keeper->getBestLikelihoodScore());      handle.logMessage(LOGINFO, "\nThe overall likelihood score is", keeper->getBestLikelihoodScore());
189    else    else
190      handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood());      handle.logMessage(LOGINFO, "\nThe overall likelihood score is", this->getLikelihood());
191    
192      handle.logMessage(LOGINFO, "\n Runtime for the algorithm was ", difftime(stoptime, starttime)," seconds\n");
193  }  }
194    
195  void Ecosystem::writeInitialInformation(const char* const filename) {  void Ecosystem::writeInitialInformation(const char* const filename) {

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

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

Powered By FusionForge