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 1830, Fri Apr 13 13:33:27 2012 UTC revision 1831, Fri Apr 13 13:33:40 2012 UTC
# Line 15  Line 15 
15      else      else
16          limit = start + nStrandsPerWorker;          limit = start + nStrandsPerWorker;
17    
18      while ((sched->numActive) && (sched->numSteps <= myArg->maxNSteps)) {      while (true) {
19        // barrier synchronization at start of super step        // barrier synchronization at start of super step
20          pthread_mutex_lock (&sched->lock);          pthread_mutex_lock (&sched->lock);
21              if (sched->numIdle+1 < sched->numWorkers) {              if (sched->numIdle+1 < sched->numWorkers) {
# Line 35  Line 35 
35              }              }
36          pthread_mutex_unlock (&sched->lock);          pthread_mutex_unlock (&sched->lock);
37    
38        // if there are no active strands left, then we're done        // if there are no active strands left or we've hit the maximum number of steps, then we're done
39          if (sched->numActive == 0) {          if ((sched->numActive == 0) || (sched->numSteps >= myArg->maxNSteps)) {
40              pthread_cond_signal (&sched->runWait);              pthread_cond_signal (&sched->runWait);
41              pthread_exit (0);              pthread_exit (0);
42          }          }

Legend:
Removed from v.1830  
changed lines
  Added in v.1831

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