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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/lib/main.c
ViewVC logotype

Diff of /branches/pure-cfg/src/lib/main.c

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

revision 572, Tue Mar 1 15:34:03 2011 UTC revision 589, Wed Mar 9 21:46:16 2011 UTC
# Line 27  Line 27 
27  printf("initializing strands ...\n");  printf("initializing strands ...\n");
28      void *strands1[NR*NC], *strands2[NR*NC];      void *strands1[NR*NC], *strands2[NR*NC];
29      bool active[NR*NC];      bool active[NR*NC];
30      for (int r = 0;  r <= 199;  r++) {      for (int r = 0;  r < NR;  r++) {
31          for (int c = 0;  c <= 199;  c++) {          for (int c = 0;  c < NC;  c++) {
32              int i = NC*r + c;              int i = NC*r + c;
33              strands1[i] = Diderot_AllocStrand(&(Diderot_Strands[0]));              strands1[i] = Diderot_AllocStrand(&(Diderot_Strands[0]));
34              strands2[i] = Diderot_AllocStrand(&(Diderot_Strands[0]));              strands2[i] = Diderot_AllocStrand(&(Diderot_Strands[0]));
35              active[i] = true;              active[i] = true;
36              Diderot_Strands[0].init(strands1[i], r, c);              Diderot_Strands[0].init(strands1[i], r, c);
37              // copy so that static fields are initialized
38                memcpy (strands2[i], strands1[i], Diderot_Strands[0].stateSzb);
39          }          }
40      }      }
41    
# Line 51  Line 53 
53                  nUpdates++;                  nUpdates++;
54                  StrandStatus_t sts = Diderot_Strands[0].update(in[i], out[i]);                  StrandStatus_t sts = Diderot_Strands[0].update(in[i], out[i]);
55                  if (sts == DIDEROT_STABILIZE) {                  if (sts == DIDEROT_STABILIZE) {
56                    // copy out to in so that final state is correct                    // copy out to in so that both copies are the stable state
57                      memcpy (in[i], out[i], Diderot_Strands[0].stateSzb);                      memcpy (in[i], out[i], Diderot_Strands[0].stateSzb);
58                      active[i] = false;                      active[i] = false;
59                      nActive--;                      nActive--;

Legend:
Removed from v.572  
changed lines
  Added in v.589

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