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

revision 2415, Mon Aug 19 12:53:28 2013 UTC revision 2416, Mon Aug 19 12:57:45 2013 UTC
# Line 7  Line 7 
7  #ifdef DIDEROT_DUAL_STATE  #ifdef DIDEROT_DUAL_STATE
8      Strand_t *strand = &(wrld->strandDesc[0]);      Strand_t *strand = &(wrld->strandDesc[0]);
9  #endif  #endif
10    
11            @CALL_BUILD_TREE_FN@
12    
13      @PREFIX@Globals_t *glob = wrld->globals;      @PREFIX@Globals_t *glob = wrld->globals;
14    
15      if (maxNSteps == 0) maxNSteps = 0xffffffff;  // essentially unlimited      if (maxNSteps == 0) maxNSteps = 0xffffffff;  // essentially unlimited
16    
17    // iterate until all strands are stable    // iterate until all strands are stable
18      if (wrld->verboseFlg) fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);      if (wrld->verboseFlg) fprintf(stderr, "run with %d strands ...\n", wrld->numStrands);
19      @GRID_INIT@  
20      @BUILD_GRID@      @CALL_BUILD_TREE_FN@
21      uint32_t nSteps = 0, nUpdates = 0;      uint32_t nSteps = 0, nUpdates = 0;
22      uint32_t nActive = wrld->numActive;      uint32_t nActive = wrld->numActive;
23      while ((nActive > 0) && (nSteps < maxNSteps)) {      while ((nActive > 0) && (nSteps < maxNSteps)) {
# Line 26  Line 29 
29                  StrandStatus_t sts = @STRAND@_Update(wrld, i);                  StrandStatus_t sts = @STRAND@_Update(wrld, i);
30  //                StrandStatus_t sts = @STRAND@_Update(glob, wrld->inState[i], wrld->outState[i],  //                StrandStatus_t sts = @STRAND@_Update(glob, wrld->inState[i], wrld->outState[i],
31  //                                                     &wrld->inState,&wrld->outState,  //                                                     &wrld->inState,&wrld->outState,
32  //                                                     &wrld->status, &wrld->poolInfo @PASS_GRID@);  //                                                     &wrld->status, &wrld->poolInfo);
33                  switch (sts) {                  switch (sts) {
34                    case DIDEROT_STABILIZE:                    case DIDEROT_STABILIZE:
35                      existsStabilizing = true;                      existsStabilizing = true;
# Line 65  Line 68 
68              wrld->numActive += wrld->poolInfo.nNewStrand;              wrld->numActive += wrld->poolInfo.nNewStrand;
69              wrld->numStrands += wrld->poolInfo.nNewStrand;              wrld->numStrands += wrld->poolInfo.nNewStrand;
70              wrld->poolInfo.nNewStrand = 0;              wrld->poolInfo.nNewStrand = 0;
71              #ifdef DIDEROT_DUAL_STATE                          @REALLOC_SPATIAL_COPY_ARRAY@
72                          wrld->gridCtx->numberOfStrands =  wrld->numStrands;  
                         #endif  
73          }          }
74  #ifdef DIDEROT_DUAL_STATE  #ifdef DIDEROT_DUAL_STATE
75        // swap in and out        // swap in and out
# Line 76  Line 78 
78          wrld->outState = tmp;          wrld->outState = tmp;
79  #endif  #endif
80        /** Run the Global Block Phase */        /** Run the Global Block Phase */
81          @GLOBAL_BLOCK@          @CALL_GLOBAL_BLOCK_FN@
82          @BUILD_GRID@                  @CALL_BUILD_TREE_FN@
83    
84      }      }
85      wrld->numActive = nActive;      wrld->numActive = nActive;

Legend:
Removed from v.2415  
changed lines
  Added in v.2416

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