[mpich] MPICH primary repository branch, master, updated. v3.1rc2-109-g0bc9871
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 0bc9871d9318a6b53c68a58648868de797685cb2 (commit) from 870585656310bffa1704f326e8e3aa27f3de478f (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/0bc9871d9318a6b53c68a58648868de797... commit 0bc9871d9318a6b53c68a58648868de797685cb2 Author: Pavan Balaji <[email protected]> Date: Sun Dec 22 16:18:25 2013 +0800 Added a new comm_idup_overlap test. This patch tests the code when we are duping overlapping communicators (with two processes each) essentially forming a ring that should deadlock with blocking Comm_dup. With Comm_idup, this should work correctly as per the MPI standard. diff --git a/test/mpi/comm/Makefile.am b/test/mpi/comm/Makefile.am index b46859a..5602828 100644 --- a/test/mpi/comm/Makefile.am +++ b/test/mpi/comm/Makefile.am @@ -36,4 +36,5 @@ noinst_PROGRAMS = \ probe-intercomm \ comm_idup \ comm_idup_mul \ + comm_idup_overlap \ comm_info diff --git a/test/mpi/comm/comm_idup_overlap.c b/test/mpi/comm/comm_idup_overlap.c new file mode 100644 index 0000000..a535743 --- /dev/null +++ b/test/mpi/comm/comm_idup_overlap.c @@ -0,0 +1,52 @@ +/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */ +/* + * (C) 2013 by Argonne National Laboratory. + * See COPYRIGHT in top-level directory. + */ + +#include <stdio.h> +#include <mpi.h> + +int main(int argc, char **argv) +{ + int i, rank, size, color; + MPI_Group group; + MPI_Comm primary[2], secondary[2], tmp; + MPI_Request req[2]; + + MPI_Init(&argc, &argv); + MPI_Comm_rank(MPI_COMM_WORLD, &rank); + MPI_Comm_size(MPI_COMM_WORLD, &size); + + /* Each pair of processes creates a communicator */ + for (i = 0; i < size; i++) { + if (rank == i) + MPI_Comm_split(MPI_COMM_WORLD, 0, 0, &primary[0]); + else if (rank == (i + 1) % size) + MPI_Comm_split(MPI_COMM_WORLD, 0, 0, &secondary[0]); + else { + MPI_Comm_split(MPI_COMM_WORLD, 1, 0, &tmp); + MPI_Comm_free(&tmp); + } + MPI_Barrier(MPI_COMM_WORLD); + } + + /* Each pair dups the communicator such that the dups are + * overlapping. If this were done with MPI_Comm_dup, this should + * deadlock. */ + MPI_Comm_idup(primary[0], &primary[1], &req[0]); + MPI_Comm_idup(secondary[0], &secondary[1], &req[1]); + MPI_Waitall(2, req, MPI_STATUSES_IGNORE); + + for (i = 0; i < 2; i++) { + MPI_Comm_free(&primary[i]); + MPI_Comm_free(&secondary[i]); + } + + if (rank == 0) + printf(" No Errors\n"); + + MPI_Finalize(); + + return 0; +} diff --git a/test/mpi/comm/testlist b/test/mpi/comm/testlist index 568bf2b..c5ed8d8 100644 --- a/test/mpi/comm/testlist +++ b/test/mpi/comm/testlist @@ -28,6 +28,7 @@ comm_idup 2 mpiversion=3.0 comm_idup 4 mpiversion=3.0 comm_idup 9 mpiversion=3.0 comm_idup_mul 2 mpiversion=3.0 xfail=ticket1935 +comm_idup_overlap 2 mpiversion=3.0 xfail=ticket1935 dup_with_info 2 mpiversion=3.0 dup_with_info 4 mpiversion=3.0 dup_with_info 9 mpiversion=3.0 ----------------------------------------------------------------------- Summary of changes: test/mpi/comm/Makefile.am | 1 + test/mpi/comm/comm_idup_overlap.c | 52 +++++++++++++++++++++++++++++++++++++ test/mpi/comm/testlist | 1 + 3 files changed, 54 insertions(+), 0 deletions(-) create mode 100644 test/mpi/comm/comm_idup_overlap.c hooks/post-receive -- MPICH primary repository
participants (1)
-
noreply@mpich.org