1.23
2.0
acw/focus-triggers
main
test-branch
| Line | |
|---|
| 1 | #include<assert.h>
|
|---|
| 2 | #include<mpi.h>
|
|---|
| 3 | #include<civl-mpi.cvh>
|
|---|
| 4 |
|
|---|
| 5 | $input int in;
|
|---|
| 6 | $assume(in > 0);
|
|---|
| 7 | MPI_Comm comm = MPI_COMM_WORLD;
|
|---|
| 8 |
|
|---|
| 9 | int gimmeOne(int x)
|
|---|
| 10 | $requires {$collective(comm) $mpi_isRecvBufEmpty(0)}
|
|---|
| 11 | $requires {$collective(MPI_COMM_WORLD) $true}
|
|---|
| 12 | $requires {x > 0}
|
|---|
| 13 | $ensures {$collective(MPI_COMM_WORLD) $mpi_isRecvBufEmpty(0)}
|
|---|
| 14 | $ensures {$collective(MPI_COMM_WORLD) $result == 1 + x}
|
|---|
| 15 | $ensures {x == in}
|
|---|
| 16 | {
|
|---|
| 17 | return 1 + x;
|
|---|
| 18 | }
|
|---|
| 19 |
|
|---|
| 20 | int main(int argc, char * argv[]) {
|
|---|
| 21 | int x;
|
|---|
| 22 |
|
|---|
| 23 | MPI_Init(&argc, &argv);
|
|---|
| 24 | x = gimmeOne(in);
|
|---|
| 25 | assert(x == 1 + in);
|
|---|
| 26 | MPI_Finalize();
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.