[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.2b4-164-gf89c13f

Service Account noreply at mpich.org
Wed Aug 19 09:37:01 CDT 2015


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  f89c13fd2f4b6604e0f8c3ea9bc2618786986fab (commit)
      from  0d5760ae5eccc0db7c2559909f75ada30ee4bb33 (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/f89c13fd2f4b6604e0f8c3ea9bc2618786986fab

commit f89c13fd2f4b6604e0f8c3ea9bc2618786986fab
Author: Lena Oden <loden at anl.gov>
Date:   Mon Aug 17 13:29:58 2015 -0500

    Add a new test for comm_idup error handling
    
    Compared to the test of too_many_icomms, this test calls comm_idup
    several times before waiting with MPI_Waitall. Thus, when error happens,
    there will be several pending comm_idups to be cleaned.  This test
    checks if the remaining comm_idups are handled correctly.
    
    Refs #2296
    
    Signed-off-by: Huiwei Lu <huiweilu at mcs.anl.gov>

diff --git a/test/mpi/errors/comm/Makefile.am b/test/mpi/errors/comm/Makefile.am
index 5957b13..5bf1b00 100644
--- a/test/mpi/errors/comm/Makefile.am
+++ b/test/mpi/errors/comm/Makefile.am
@@ -12,5 +12,5 @@ EXTRA_DIST = testlist
 ## for all programs that are just built from the single corresponding source
 ## file, we don't need per-target _SOURCES rules, automake will infer them
 ## correctly
-noinst_PROGRAMS = cfree ccreate1 manysplit userdup too_many_comms too_many_comms2 too_many_comms3 too_many_icomms
+noinst_PROGRAMS = cfree ccreate1 manysplit userdup too_many_comms too_many_comms2 too_many_comms3 too_many_icomms too_many_icomms2
 
diff --git a/test/mpi/errors/comm/testlist b/test/mpi/errors/comm/testlist
index d5c58e1..0a18cd3 100644
--- a/test/mpi/errors/comm/testlist
+++ b/test/mpi/errors/comm/testlist
@@ -6,3 +6,4 @@ too_many_comms 4 strict=FALSE
 too_many_icomms 4 strict=FALSE
 too_many_comms2 4 strict=FALSE
 too_many_comms3 4 strict=FALSE
+too_many_icomms2 4 strict=FALSE
diff --git a/test/mpi/errors/comm/too_many_icomms2.c b/test/mpi/errors/comm/too_many_icomms2.c
new file mode 100644
index 0000000..bb0afd6
--- /dev/null
+++ b/test/mpi/errors/comm/too_many_icomms2.c
@@ -0,0 +1,82 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2015 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+
+/* This test attempts to create a large number of communicators, in an effort
+ * to exceed the number of communicators that the MPI implementation can
+ * provide.  It checks that the implementation detects this error correctly
+ * handles it.
+ */
+
+/* In this version, we duplicate MPI_COMM_WORLD in a non-blocking
+ * fashion until we run out of context IDs. */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <mpi.h>
+#include "mpitest.h"
+
+#define MAX_NCOMM 100000
+#define WAIT_COMM 7
+static const int verbose = 0;
+
+int main(int argc, char **argv)
+{
+    int rank, nproc, mpi_errno;
+    int i, ncomm, block;
+    int errors = 1;
+    MPI_Comm *comm_hdls;
+    MPI_Request req[WAIT_COMM];
+
+    MPI_Init(&argc, &argv);
+
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &nproc);
+
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+    comm_hdls = malloc(sizeof(MPI_Comm) * MAX_NCOMM);
+
+
+    ncomm = 0;
+    block = 0;
+    for (i = 0; i < MAX_NCOMM; i++) {
+        /* Note: the comms we create are all dups of MPI_COMM_WORLD */
+        MPI_Comm_idup(MPI_COMM_WORLD, &comm_hdls[i], &req[block++]);
+        if(block == WAIT_COMM ){
+            mpi_errno = MPI_Waitall(block, req, MPI_STATUSES_IGNORE);
+            if (mpi_errno == MPI_SUCCESS) {
+                ncomm+=block;
+            }
+            else {
+                if (verbose)
+                    printf("%d: Error creating comm %d\n", rank, i);
+                 errors = 0;
+                 block = 0;
+                 break;
+            }
+            block = 0;
+        }
+    }
+    if(block != 0) {
+        mpi_errno = MPI_Waitall(block, req, MPI_STATUSES_IGNORE);
+        if (mpi_errno == MPI_SUCCESS) {
+            ncomm+=block;
+        }
+        else {
+           if (verbose)
+                printf("%d: Error creating comm %d\n", rank, i);
+            errors = 0;
+        }
+    }
+    for (i = 0; i < ncomm; i++)
+        MPI_Comm_free(&comm_hdls[i]);
+
+    free(comm_hdls);
+    MTest_Finalize(errors);
+    MPI_Finalize();
+
+    return 0;
+}

-----------------------------------------------------------------------

Summary of changes:
 test/mpi/errors/comm/Makefile.am                   |    2 +-
 test/mpi/errors/comm/testlist                      |    1 +
 .../comm/{too_many_icomms.c => too_many_icomms2.c} |   33 ++++++++++++++-----
 3 files changed, 26 insertions(+), 10 deletions(-)
 copy test/mpi/errors/comm/{too_many_icomms.c => too_many_icomms2.c} (66%)


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list