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 17, Mon Nov 9 10:22:57 2015 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    #endif
11    
12  void InterruptInterface::printMenu() {  void InterruptInterface::printMenu() {
13    if (EcoSystem->getFuncEval() != 0)    if (EcoSystem->getFuncEval() != 0)
14      cout << "\nInterrupted after " << EcoSystem->getFuncEval() << " iterations ...";    {
15              int iters = EcoSystem->getFuncEval();
16              #ifdef _OPENMP
17                int numThr = omp_get_max_threads ( );
18                  for (int i = 0; i < numThr; i++)
19                      iters += EcoSystems[i]->getFuncEval();
20              #endif
21        cout << "\nInterrupted after a total of " << iters << " iterations ...";
22      }
23    cout << "\nInterrupted at year " << EcoSystem->getCurrentYear() << ", step "    cout << "\nInterrupted at year " << EcoSystem->getCurrentYear() << ", step "
24      << EcoSystem->getCurrentStep() << " (" << EcoSystem->getCurrentTime()      << EcoSystem->getCurrentStep() << " (" << EcoSystem->getCurrentTime()
25      << " of " << EcoSystem->numTotalSteps() << " timesteps)\n"      << " of " << EcoSystem->numTotalSteps() << " timesteps)\n"
# Line 19  Line 31 
31  }  }
32    
33  int InterruptInterface::menu() {  int InterruptInterface::menu() {
34      interrupted = 0;
35    char userinput[MaxStrLength];    char userinput[MaxStrLength];
36    char interruptfile[MaxStrLength];    char interruptfile[MaxStrLength];
37    strncpy(userinput, "", MaxStrLength);    strncpy(userinput, "", MaxStrLength);

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

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

Powered By FusionForge