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 16, Tue Oct 13 11:29:01 2015 UTC revision 20, Fri Apr 7 09:20:55 2017 UTC
# Line 14  Line 14 
14  StochasticData* data = 0;  StochasticData* data = 0;
15  Ecosystem** EcoSystems;  Ecosystem** EcoSystems;
16    
17    volatile int interrupted = 0;
18    volatile int interrupted_print = 0;
19    
20    
21  int main(int aNumber, char* const aVector[]) {  int main(int aNumber, char* const aVector[]) {
22    
# Line 60  Line 63 
63  #ifdef INTERRUPT_HANDLER  #ifdef INTERRUPT_HANDLER
64    //JMB dont register interrupt if doing a network run    //JMB dont register interrupt if doing a network run
65    if (!(main.runNetwork()))    if (!(main.runNetwork()))
66      registerInterrupts(&EcoSystem->interrupted);      registerInterrupts(&interrupted);
67  #endif  #endif
68    
69    if (chdir(workingdir) != 0)    if (chdir(workingdir) != 0)
# Line 150  Line 153 
153                    }                    }
154    
155  #ifdef _OPENMP  #ifdef _OPENMP
156              if (main.runParallel()){
157            int numThr = omp_get_max_threads ( );            int numThr = omp_get_max_threads ( );
158                    handle.logMessage(LOGINFO, "Info - initialise ", numThr," EcoSystems ");
159            EcoSystems = new Ecosystem*[numThr];            EcoSystems = new Ecosystem*[numThr];
160            int i;            int i;
161    #pragma omp parallel for shared(EcoSystems,main,data,handle)
162            for (i=0; i<numThr; i++)            for (i=0; i<numThr; i++)
163            {            {
164                            handle.logMessage(LOGINFO, "Info - Ecosystem ", i);
165                            if (main.getInitialParamGiven()) {
166                    EcoSystems[i] = new Ecosystem(main);                    EcoSystems[i] = new Ecosystem(main);
167                    EcoSystems[i]->Update(data);                    EcoSystems[i]->Update(data);
168                                EcoSystems[i]->checkBounds();
169                            }
170                    EcoSystems[i]->Initialise();                    EcoSystems[i]->Initialise();
171            }            }
172                    }
173  #endif  #endif
174            EcoSystem->Optimise();            EcoSystem->Optimise();
175            delete data;            delete data;

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

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

Powered By FusionForge