Commit 158d921c authored by William Gropp's avatar William Gropp
Browse files

[svn-r4123] Added an optional test for handling of faults in MPI programs -...

[svn-r4123] Added an optional test for handling of faults in MPI programs - MPICH2 fails this, but now there is something to test
parent 5265ca26
......@@ -67,6 +67,8 @@ AC_ARG_ENABLE(spawn,
,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 @@ else
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 @@ AC_OUTPUT(maint/testmerge \
errors/basic/Makefile \
errors/coll/Makefile \
errors/comm/Makefile \
errors/faults/Makefile \
errors/group/Makefile \
errors/pt2pt/Makefile \
errors/rma/Makefile \
......
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 \
......
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
/* -*- 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;
}
pt2ptf1 4
\ No newline at end of file
......@@ -10,3 +10,4 @@ topo
@f77dir@
@cxxdir@
@f90dir@
@faultsdir@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment