source:
CIVL/mods/dev.civl.com/examples/contracts/contractsMPI/simpleMpiOffset.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 414 bytes | |
| Line | |
|---|---|
| 1 | #include<mpi.h> |
| 2 | #include<assert.h> |
| 3 | |
| 4 | |
| 5 | #define comm MPI_COMM_WORLD |
| 6 | |
| 7 | /*@ \mpi_collective(comm, P2P): |
| 8 | @ ensures \mpi_agree(\mpi_region(\mpi_offset(x, 1, MPI_DOUBLE) |
| 9 | @ , 1, MPI_DOUBLE)); |
| 10 | @*/ |
| 11 | int bcast(void * x) { |
| 12 | return 0; |
| 13 | } |
| 14 | |
| 15 | |
| 16 | /*@ |
| 17 | @ \mpi_collective(comm, P2P): |
| 18 | @ ensures \mpi_agree(\result); |
| 19 | @*/ |
| 20 | double target() { |
| 21 | double data[2]; |
| 22 | |
| 23 | bcast(data); |
| 24 | return data[1]; |
| 25 | } |
Note:
See TracBrowser
for help on using the repository browser.
