source: CIVL/examples/messagePassing/mp_root.cvh@ 1258be5

1.23 2.0 main test-branch
Last change on this file since 1258be5 was 18cad8a, checked in by Stephen Siegel <siegel@…>, 12 years ago

Adding new version of MPI example ring2.cvl. It's starting to look very much like real MPI.

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

  • Property mode set to 100644
File size: 400 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 }
27}
Note: See TracBrowser for help on using the repository browser.