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

SCM Repository

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

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

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

branches/vis12/src/compiler/c-target/fragments/run.in revision 1826, Thu Apr 12 14:04:38 2012 UTC branches/lamont/src/compiler/c-target/fragments/seq-run.in revision 2269, Thu Mar 7 13:56:24 2013 UTC
# Line 11  Line 11 
11    
12    // iterate until all strands are stable    // iterate until all strands are stable
13      if (wrld->verboseFlg) fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);      if (wrld->verboseFlg) fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);
14        @GRID_INIT@
15        @BUILD_GRID@
16      uint32_t nSteps = 0, nUpdates = 0;      uint32_t nSteps = 0, nUpdates = 0;
17      uint32_t nActive = wrld->numStrands;      uint32_t nActive = wrld->numActive;
18      while ((nActive > 0) && (nSteps <= maxNSteps)) {  
19        while ((nActive > 0) && (nSteps < maxNSteps)) {
20          nSteps++;          nSteps++;
21        // update strands        // update strands
22          bool existsStabilizing = false;          bool existsStabilizing = false;
# Line 21  Line 24 
24              if (! wrld->status[i]) {              if (! wrld->status[i]) {
25                  nUpdates++;                  nUpdates++;
26  //              StrandStatus_t sts = strand->update(glob, wrld->inState[i], wrld->outState[i]);  //              StrandStatus_t sts = strand->update(glob, wrld->inState[i], wrld->outState[i]);
27                  StrandStatus_t sts = @STRAND@_Update(glob, wrld->inState[i], wrld->outState[i]);                  StrandStatus_t sts = @STRAND@_Update(glob, wrld->inState[i], wrld->outState[i],
28                                                         &wrld->inState,&wrld->outState,
29                                                         &wrld->status, &wrld->poolInfo @PASS_GRID@);
30                  switch (sts) {                  switch (sts) {
31                    case DIDEROT_STABILIZE:                    case DIDEROT_STABILIZE:
32                      existsStabilizing = true;                      existsStabilizing = true;
# Line 36  Line 41 
41                  }                  }
42              }              }
43          }          }
44    
45            @BUILD_GRID@
46          if (existsStabilizing) {          if (existsStabilizing) {
47              for (int i = 0;  i < wrld->numStrands;  i++) {              for (int i = 0;  i < wrld->numStrands;  i++) {
48  // NOTE: we may want to compact the array of strands  // NOTE: we may want to compact the array of strands
# Line 55  Line 62 
62          @STRANDTY@ **tmp = wrld->inState;          @STRANDTY@ **tmp = wrld->inState;
63          wrld->inState = wrld->outState;          wrld->inState = wrld->outState;
64          wrld->outState = tmp;          wrld->outState = tmp;
65          /** Run the Global Block Phase */
66          @GLOBAL_BLOCK@
67          @GLOBAL_REDUCE@
68    
69    
70            //Increase the number of active strands if new strands were created
71            if(wrld->poolInfo.nNewStrand > 0) {
72                nActive += wrld->poolInfo.nNewStrand;
73                wrld->numActive += wrld->poolInfo.nNewStrand;
74                wrld->numStrands += wrld->poolInfo.nNewStrand;
75                wrld->poolInfo.nNewStrand = 0;
76    
77            }
78    
79    
80      }      }
81        wrld->numActive = nActive;
82    
83      return nSteps;      return nSteps;
84    

Legend:
Removed from v.1826  
changed lines
  Added in v.2269

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