source:
CIVL/examples/collective.cvl@
9ae277d
| Last change on this file since 9ae277d was 34760dc, checked in by , 14 years ago | |
|---|---|
|
|
| File size: 264 bytes | |
| Line | |
|---|---|
| 1 | |
| 2 | _input int n; |
| 3 | |
| 4 | _proc procs[n]; |
| 5 | |
| 6 | |
| 7 | void f(int pid) { |
| 8 | for (int i=0; i<n; i++) { |
| 9 | _assert \collective(procs) i==procs[(i+1)%n]@i ; |
| 10 | } |
| 11 | } |
| 12 | |
| 13 | void main() { |
| 14 | _assume n>0; |
| 15 | for (int i=0; i<n; i++) procs[i] = _spawn f(i); |
| 16 | for (int i=0; i<n; i++) _wait procs[i]; |
| 17 | } |
| 18 |
Note:
See TracBrowser
for help on using the repository browser.
