source: CIVL/examples/library/collate/completeCollateState.cvl@ beab7f2

main test-branch
Last change on this file since beab7f2 was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 565 bytes
Line 
1#include <collate.cvh>
2#include <stdlib.h>
3#include <stdio.h>
4
5$scope root = $here;
6$gcollator gcollator;
7
8void process(int place) {
9 $scope here = $here;
10 $collator collator = $collator_create(gcollator, here, place);
11 $collate_state cs;
12
13 cs = $collate_arrives(collator, here);
14 if($collate_complete(cs)) printf("place = %d, complete!\n", place);
15 $collate_departs(collator, cs);
16 free(collator);
17}
18
19int main() {
20 gcollator = $gcollator_create(root, 5);
21 $parfor (int i : 0 .. 4) {
22 process(i);
23}
24 $gcollator_destroy(gcollator);
25 return 0;
26}
Note: See TracBrowser for help on using the repository browser.