[mpich2-commits] r4123 - in mpich2/trunk/test/mpi: . errors errors/faults

gropp at mcs.anl.gov gropp at mcs.anl.gov
Wed Mar 18 16:15:10 CDT 2009


Author: gropp
Date: 2009-03-18 16:15:10 -0500 (Wed, 18 Mar 2009)
New Revision: 4123

Added:
   mpich2/trunk/test/mpi/errors/faults/
   mpich2/trunk/test/mpi/errors/faults/Makefile.sm
   mpich2/trunk/test/mpi/errors/faults/pt2ptf1.c
   mpich2/trunk/test/mpi/errors/faults/testlist
Modified:
   mpich2/trunk/test/mpi/configure.in
   mpich2/trunk/test/mpi/errors/Makefile.sm
   mpich2/trunk/test/mpi/errors/testlist.in
Log:
Added an optional test for handling of faults in MPI programs - MPICH2 fails this, but now there is something to test

Modified: mpich2/trunk/test/mpi/configure.in
===================================================================
--- mpich2/trunk/test/mpi/configure.in	2009-03-18 20:15:18 UTC (rev 4122)
+++ mpich2/trunk/test/mpi/configure.in	2009-03-18 21:15:10 UTC (rev 4123)
@@ -67,6 +67,8 @@
 ,enable_spawn=yes)
 AC_ARG_ENABLE(checkerrors,
 [--enable-checkerrors - Add some tests for checking for errors in user programs],,enable_checkerrors=default)
+AC_ARG_ENABLE(checkfaults,
+[--enable-checkfaults - Add some tests for checking on handling of faults in user programs],,enable_checkfaults=no)
 AC_ARG_ENABLE(fast,
 [--enable-fast - Indicates that the MPI implementation may have been built for fastest operation, such as building without error checking.  Has the effect of --enable-checkerrors=no])
 AC_ARG_ENABLE(strictmpi,
@@ -248,6 +250,12 @@
     AC_DEFINE(HAVE_MPI_WIN_CREATE,1,[Define if MPI_Win_create is available])
 fi
 AC_SUBST(rmadir)
+
+faultsdir=#
+if test "$enable_checkfaults" = "yes" ; then
+    faultsdir=faults
+fi
+AC_SUBST(faultsdir)
 #
 if test "$enable_strictmpi" = "yes" ; then
     AC_DEFINE(USE_STRICT_MPI,1,[Define if only operations defined in MPI should be tested])
@@ -1069,6 +1077,7 @@
 	  errors/basic/Makefile \
 	  errors/coll/Makefile \
 	  errors/comm/Makefile \
+	  errors/faults/Makefile \
 	  errors/group/Makefile \
 	  errors/pt2pt/Makefile \
 	  errors/rma/Makefile \

Modified: mpich2/trunk/test/mpi/errors/Makefile.sm
===================================================================
--- mpich2/trunk/test/mpi/errors/Makefile.sm	2009-03-18 20:15:18 UTC (rev 4122)
+++ mpich2/trunk/test/mpi/errors/Makefile.sm	2009-03-18 21:15:10 UTC (rev 4123)
@@ -1,5 +1,5 @@
 SUBDIRS_otherlangs = cxx f77 f90
-SUBDIRS = attr coll comm group pt2pt rma spawn topo io @otherlangs@ basic
+SUBDIRS = attr coll comm group pt2pt rma spawn topo io @otherlangs@ basic faults
 
 testing:
 	../runtests -srcdir=$(srcdir) -tests=testlist \

Added: mpich2/trunk/test/mpi/errors/faults/Makefile.sm
===================================================================
--- mpich2/trunk/test/mpi/errors/faults/Makefile.sm	                        (rev 0)
+++ mpich2/trunk/test/mpi/errors/faults/Makefile.sm	2009-03-18 21:15:10 UTC (rev 4123)
@@ -0,0 +1,14 @@
+INCLUDES = -I../../include -I${top_srcdir}/include
+LDADD = ../../util/mtest.o 
+DEPADD = @MPILIBLOC@ ../../util/mtest.o
+smvar_do_sharedlibs = 0
+
+pt2ptf1_SOURCES = pt2ptf1.c
+
+../../util/mtest.o: 
+	(cd ../../util && make mtest.o)
+
+testing:
+	../../runtests -srcdir=$(srcdir) -tests=testlist \
+			-mpiexec=$(bindir)/mpiexec \
+		   	-xmlfile=summary.xml

Added: mpich2/trunk/test/mpi/errors/faults/pt2ptf1.c
===================================================================
--- mpich2/trunk/test/mpi/errors/faults/pt2ptf1.c	                        (rev 0)
+++ mpich2/trunk/test/mpi/errors/faults/pt2ptf1.c	2009-03-18 21:15:10 UTC (rev 4123)
@@ -0,0 +1,52 @@
+/* -*- Mode: C; c-basic-offset:4 ; -*- */
+/*
+ *
+ *  (C) 2009 by Argonne National Laboratory.
+ *      See COPYRIGHT in top-level directory.
+ */
+#include "mpi.h"
+#include <stdio.h>
+#include "mpitest.h"
+
+static char MTEST_Descrip[] = "Test err in status return, using truncated \
+messages for MPI_Testall";
+
+int main( int argc, char *argv[] )
+{
+    int wrank, wsize, rank, size, color;
+    int i, j, tmp;
+    MPI_Comm newcomm;
+
+    MPI_Init( &argc, &argv );
+
+    MPI_Comm_size( MPI_COMM_WORLD, &wsize );
+    MPI_Comm_rank( MPI_COMM_WORLD, &wrank );
+
+    /* Color is 0 or 1; 1 will be the processes that "fault" */
+    color = (wrank > 0) && (wrank <= wsize/2);
+    MPI_Comm_split( MPI_COMM_WORLD, color, wrank, &newcomm );
+
+    MPI_Barrier( MPI_COMM_WORLD );
+    if (color) {
+	/* Simulate a fault on some processes */
+	exit(1);
+    }
+    
+    /* Can we still use newcomm? */
+    MPI_Comm_size( newcomm, &size );
+    MPI_Comm_rank( newcomm, &rank );
+
+    for (j=0; j<rank; j++) {
+	MPI_Recv( &tmp, 1, MPI_INT, j, 0, newcomm, MPI_STATUS_IGNORE );
+    }
+    for (j=rank+1; j<size; j++) {
+	MPI_Send( &rank, 1, MPI_INT, j, 0, newcomm );
+    }
+
+    MPI_Comm_free( &newcomm );
+    MPI_Finalize();
+
+    printf( " No Errors\n" );
+
+    return 0;
+}

Added: mpich2/trunk/test/mpi/errors/faults/testlist
===================================================================
--- mpich2/trunk/test/mpi/errors/faults/testlist	                        (rev 0)
+++ mpich2/trunk/test/mpi/errors/faults/testlist	2009-03-18 21:15:10 UTC (rev 4123)
@@ -0,0 +1 @@
+pt2ptf1 4
\ No newline at end of file

Modified: mpich2/trunk/test/mpi/errors/testlist.in
===================================================================
--- mpich2/trunk/test/mpi/errors/testlist.in	2009-03-18 20:15:18 UTC (rev 4122)
+++ mpich2/trunk/test/mpi/errors/testlist.in	2009-03-18 21:15:10 UTC (rev 4123)
@@ -10,3 +10,4 @@
 @f77dir@
 @cxxdir@
 @f90dir@
+ at faultsdir@



More information about the mpich2-commits mailing list