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

SCM Repository

[diderot] View of /tests/new-tests/test-new+die.diderot
ViewVC logotype

View of /tests/new-tests/test-new+die.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4962 - (download) (annotate)
Thu Apr 20 15:02:04 2017 UTC (2 years, 2 months ago) by jhr
File size: 439 byte(s)
  testw for dynamic strands
#version 2.0

// test the "new" + "die" operations
//

input int MaxNumStrands = 8191; // should be 2^n - 1 for some n
int step = 0;

strand S (int i) {
    output int id = i;
    update {
	if (id < MaxNumStrands) {
	    new S (2*id+1);
	    new S (2*id+2);
	}
	if (id % (step+1) == 0) {
	    die;
	}
	else {
		stabilize;
	}
    }

}

update {
  step += 1;
  print ("global update ", step, "\n");
}

create_collection { S(0) | i in 1..1 }

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