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 11, Thu Jul 23 19:00:38 2015 UTC revision 12, Fri Jul 24 18:36:24 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 GADGET_OPENMP  #ifndef NO_OPENMP
10  #include <omp.h>  #include <omp.h>
11  #endif  #endif
12    
13  Ecosystem* EcoSystem;  Ecosystem* EcoSystem;
 //FIXME need?  
14  StochasticData* data = 0;  StochasticData* data = 0;
15  Ecosystem** EcoSystems;  Ecosystem** EcoSystems;
16    
# Line 150  Line 149 
149                    EcoSystem->writeStatus(main.getPrintInitialFile());                    EcoSystem->writeStatus(main.getPrintInitialFile());
150                    }                    }
151    
           if (main.runOmp())  
           {  
 #ifdef GADGET_OPENMP  
                   int numThr = omp_get_max_threads ( );  
                   //FIXME OJO! ml  
                   EcoSystems = new Ecosystem*[numThr];  
                   int i;  
                   //EcoSystems[0] = EcoSystem;  
                   for (i=0; i<numThr; i++)  
                   {  
                           EcoSystems[i] = new Ecosystem(main);  
                           EcoSystems[i]->Update(data);  
                           EcoSystems[i]->Initialise();  
                   }  
                   EcoSystem->OptimiseOMP();  
                   //////optimiseOMP main.runPrint()  
 #endif  
   
           } else {  
152  #ifndef NO_OPENMP  #ifndef NO_OPENMP
153                    int numThr = omp_get_max_threads ( );                    int numThr = omp_get_max_threads ( );
                   //FIXME OJO! ml  
154                    EcoSystems = new Ecosystem*[numThr];                    EcoSystems = new Ecosystem*[numThr];
155                    int i;                    int i;
                   //EcoSystems[0] = EcoSystem;  
156                    for (i=0; i<numThr; i++)                    for (i=0; i<numThr; i++)
157                    {                    {
158                            EcoSystems[i] = new Ecosystem(main);                            EcoSystems[i] = new Ecosystem(main);
# Line 183  Line 161 
161                    }                    }
162  #endif  #endif
163                  EcoSystem->Optimise();                  EcoSystem->Optimise();
           }  
164            delete data;            delete data;
165            if (main.getForcePrint())            if (main.getForcePrint())
166                    EcoSystem->Simulate(main.getForcePrint());                    EcoSystem->Simulate(main.getForcePrint());

Legend:
Removed from v.11  
changed lines
  Added in v.12

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

Powered By FusionForge