source:
CIVL/examples/collective.cvl@
844ebd8
| Last change on this file since 844ebd8 was d96afbd, checked in by , 13 years ago | |
|---|---|
|
|
| File size: 265 bytes | |
| Line | |
|---|---|
| 1 | |
| 2 | \input int n; |
| 3 | |
| 4 | \proc procs[n]; |
| 5 | |
| 6 | void f(int pid) { |
| 7 | for (int i=0; i<n; i++) { |
| 8 | \assert \collective(procs, n) i==procs[(i+1)%n]@i ; |
| 9 | } |
| 10 | } |
| 11 | |
| 12 | void main() { |
| 13 | \assume n>0; |
| 14 | for (int i=0; i<n; i++) procs[i] = \spawn f(i); |
| 15 | for (int i=0; i<n; i++) \wait procs[i]; |
| 16 | } |
Note:
See TracBrowser
for help on using the repository browser.
