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/par-main.in
ViewVC logotype

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

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

revision 4796, Mon Oct 24 11:39:31 2016 UTC revision 4797, Mon Oct 24 16:59:27 2016 UTC
# Line 7  Line 7 
7      bool        timingFlg = false;      //! true if timing computation      bool        timingFlg = false;      //! true if timing computation
8      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)
9      std::string printFile = "-";        //! file to direct printed output into      std::string printFile = "-";        //! file to direct printed output into
10        uint32_t    reqNumWorkers;          //! requested number of worker threads
11  #ifdef DIDEROT_EXEC_SNAPSHOT  #ifdef DIDEROT_EXEC_SNAPSHOT
12      uint32_t    snapshotPeriod = 1;     //! supersteps per snapshot      uint32_t    snapshotPeriod = 1;     //! supersteps per snapshot
13  #endif  #endif
# Line 19  Line 20 
20          exit (1);          exit (1);
21      }      }
22    
23      // get CPU info
24        if (wrld->_sched->get_cpu_info (wrld)) {
25            std::cerr << "Error creating workers:\n" << wrld->get_errors() << std::endl;
26            exit (1);
27        }
28    
29  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
30    // initialize the default values for the inputs    // initialize the default values for the inputs
31      cmd_line_inputs inputs;      cmd_line_inputs inputs;
# Line 28  Line 35 
35    // handle command-line options    // handle command-line options
36      {      {
37          diderot::options<@REALTY@,@INTTY@> *opts = new diderot::options<@REALTY@,@INTTY@> ();          diderot::options<@REALTY@,@INTTY@> *opts = new diderot::options<@REALTY@,@INTTY@> ();
38          uint32_t np = wrld->_sched->_numWorkers;          reqNumWorkers = wrld->_sched->_numHWCores;
39          opts->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)",
40              &stepLimit, true);              &stepLimit, true);
41  #ifdef DIDEROT_EXEC_SNAPSHOT  #ifdef DIDEROT_EXEC_SNAPSHOT
# Line 39  Line 46 
46          opts->add ("print", "specify where to direct printed output", &printFile, true);          opts->add ("print", "specify where to direct printed output", &printFile, true);
47          opts->addFlag ("v,verbose", "enable runtime-system messages", &(wrld->_verbose));          opts->addFlag ("v,verbose", "enable runtime-system messages", &(wrld->_verbose));
48          opts->addFlag ("t,timing", "enable execution timing", &timingFlg);          opts->addFlag ("t,timing", "enable execution timing", &timingFlg);
49          opts->add ("n,nworkers", "specify number of worker threads", &np, true);          opts->add ("n,nworkers", "specify number of worker threads", &reqNumWorkers, true);
50  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
51        // register options for setting global inputs        // register options for setting global inputs
52          register_inputs (&inputs, opts);          register_inputs (&inputs, opts);
# Line 47  Line 54 
54          register_outputs (opts);          register_outputs (opts);
55          opts->process (argc, argv);          opts->process (argc, argv);
56          delete opts;          delete opts;
         wrld->_sched->_numWorkers = np;  
57      }      }
58    
59    // redirect printing (if necessary)    // redirect printing (if necessary)
# Line 64  Line 70 
70          std::cerr << "initializing world ..." << std::endl;          std::cerr << "initializing world ..." << std::endl;
71      }      }
72      if (wrld->init()) {      if (wrld->init()) {
73          std::cerr << "Error initializing world:\n" << biffMsgStrGet(wrld->_errors) << std::endl;          std::cerr << "Error initializing world:\n" << wrld->get_errors() << std::endl;
74            exit(1);
75        }
76        if (wrld->_sched->create_workers (wrld, reqNumWorkers)) {
77            std::cerr << "Error creating workers:\n" << wrld->get_errors() << std::endl;
78          exit(1);          exit(1);
79      }      }
80    
81  #ifndef DIDEROT_NO_INPUTS  #ifndef DIDEROT_NO_INPUTS
82    // initialize the input globals    // initialize the input globals
83      if (init_inputs (wrld, &inputs)) {      if (init_inputs (wrld, &inputs)) {
84          std::cerr << "Error initializing inputs:\n" << biffMsgStrGet(wrld->_errors) << std::endl;          std::cerr << "Error initializing inputs:\n" << wrld->get_errors() << std::endl;
85          exit(1);          exit(1);
86      }      }
87  #endif  #endif
# Line 82  Line 92 
92      }      }
93      if (wrld->create_strands()) {      if (wrld->create_strands()) {
94          std::cerr << "Error in global initialization:\n"          std::cerr << "Error in global initialization:\n"
95              << biffMsgStrGet(wrld->_errors) << std::endl;              << wrld->get_errors() << std::endl;
96          exit(1);          exit(1);
97      }      }
98    
# Line 132  Line 142 
142  #endif // DIDEROT_EXEC_SNAPSHOT  #endif // DIDEROT_EXEC_SNAPSHOT
143    
144      if (wrld->_errors->errNum > 0) {      if (wrld->_errors->errNum > 0) {
145          std::cerr << "Error during execution:\n" << biffMsgStrGet(wrld->_errors) << std::endl;          std::cerr << "Error during execution:\n" << wrld->get_errors() << std::endl;
146          exit(1);          exit(1);
147      }      }
148    

Legend:
Removed from v.4796  
changed lines
  Added in v.4797

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