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

SCM Repository

[diderot] Diff of /branches/vis12-cl/src/compiler/c-target/fragments/seq-run.in
ViewVC logotype

Diff of /branches/vis12-cl/src/compiler/c-target/fragments/seq-run.in

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

revision 3225, Thu Jul 23 11:25:15 2015 UTC revision 3226, Thu Jul 23 11:33:34 2015 UTC
# Line 1  Line 1 
1  //! Run the Diderot program (sequential version)  //! Run the Diderot program (sequential version)
2  //! \param wrld the world-state of the Diderot program  //! \param wrld the world-state of the Diderot program
3  //! \param maxNSteps the limit on the number of super steps; 0 means unlimited  //! \param maxNSteps the limit on the number of super steps; 0 means unlimited
4  //! \return the number of steps taken.  //! \return the number of steps taken, or -1 on error.
5  uint32_t @PREFIX@Run (@PREFIX@World_t *wrld, uint32_t maxNSteps)  uint32_t @PREFIX@Run (@PREFIX@World_t *wrld, uint32_t maxNSteps)
6  {  {
7      if (wrld->stage < POST_INITIALLY) {      if (wrld->stage < POST_INITIALLY) {
8          biffMsgAdd (wrld->errors, "attempt to run uninitialized program");          biffMsgAdd (wrld->errors, "attempt to run uninitialized program\n");
9          return 0;          return -1;
10      }      }
11  #ifdef DIDEROT_HAS_INITIALLY_METHOD  #ifdef DIDEROT_HAS_INITIALLY_METHOD
12      else if (wrld->stage == POST_INITIALLY) {      else if (wrld->stage == POST_INITIALLY) {
# Line 27  Line 27 
27      double t0 = airTime();      double t0 = airTime();
28    
29    // iterate until all strands are stable    // iterate until all strands are stable
30        if (wrld->verboseFlg) fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);
31      uint32_t nSteps = 0;      uint32_t nSteps = 0;
32      uint32_t nActive = wrld->numActive;      uint32_t nActive = wrld->numActive;
33      while ((nActive > 0) && (nSteps < maxNSteps)) {      while ((nActive > 0) && (nSteps < maxNSteps)) {

Legend:
Removed from v.3225  
changed lines
  Added in v.3226

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