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

Diff of /trunk/gadget/interruptinterface.cc

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

revision 1, Mon Feb 10 17:09:07 2014 UTC revision 27, Mon May 8 11:58:23 2017 UTC
# Line 4  Line 4 
4  #include "gadget.h"  #include "gadget.h"
5    
6  extern Ecosystem* EcoSystem;  extern Ecosystem* EcoSystem;
7    extern volatile int interrupted;
8    #ifdef _OPENMP
9    extern Ecosystem** EcoSystems;
10    extern MainInfo _main;
11    #endif
12    
13  void InterruptInterface::printMenu() {  void InterruptInterface::printMenu() {
14    if (EcoSystem->getFuncEval() != 0)    if (EcoSystem->getFuncEval() != 0)
15      cout << "\nInterrupted after " << EcoSystem->getFuncEval() << " iterations ...";    {
16              int iters = EcoSystem->getFuncEval();
17              #ifdef _OPENMP
18              if (_main.runParallel()){
19                int numThr = omp_get_max_threads ( );
20                  for (int i = 0; i < numThr; i++)
21                      iters += EcoSystems[i]->getFuncEval();
22              }
23              #endif
24        cout << "\nInterrupted after a total of " << iters << " iterations ...";
25      }
26    cout << "\nInterrupted at year " << EcoSystem->getCurrentYear() << ", step "    cout << "\nInterrupted at year " << EcoSystem->getCurrentYear() << ", step "
27      << EcoSystem->getCurrentStep() << " (" << EcoSystem->getCurrentTime()      << EcoSystem->getCurrentStep() << " (" << EcoSystem->getCurrentTime()
28      << " of " << EcoSystem->numTotalSteps() << " timesteps)\n"      << " of " << EcoSystem->numTotalSteps() << " timesteps)\n"
# Line 19  Line 34 
34  }  }
35    
36  int InterruptInterface::menu() {  int InterruptInterface::menu() {
37      interrupted = 0;
38    char userinput[MaxStrLength];    char userinput[MaxStrLength];
39    char interruptfile[MaxStrLength];    char interruptfile[MaxStrLength];
40    strncpy(userinput, "", MaxStrLength);    strncpy(userinput, "", MaxStrLength);

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

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

Powered By FusionForge