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

Diff of /trunk/gadget/gadget.cc

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

revision 1, Mon Feb 10 17:09:07 2014 UTC revision 16, Tue Oct 13 11:29:01 2015 UTC
# Line 6  Line 6 
6  #include "stochasticdata.h"  #include "stochasticdata.h"
7  #include "interrupthandler.h"  #include "interrupthandler.h"
8  #include "global.h"  #include "global.h"
9    #ifdef _OPENMP
10    #include <omp.h>
11    #endif
12    
13  Ecosystem* EcoSystem;  Ecosystem* EcoSystem;
14    StochasticData* data = 0;
15    Ecosystem** EcoSystems;
16    
17    
18  int main(int aNumber, char* const aVector[]) {  int main(int aNumber, char* const aVector[]) {
19    
20    MainInfo main;    MainInfo main;
21    StochasticData* data = 0;  
22    //  omp_set_num_threads(4);
23    
24    int check = 0;    int check = 0;
25    
26    //Initialise random number generator with system time [MNAA 02.02.26]    //Initialise random number generator with system time [MNAA 02.02.26]
# Line 133  Line 140 
140    
141        EcoSystem->Update(data);        EcoSystem->Update(data);
142        EcoSystem->checkBounds();        EcoSystem->checkBounds();
       delete data;  
143      } else      } else
144        handle.logMessage(LOGFAIL, "Error - no parameter input file specified");        handle.logMessage(LOGFAIL, "Error - no parameter input file specified");
145    
# Line 143  Line 149 
149        EcoSystem->writeStatus(main.getPrintInitialFile());        EcoSystem->writeStatus(main.getPrintInitialFile());
150      }      }
151    
152    #ifdef _OPENMP
153              int numThr = omp_get_max_threads ( );
154              EcoSystems = new Ecosystem*[numThr];
155              int i;
156              for (i=0; i<numThr; i++)
157              {
158                      EcoSystems[i] = new Ecosystem(main);
159                      EcoSystems[i]->Update(data);
160                      EcoSystems[i]->Initialise();
161              }
162    #endif
163      EcoSystem->Optimise();      EcoSystem->Optimise();
164              delete data;
165      if (main.getForcePrint())      if (main.getForcePrint())
166        EcoSystem->Simulate(main.getForcePrint());        EcoSystem->Simulate(main.getForcePrint());
167    }    }

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

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

Powered By FusionForge