[mpich-commits] [mpich] MPICH primary repository branch, master, updated. v3.1rc1-11-gea66029

mysql vizuser noreply at mpich.org
Mon Nov 11 14:54:03 CST 2013


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  ea66029303a939a907537013b811f7e99bf45ad1 (commit)
      from  6442aa7b82322906126b5b7c12b6481eeb4a0ae7 (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/ea66029303a939a907537013b811f7e99bf45ad1

commit ea66029303a939a907537013b811f7e99bf45ad1
Author: Ken Raffenetti <raffenet at mcs.anl.gov>
Date:   Wed Nov 6 15:43:51 2013 -0600

    addtional tests for FT collectives
    
    Test collectives where all processes do not contribute to the
    result. These tests use the MPI_Comm_group_create function to create
    a new communicator excluding the failed process in order to do error
    collection.
    
    Closes #1901
    
    Signed-off-by: Wesley Bland <wbland at mcs.anl.gov>

diff --git a/test/mpi/ft/Makefile.am b/test/mpi/ft/Makefile.am
index 4b70c96..b01f80a 100644
--- a/test/mpi/ft/Makefile.am
+++ b/test/mpi/ft/Makefile.am
@@ -10,4 +10,4 @@ include $(top_srcdir)/Makefile.mtest
 ## 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 = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce
+noinst_PROGRAMS = die abort sendalive isendalive senddead recvdead isenddead irecvdead barrier gather reduce bcast scatter
diff --git a/test/mpi/ft/bcast.c b/test/mpi/ft/bcast.c
new file mode 100644
index 0000000..0bdae30
--- /dev/null
+++ b/test/mpi/ft/bcast.c
@@ -0,0 +1,91 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "mpitest.h"
+
+/*
+ * This test attempts collective bcast communication after a process in
+ * the communicator has failed.
+ */
+int main(int argc, char **argv)
+{
+    int rank, size, rc, errclass, toterrs, errs = 0;
+    int deadprocs[] = {1};
+    char buf[100000];
+    MPI_Group world, newgroup;
+    MPI_Comm newcomm;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+    if (size < 3) {
+        fprintf( stderr, "Must run with at least 3 processes\n" );
+        MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    if (rank == 1) {
+        exit(EXIT_FAILURE);
+    }
+
+    if (rank == 0) {
+        strcpy(buf, "No Errors");
+    }
+
+    /* do a small bcast first */
+    rc = MPI_Bcast(buf, 10, MPI_CHAR, 0, MPI_COMM_WORLD);
+
+#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
+    MPI_Error_class(rc, &errclass);
+    if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
+        fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+        errs++;
+    }
+#endif
+
+    /* reset the non-root buffers */
+    if (rank != 0)
+        memset(buf, 0, sizeof(buf));
+
+    /* do a larger bcast */
+    rc = MPI_Bcast(buf, 100000, MPI_CHAR, 0, MPI_COMM_WORLD);
+
+#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
+    MPI_Error_class(rc, &errclass);
+    if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
+        fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+        errs++;
+    }
+#endif
+
+    MPI_Comm_group(MPI_COMM_WORLD, &world);
+    MPI_Group_excl(world, 1, deadprocs, &newgroup);
+    MPI_Comm_create_group(MPI_COMM_WORLD, newgroup, 0, &newcomm);
+
+    rc = MPI_Reduce(&errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, newcomm);
+    if(rc)
+        fprintf(stderr, "Failed to get errors from other processes\n");
+
+    if (rank == 0) {
+        if (toterrs) {
+            printf( " Found %d errors\n", toterrs );
+        }
+        else {
+            printf( " No Errors\n" );
+        }
+        fflush(stdout);
+    }
+
+    MPI_Finalize();
+
+    return 0;
+
+}
diff --git a/test/mpi/ft/scatter.c b/test/mpi/ft/scatter.c
new file mode 100644
index 0000000..93f7b86
--- /dev/null
+++ b/test/mpi/ft/scatter.c
@@ -0,0 +1,102 @@
+/* -*- Mode: C; c-basic-offset:4 ; indent-tabs-mode:nil ; -*- */
+/*
+ *
+ *  (C) 2003 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*
+ * This test attempts collective communication after a process in
+ * the communicator has failed.
+ */
+int main(int argc, char **argv)
+{
+    int rank, size, i, rc, errclass, toterrs, errs = 0;
+    char rbuf[100000];
+    char *sendbuf;
+    int deadprocs[1] = {1};
+    MPI_Group world, newgroup;
+    MPI_Comm newcomm;
+
+    MPI_Init(&argc, &argv);
+    MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+    MPI_Comm_size(MPI_COMM_WORLD, &size);
+    MPI_Comm_set_errhandler(MPI_COMM_WORLD, MPI_ERRORS_RETURN);
+
+    if (size < 3) {
+        fprintf( stderr, "Must run with at least 3 processes\n" );
+        MPI_Abort( MPI_COMM_WORLD, 1 );
+    }
+
+    if (rank == 1) {
+        exit(EXIT_FAILURE);
+    }
+
+    /* try a small send first */
+    sendbuf = (char *)malloc(10*size*sizeof(char));
+
+    if (rank == 0) {
+      for (i=0;i<size;i++) {
+          strcpy(sendbuf + i*10, "No Errors");
+      }
+    }
+
+    rc = MPI_Scatter(sendbuf, 10, MPI_CHAR, rbuf, 10, MPI_CHAR, 0, MPI_COMM_WORLD);
+
+#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
+    MPI_Error_class(rc, &errclass);
+    if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
+        fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+        errs++;
+    }
+#endif
+
+    /* reset the buffers and try a larger scatter */
+    free(sendbuf);
+    memset(rbuf, 0, sizeof(rbuf));
+    sendbuf = (char *)malloc(100000*size*sizeof(char));
+
+    if (rank == 0) {
+      for (i=0;i<size;i++) {
+          strcpy(sendbuf + i*100000, "No Errors");
+      }
+    }
+
+    rc = MPI_Scatter(sendbuf, 100000, MPI_CHAR, rbuf, 100000, MPI_CHAR, 0, MPI_COMM_WORLD);
+
+#if defined (MPICH) && (MPICH_NUMVERSION >= 30100102)
+    MPI_Error_class(rc, &errclass);
+    if ((rc) && (errclass != MPIX_ERR_PROC_FAIL_STOP)) {
+        fprintf(stderr, "Wrong error code (%d) returned. Expected MPIX_ERR_PROC_FAIL_STOP\n", errclass);
+        errs++;
+    }
+#endif
+
+    MPI_Comm_group(MPI_COMM_WORLD, &world);
+    MPI_Group_excl(world, 1, deadprocs, &newgroup);
+    MPI_Comm_create_group(MPI_COMM_WORLD, newgroup, 0, &newcomm);
+
+    rc = MPI_Reduce(&errs, &toterrs, 1, MPI_INT, MPI_SUM, 0, newcomm);
+    if(rc)
+        fprintf(stderr, "Failed to get errors from other processes\n");
+
+    if (rank == 0) {
+        if (toterrs) {
+            printf( " Found %d errors\n", toterrs );
+        }
+        else {
+            printf( " No Errors\n" );
+        }
+        fflush(stdout);
+    }
+
+    free(sendbuf);
+
+    MPI_Finalize();
+
+    return 0;
+}
diff --git a/test/mpi/ft/testlist b/test/mpi/ft/testlist
index 3bb71a0..8c00b02 100644
--- a/test/mpi/ft/testlist
+++ b/test/mpi/ft/testlist
@@ -9,3 +9,5 @@ irecvdead 2 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors stric
 barrier 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
 gather 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
 reduce 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
+bcast 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945
+scatter 4 mpiexecarg=-disable-auto-cleanup resultTest=TestStatusNoErrors strict=false timeLimit=10 xfail=ticket1945

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

Summary of changes:
 test/mpi/ft/Makefile.am |    2 +-
 test/mpi/ft/bcast.c     |   91 +++++++++++++++++++++++++++++++++++++++++
 test/mpi/ft/scatter.c   |  102 +++++++++++++++++++++++++++++++++++++++++++++++
 test/mpi/ft/testlist    |    2 +
 4 files changed, 196 insertions(+), 1 deletions(-)
 create mode 100644 test/mpi/ft/bcast.c
 create mode 100644 test/mpi/ft/scatter.c


hooks/post-receive
-- 
MPICH primary repository


More information about the commits mailing list