source: CIVL/examples/mpi/simple/ooobcast.c

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 549 bytes
Line 
1/* Out of order broadcasts. Error should be detected
2 * with -deadlock=potential.
3 */
4#include<mpi.h>
5
6int nprocs;
7int myrank;
8
9void 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.