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

Diff of /branches/vis12-cl/src/compiler/c-target/fragments/par-run-nobsp.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 73  Line 73 
73  //! Run the Diderot program (parallel version)  //! Run the Diderot program (parallel version)
74  //! \param wrld the world-state of the Diderot program  //! \param wrld the world-state of the Diderot program
75  //! \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
76  //! \return the number of steps taken.  //! \return the number of steps taken, or -1 on error.
77  uint32_t @PREFIX@Run (@PREFIX@World_t *wrld, uint32_t maxNSteps)  uint32_t @PREFIX@Run (@PREFIX@World_t *wrld, uint32_t maxNSteps)
78  {  {
79      if (wrld->stage < POST_INITIALLY) {      if (wrld->stage < POST_INITIALLY) {
80          biffMsgAdd (wrld->errors, "attempt to run uninitialized program");          biffMsgAdd (wrld->errors, "attempt to run uninitialized program\n");
81          return 0;          return -1;
82      }      }
83      wrld->stage = RUNNING;      wrld->stage = RUNNING;
84    
# Line 102  Line 102 
102          args[i].wrld = wrld;          args[i].wrld = wrld;
103          args[i].maxNSteps = maxNSteps;          args[i].maxNSteps = maxNSteps;
104          args[i].id = i;          args[i].id = i;
105          if (pthread_create (&pid, NULL, @PREFIX@Worker, (void *)&(args[i])) != 0) {          int sts = pthread_create (&pid, NULL, @PREFIX@Worker, (void *)&(args[i]));
106              fprintf (stderr, "unable to create worker thread\n");          if (sts != 0) {
107              return 0;              biffMsgAddf (wrld->errors, "unable to create worker thread; err = %d\n", sts);
108                return -1;
109          }          }
110          pthread_detach (pid);          pthread_detach (pid);
111      }      }

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