[mpich] MPICH primary repository branch, master, updated. v3.1.2-68-gb95c5fa
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "MPICH primary repository". The branch, master has been updated via b95c5fa2fd3aff6c235ab9e5ae9afba3b142198a (commit) from d19d9044c7bcaf958385f00944ef3a9d596885c0 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://git.mpich.org/mpich.git/commitdiff/b95c5fa2fd3aff6c235ab9e5ae9afba3b1... commit b95c5fa2fd3aff6c235ab9e5ae9afba3b142198a Author: Ken Raffenetti <[email protected]> Date: Thu Jul 31 15:10:49 2014 -0500 add test for canceling anysource recv Canceling an anysource can be tricky if the netmod does matching. There are additional functions that must be working in order for the cancel to be correctly reported. This test will exercise that functionality. Signed-off-by: Wesley Bland <[email protected]> diff --git a/test/mpi/pt2pt/Makefile.am b/test/mpi/pt2pt/Makefile.am index 752a451..0135272 100644 --- a/test/mpi/pt2pt/Makefile.am +++ b/test/mpi/pt2pt/Makefile.am @@ -22,6 +22,7 @@ noinst_PROGRAMS = \ bsend5 \ bsendalign \ cancelrecv \ + cancelanysrc \ isendself \ issendselfcancel \ sendself \ diff --git a/test/mpi/pt2pt/cancelanysrc.c b/test/mpi/pt2pt/cancelanysrc.c new file mode 100644 index 0000000..09cd64f --- /dev/null +++ b/test/mpi/pt2pt/cancelanysrc.c @@ -0,0 +1,48 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2014 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ +#include <stdio.h> +#include <stdlib.h> +#include <assert.h> +#include "mpi.h" + +int main(int argc, char **argv) { + int size, rank, msg, cancelled; + MPI_Request request; + MPI_Status status; + + MPI_Init(&argc, &argv); + MPI_Comm_size(MPI_COMM_WORLD, &size); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + + if (size != 2) { + fprintf(stderr,"ERROR: must be run with 2 processes"); + MPI_Abort(MPI_COMM_WORLD, 1); + } + + if (rank == 0) { + msg = -1; + /* Post, then cancel MPI_ANY_SOURCE recv */ + MPI_Irecv(&msg, 1, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &request); + MPI_Cancel(&request); + MPI_Wait(&request, &status); + MPI_Test_cancelled(&status, &cancelled); + assert(cancelled); + + MPI_Barrier(MPI_COMM_WORLD); + MPI_Irecv(&msg, 1, MPI_INT, MPI_ANY_SOURCE, 0, MPI_COMM_WORLD, &request); + MPI_Wait(&request, &status); + assert(msg == 42); + } else { + MPI_Barrier(MPI_COMM_WORLD); + msg = 42; + MPI_Send(&msg, 1, MPI_INT, 0, 0, MPI_COMM_WORLD); + } + + if (rank == 0) + printf(" No Errors\n"); + + MPI_Finalize(); +} diff --git a/test/mpi/pt2pt/testlist b/test/mpi/pt2pt/testlist index d3a7da9..a21618b 100644 --- a/test/mpi/pt2pt/testlist +++ b/test/mpi/pt2pt/testlist @@ -30,6 +30,7 @@ scancel2 2 pscancel 2 xfail=ticket287 rcancel 2 cancelrecv 2 xfail=ticket287 +cancelanysrc 2 isendselfprobe 1 inactivereq 1 waittestnull 1 ----------------------------------------------------------------------- Summary of changes: test/mpi/pt2pt/Makefile.am | 1 + test/mpi/pt2pt/cancelanysrc.c | 48 +++++++++++++++++++++++++++++++++++++++++ test/mpi/pt2pt/testlist | 1 + 3 files changed, 50 insertions(+), 0 deletions(-) create mode 100644 test/mpi/pt2pt/cancelanysrc.c hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org