X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/f186fd6470cd6853b97c53782c710745c628e810..28335d43a1e64d3a412e8d6b86e59a389852b0d1:/teshsuite/smpi/isp/umpire/probe-any_src-types-can-mismatch.c diff --git a/teshsuite/smpi/isp/umpire/probe-any_src-types-can-mismatch.c b/teshsuite/smpi/isp/umpire/probe-any_src-types-can-mismatch.c deleted file mode 100644 index 3186ae87bf..0000000000 --- a/teshsuite/smpi/isp/umpire/probe-any_src-types-can-mismatch.c +++ /dev/null @@ -1,79 +0,0 @@ -/* -*- Mode: C; -*- */ -/* Creator: Bronis R. de Supinski (bronis@llnl.gov) Wed Oct 30 2002 */ -/* probe-any_src-types-can-mismatch.c -- do nondeterministic recv after */ -/* Probe; types can mismatch as a result but may not; require that we */ -/* detect the mismatch if occurs; OK to detect (or not) if it doesn't... */ -/* adapted from MPI The Complete Reference, p. 78... */ - - -#include -#include "mpi.h" - - -int -main (int argc, char **argv) -{ - int nprocs = -1; - int rank = -1; - char processor_name[128]; - int namelen = 128; - int i, j; - double x; - MPI_Status status; - - /* init */ - MPI_Init (&argc, &argv); - MPI_Comm_size (MPI_COMM_WORLD, &nprocs); - MPI_Comm_rank (MPI_COMM_WORLD, &rank); - MPI_Get_processor_name (processor_name, &namelen); - printf ("(%d) is alive on %s\n", rank, processor_name); - fflush (stdout); - - MPI_Barrier (MPI_COMM_WORLD); - - /* because the probe and the receives both use */ - /* MPI_ANY_SOURCE, we are not guaranteed that the */ - /* first recv matches the probed msg, thus types can mismatch... */ - if (nprocs < 3) - { - printf ("not enough tasks\n"); - } - else if (rank == 0) - { - i = 0; - - MPI_Send (&i, 1, MPI_INT, 2, 0, MPI_COMM_WORLD); - } - else if (rank == 1) - { - x = 1.0; - - MPI_Send (&x, 1, MPI_DOUBLE, 2, 0, MPI_COMM_WORLD); - } - else if (rank == 2) - { - for (j = 0; j < 2; j++) { - MPI_Probe (MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &status); - - if (status.MPI_SOURCE == 0) { - MPI_Recv (&i, 1, MPI_INT, - MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &status); - if (status.MPI_SOURCE != 0) - printf ("(%d) Type mismatch from matching other message\n", rank); - } - else { - MPI_Recv (&x, 1, MPI_DOUBLE, - MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &status); - if (status.MPI_SOURCE == 0) - printf ("(%d) Type mismatch from matching other message\n", rank); - } - } - } - - MPI_Barrier (MPI_COMM_WORLD); - - MPI_Finalize (); - printf ("(%d) Finished normally\n", rank); -} - -/* EOF */