1.23
2.0
main
test-branch
| Line | |
|---|
| 1 |
|
|---|
| 2 | $input int NPROCS;
|
|---|
| 3 | $proc __procs[NPROCS];
|
|---|
| 4 | _Bool __start = 0;
|
|---|
| 5 | $comm MPI_COMM_WORLD;
|
|---|
| 6 |
|
|---|
| 7 | void MPI_Process (int rank);
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 | void 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 |
|
|---|
| 17 | void finalize() {
|
|---|
| 18 | for (int i=0; i<NPROCS; i++)
|
|---|
| 19 | $wait __procs[i];
|
|---|
| 20 | }
|
|---|
| 21 |
|
|---|
| 22 | void main() {
|
|---|
| 23 | $atomic{
|
|---|
| 24 | init();
|
|---|
| 25 | finalize();
|
|---|
| 26 | }
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.