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

1.23 2.0 main test-branch
Last change on this file since cf2a996 was 767f15e, checked in by Ziqing Luo <ziqing@…>, 12 years ago

the latest diffusion_1d program

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

  • Property mode set to 100644
File size: 466 bytes
Line 
1
2$input int NPROCS;
3$proc __procs[NPROCS];
4_Bool __start = 0;
5$comm MPI_COMM_WORLD;
6$comm REDUCE_COMM;
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);
15 REDUCE_COMM = $comm_create(NPROCS, __procs);
16 __start=1;
17}
18
19void finalize() {
20 for (int i=0; i<NPROCS; i++)
21 $wait __procs[i];
22}
23
24void main() {
25 $atomic{
26 init();
27 finalize();
28 }
29}
Note: See TracBrowser for help on using the repository browser.