main
|
Last change
on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago |
|
Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.
git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c
|
-
Property mode
set to
100644
|
|
File size:
456 bytes
|
| Line | |
|---|
| 1 |
|
|---|
| 2 | $input int NPROCS;
|
|---|
| 3 | $proc __procs[NPROCS];
|
|---|
| 4 | _Bool __start = 0;
|
|---|
| 5 | $gcomm COMM_WORLD;
|
|---|
| 6 |
|
|---|
| 7 | void MPI_Process (int rank);
|
|---|
| 8 |
|
|---|
| 9 | void init() {
|
|---|
| 10 | for (int i=0; i<NPROCS; i++)
|
|---|
| 11 | __procs[i] = $spawn MPI_Process(i);
|
|---|
| 12 | }
|
|---|
| 13 |
|
|---|
| 14 | void finalize() {
|
|---|
| 15 | for (int i=0; i<NPROCS; i++) {
|
|---|
| 16 | $yield();
|
|---|
| 17 | $wait(__procs[i]);
|
|---|
| 18 | }
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | void main() {
|
|---|
| 22 | $atomic{
|
|---|
| 23 | init();
|
|---|
| 24 | COMM_WORLD = $gcomm_create($here, NPROCS);
|
|---|
| 25 | __start = 1;
|
|---|
| 26 | finalize();
|
|---|
| 27 | $gcomm_destroy(COMM_WORLD, NULL);
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.