source: CIVL/examples/messagePassing/mp_root.cvh@ b7bd088

1.23 2.0 main test-branch
Last change on this file since b7bd088 was a82987f, checked in by Manchun Zheng <zmanchun@…>, 12 years ago

$wait is re-implemented as a system function now; examples are updated accordingly.

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

  • Property mode set to 100644
File size: 467 bytes
RevLine 
[0be7a7ea]1
2$input int NPROCS;
3$proc __procs[NPROCS];
4_Bool __start = 0;
5$comm MPI_COMM_WORLD;
[767f15e]6$comm REDUCE_COMM;
[0be7a7ea]7
8void MPI_Process (int rank);
9
10
11void init() {
12 for (int i=0; i<NPROCS; i++)
13 __procs[i] = $spawn MPI_Process(i);
14 MPI_COMM_WORLD = $comm_create(NPROCS, __procs);
[767f15e]15 REDUCE_COMM = $comm_create(NPROCS, __procs);
[0be7a7ea]16 __start=1;
17}
18
19void finalize() {
20 for (int i=0; i<NPROCS; i++)
[a82987f]21 $wait(__procs[i]);
[0be7a7ea]22}
23
24void main() {
[18cad8a]25 $atomic{
26 init();
27 finalize();
28 }
[0be7a7ea]29}
Note: See TracBrowser for help on using the repository browser.