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

SCM Repository

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

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

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

revision 1835, Fri Apr 13 18:01:02 2012 UTC revision 1836, Fri Apr 13 18:08:06 2012 UTC
# Line 130  Line 130 
130  {  {
131      Diderot_Sched_t *sched = wrld->sched;      Diderot_Sched_t *sched = wrld->sched;
132    
133        if (maxNSteps == 0) maxNSteps = 0xffffffff;  // essentially unlimited
134    
135    // Start worker threads    // Start worker threads
136      int nWorkers = sched->numWorkers;      int nWorkers = sched->numWorkers;
137      WorkerArg_t *args = NEWVEC(WorkerArg_t, nWorkers);      WorkerArg_t *args = NEWVEC(WorkerArg_t, nWorkers);
# Line 138  Line 140 
140      sched->numWorkers = nWorkers;      sched->numWorkers = nWorkers;
141      sched->numIdle = 0;      sched->numIdle = 0;
142      sched->numSteps = 0;      sched->numSteps = 0;
143        sched->numActive = wrld->numStrands;
144      for (int i = 0; i < nWorkers; i++) {      for (int i = 0; i < nWorkers; i++) {
145          pthread_t pid;          pthread_t pid;
146          args[i].wrld = wrld;          args[i].wrld = wrld;
147            args[i].maxNSteps = maxNSteps;
148          args[i].id = i;          args[i].id = i;
149          if (pthread_create (&pid, NULL, @PREFIX@Worker, (void *)&(args[i])) != 0) {          if (pthread_create (&pid, NULL, @PREFIX@Worker, (void *)&(args[i])) != 0) {
150              fprintf (stderr, "unable to create worker thread\n");              fprintf (stderr, "unable to create worker thread\n");

Legend:
Removed from v.1835  
changed lines
  Added in v.1836

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