Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis15/src/compiler/target-cpu/fragments/seq-main.in
ViewVC logotype

Diff of /branches/vis15/src/compiler/target-cpu/fragments/seq-main.in

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

revision 3915, Fri May 27 21:32:46 2016 UTC revision 3916, Sat May 28 12:01:02 2016 UTC
# Line 6  Line 6 
6      uint32_t    stepLimit = 0;          //! limit on number of execution steps (0 means unlimited)      uint32_t    stepLimit = 0;          //! limit on number of execution steps (0 means unlimited)
7    
8    // create the world    // create the world
9      world *wrld = new (nothrow) world();      world *wrld = new (std::nothrow) world();
10      if (wrld == nullptr) {      if (wrld == nullptr) {
11          std::cerr << "unable to create world" << std::endl          std::cerr << "unable to create world" << std::endl;
12          exit (1);          exit (1);
13      }      }
14    
# Line 20  Line 20 
20    
21    // handle command-line options    // handle command-line options
22      {      {
23          diderot::options *opts = new diderot::options ();          diderot::options<@REALTY@,@INTTY@> *opts = new diderot::options<@REALTY@,@INTTY@> ();
24          options->addFlag ("v,verbose", "enable runtime-system messages", &(wrld->verboseFlg));          opts->addFlag ("v,verbose", "enable runtime-system messages", &(wrld->_verbose));
25          options->addFlag ("t,timing", "enable execution timing", &timingFlg);          opts->addFlag ("t,timing", "enable execution timing", &timingFlg);
26          options->add ("l,limit", "specify limit on number of super-steps (0 means unlimited)",          opts->add ("l,limit", "specify limit on number of super-steps (0 means unlimited)",
27              &stepLimit, true);              &stepLimit, true);
28  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
29        // register options for setting global inputs        // register options for setting global inputs
30          register_inputs (&inputs, opts);          register_inputs (&inputs, opts);
31  #endif  #endif
32          register_outputs (opts);          register_outputs (opts);
33          options->process (opts, argc, argv);          opts->process (argc, argv);
34          delete options ();          delete opts;
35      }      }
36    
37    // initialize scheduler stuff    // initialize scheduler stuff
38      if (wrld->_verboseFlg) {      if (wrld->_verbose) {
39          std::cerr << "initializing world ..." << std::endl;          std::cerr << "initializing world ..." << std::endl;
40      }      }
41      if (wrld->init()) {      if (wrld->init()) {
# Line 45  Line 45 
45    
46  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
47    // initialize the input globals    // initialize the input globals
48      if (InitInputs (wrld, &inputs)) {      if (init_inputs (wrld, &inputs)) {
49          std::cerr << "Error initializing inputs:\n" << biffMsgStrGet(wrld->_errors) << std::endl;          std::cerr << "Error initializing inputs:\n" << biffMsgStrGet(wrld->_errors) << std::endl;
50          exit(1);          exit(1);
51      }      }
52  #endif  #endif
53    
54    // run the generated global initialization code    // run the generated global initialization code
55      if (wrld->verboseFlg) {      if (wrld->_verbose) {
56          std::cerr << "initializing globals ...\n");          std::cerr << "initializing globals ...\n");
57      }      }
58      if (@PREFIX@Initially (wrld)) {      if (initially (wrld)) {
59          std::cerr << "Error in global initialization:\n%s\n"          std::cerr << "Error in global initialization:\n%s\n"
60              << biffMsgStrGet(wrld->_errors) << std::endl;              << biffMsgStrGet(wrld->_errors) << std::endl;
61          exit(1);          exit(1);
62      }      }
63    
64      if (wrld->verboseFlg) {      if (wrld->_verbose) {
65          std::cerr << "run with " << wrld->numStrands << " strands ..." << std::endl;          std::cerr << "run with " << wrld->numStrands << " strands ..." << std::endl;
66      }      }
67    
68      uint32_t nSteps = @PREFIX@Run (wrld, stepLimit);      uint32_t nSteps = @PREFIX@Run (wrld, stepLimit);
69    
70      if (wrld->errors->errNum > 0) {      if (wrld->_errors->errNum > 0) {
71          std::cerr << "Error during execution:\n%s\n" << biffMsgStrGet(wrld->errors));          std::cerr << "Error during execution:\n%s\n" << biffMsgStrGet(wrld->_errors));
72          exit(1);          exit(1);
73      }      }
74    
75      if (wrld->verboseFlg) {      if (wrld->_verbose) {
76          std::cerr << "done: " << nSteps << " steps, in " << wrld->_runTime << " seconds" << std::endl);          std::cerr << "done: " << nSteps << " steps, in " << wrld->_run_time << " seconds" << std::endl);
77      }      }
78      else if (timingFlg) {      else if (timingFlg) {
79          std::cout << "usr=" << world->_runTime << std::endl;          std::cout << "usr=" << world->_run_time << std::endl;
80      }      }
81    
82    // output the final strand states    // output the final strand states

Legend:
Removed from v.3915  
changed lines
  Added in v.3916

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0