source: CIVL/examples/messagePassing/mp_root.cvh@ 90dd7d7

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

make examples atomic

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

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