source:
CIVL/mods/dev.civl.com/examples/mpi/simple/unreceived.c@
cb4d4f4
| Last change on this file since cb4d4f4 was aad342c, checked in by , 3 years ago | |
|---|---|
|
|
| File size: 398 bytes | |
| Line | |
|---|---|
| 1 | /* erroneous program: a send is never received. Will be detected |
| 2 | * with -deadlock=potential */ |
| 3 | #include<mpi.h> |
| 4 | |
| 5 | int nprocs; |
| 6 | int myrank; |
| 7 | #define NULL ((void*)0) |
| 8 | void main() { |
| 9 | double x = 0; |
| 10 | MPI_Status status; |
| 11 | |
| 12 | MPI_Init(NULL, NULL); |
| 13 | MPI_Comm_rank(MPI_COMM_WORLD, &myrank); |
| 14 | if (myrank == 0) { |
| 15 | MPI_Send(&x, 1, MPI_DOUBLE, 0, 1, MPI_COMM_WORLD); |
| 16 | } |
| 17 | MPI_Finalize(); |
| 18 | } |
Note:
See TracBrowser
for help on using the repository browser.
