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 632, Thu Mar 17 00:32:17 2011 UTC revision 633, Thu Mar 17 02:47:08 2011 UTC
# Line 37  Line 37 
37      Diderot_World_t *wrld = Diderot_Initially ();      Diderot_World_t *wrld = Diderot_Initially ();
38    
39    // iterate until all strands are stable    // iterate until all strands are stable
40  printf("run ...\n");  printf("run with %d strands ...\n", wrld->numStrands);
41      int nSteps = 0, nUpdates = 0;      int nSteps = 0, nUpdates = 0;
42      int nActive = wrld->numStrands;      int nActive = wrld->numStrands;
43      while (nActive > 0) {      while (nActive > 0) {
# Line 50  Line 50 
50                  if (sts == DIDEROT_STABILIZE) {                  if (sts == DIDEROT_STABILIZE) {
51                    // copy out to in so that both copies are the stable state                    // copy out to in so that both copies are the stable state
52  // FIXME: there is a race condition here, since other strands might query this strand  // FIXME: there is a race condition here, since other strands might query this strand
53                      memcpy (wrld->outState[i], wrld->inState[i], Diderot_Strands[0]->stateSzb);                      memcpy (wrld->inState[i], wrld->outState[i], Diderot_Strands[0]->stateSzb);
54                      wrld->isActive[i] = false;                      wrld->isActive[i] = false;
55                      nActive--;                      nActive--;
56                  }                  }
# Line 112  Line 112 
112          wrld->size[i] = size[i];          wrld->size[i] = size[i];
113      }      }
114    
115    printf("AllocInitially: %d", size[0]);
116    for (int i = 1;  i < nDims;  i++) printf(" x %d", size[i]);
117    printf("\n");
118    
119    // allocate the strand state pointers    // allocate the strand state pointers
120      wrld->numStrands = numStrands;      wrld->numStrands = numStrands;
121      wrld->inState = (void **) malloc (numStrands * sizeof(void *));      wrld->inState = (void **) malloc (numStrands * sizeof(void *));

Legend:
Removed from v.632  
changed lines
  Added in v.633

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