source:
CIVL/examples/mpi/collective/bcast_bad.c@
2261cec
| Last change on this file since 2261cec was a7f50d5, checked in by , 11 years ago | |
|---|---|
|
|
| File size: 379 bytes | |
| Line | |
|---|---|
| 1 | #include<mpi.h> |
| 2 | |
| 3 | int main() |
| 4 | { |
| 5 | int argc; |
| 6 | char** argv; |
| 7 | int rank; |
| 8 | int procs; |
| 9 | int value; |
| 10 | |
| 11 | MPI_Init(&argc,&argv); |
| 12 | MPI_Comm_size(MPI_COMM_WORLD, &procs); |
| 13 | MPI_Comm_rank(MPI_COMM_WORLD, &rank); |
| 14 | |
| 15 | if (rank == 0) |
| 16 | value = 123; |
| 17 | |
| 18 | if (rank != 5) |
| 19 | MPI_Bcast(&value, 1, MPI_INT, 0, MPI_COMM_WORLD); |
| 20 | |
| 21 | MPI_Finalize(); |
| 22 | return 0; |
| 23 | } |
Note:
See TracBrowser
for help on using the repository browser.
