main
test-branch
| Rev | Line | |
|---|
| [a9a9973] | 1 | /* Out of order broadcasts. Error should be detected
|
|---|
| 2 | * with -deadlock=potential.
|
|---|
| 3 | */
|
|---|
| 4 | #include<mpi.h>
|
|---|
| 5 |
|
|---|
| 6 | int nprocs;
|
|---|
| 7 | int myrank;
|
|---|
| 8 |
|
|---|
| 9 | void main() {
|
|---|
| 10 | int argc;
|
|---|
| 11 | char **argv;
|
|---|
| 12 | double x;
|
|---|
| 13 | double y;
|
|---|
| 14 |
|
|---|
| 15 | x=0;
|
|---|
| 16 | y=1;
|
|---|
| 17 | MPI_Init(&argc, &argv);
|
|---|
| 18 | MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
|
|---|
| 19 | if (myrank == 0) {
|
|---|
| 20 | MPI_Bcast(&x, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
|
|---|
| 21 | MPI_Bcast(&y, 1, MPI_DOUBLE, 1, MPI_COMM_WORLD);
|
|---|
| 22 | } else {
|
|---|
| 23 | MPI_Bcast(&x, 1, MPI_DOUBLE, 1, MPI_COMM_WORLD);
|
|---|
| 24 | MPI_Bcast(&y, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
|
|---|
| 25 | }
|
|---|
| 26 | MPI_Finalize();
|
|---|
| 27 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.