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

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

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

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