1.23
2.0
main
test-branch
| Line | |
|---|
| 1 | #define MPI_ANY_SOURCE $COMM_ANY_SOURCE
|
|---|
| 2 | #define MPI_ANY_TAG $COMM_ANY_TAG
|
|---|
| 3 | typedef $comm *MPI_Comm;
|
|---|
| 4 | $input int NPROCS;
|
|---|
| 5 | $proc __procs[NPROCS];
|
|---|
| 6 | _Bool __start = 0;
|
|---|
| 7 | $comm __MPI_Comm_World;
|
|---|
| 8 | MPI_Comm MPI_COMM_WORLD = &__MPI_Comm_World;
|
|---|
| 9 |
|
|---|
| 10 | typedef int MPI_Datatype;
|
|---|
| 11 |
|
|---|
| 12 | #define MPI_INT 1
|
|---|
| 13 | #define MPI_DOUBLE 2
|
|---|
| 14 | #define MPI_FLOAT 3
|
|---|
| 15 | #define MPI_CHAR 4
|
|---|
| 16 |
|
|---|
| 17 | struct __MPI_Status {
|
|---|
| 18 | int source;
|
|---|
| 19 | int tag;
|
|---|
| 20 | int size;
|
|---|
| 21 | };
|
|---|
| 22 |
|
|---|
| 23 | typedef struct __MPI_Status MPI_Status;
|
|---|
| 24 |
|
|---|
| 25 | void MPI_Process (int rank);
|
|---|
| 26 |
|
|---|
| 27 | void init() {
|
|---|
| 28 | for (int i=0; i<NPROCS; i++)
|
|---|
| 29 | __procs[i] = $spawn MPI_Process(i);
|
|---|
| 30 | __MPI_Comm_World = $comm_create(NPROCS, __procs);
|
|---|
| 31 | __start=1;
|
|---|
| 32 | }
|
|---|
| 33 |
|
|---|
| 34 | void finalize() {
|
|---|
| 35 | for (int i=0; i<NPROCS; i++)
|
|---|
| 36 | $wait __procs[i];
|
|---|
| 37 | }
|
|---|
| 38 |
|
|---|
| 39 | void main() {
|
|---|
| 40 | $atomic{
|
|---|
| 41 | init();
|
|---|
| 42 | finalize();
|
|---|
| 43 | }
|
|---|
| 44 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.