source: CIVL/examples/mpi/simple/noninterference.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: 510 bytes
RevLine 
[a9a9973]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
5double x;
6
7void 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.