main
test-branch
| Line | |
|---|
| 1 | /* Illustrates non-interference of collectives and point-to-point operations.
|
|---|
| 2 | * Program is erroneous since MPI_Recv cannot receive message from Bcast. */
|
|---|
| 3 | #include <mpi.h>
|
|---|
| 4 |
|
|---|
| 5 | double x;
|
|---|
| 6 |
|
|---|
| 7 | void main() {
|
|---|
| 8 | int argc;
|
|---|
| 9 | char **argv;
|
|---|
| 10 | int rank;
|
|---|
| 11 |
|
|---|
| 12 | x = 0;
|
|---|
| 13 | MPI_Init(&argc,&argv);
|
|---|
| 14 | MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
|---|
| 15 | if (rank==0) {
|
|---|
| 16 | MPI_Bcast(&x, 1, MPI_DOUBLE, 0, MPI_COMM_WORLD);
|
|---|
| 17 | } else {
|
|---|
| 18 | MPI_Recv(&x, 1, MPI_DOUBLE, 0, MPI_ANY_TAG, MPI_COMM_WORLD,
|
|---|
| 19 | MPI_STATUS_IGNORE);
|
|---|
| 20 | }
|
|---|
| 21 | MPI_Finalize();
|
|---|
| 22 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.