Commit 24ce8634 authored by Hendryk Bockelmann's avatar Hendryk Bockelmann
Browse files

add new option --disable-mpirun-check for systems that do not support it

parent c7babbda
This diff is collapsed.
......@@ -40,6 +40,17 @@ AC_ARG_ENABLE([mpi],
esac],
[mpi=false])
# for some systems (e.g. CRAY) mpirun/aprun check is not possible
AC_ARG_ENABLE([mpirun-check],
[AS_HELP_STRING([--disable-mpirun-check],
[disable mpirun checks which might not work on some systems @<:@default: no@:>@])],
[case "${enableval}" in
yes) with_mpirun_check=true ;;
no) with_mpirun_check=false ;;
*) AC_MSG_ERROR([bad value ${enableval} for --disable-mpirun-check]) ;;
esac],
[with_mpirun_check=true])
# OpenMP
AC_ARG_ENABLE([openmp],
[AS_HELP_STRING([--enable-openmp],
......@@ -53,8 +64,9 @@ AC_ARG_ENABLE([openmp],
esac],
[openmp=false])
AM_CONDITIONAL([OPENMP], [test x"$openmp" = xtrue])
AM_CONDITIONAL([MPI], [test x"$mpi" = xtrue])
AM_CONDITIONAL([OPENMP], [test x"$openmp" = xtrue])
AM_CONDITIONAL([MPI], [test x"$mpi" = xtrue])
AM_CONDITIONAL([MPICHECK], [test x"$with_mpirun_check" = xtrue])
# DEBUG
AC_ARG_ENABLE([debug],
......@@ -168,7 +180,10 @@ AX_PROG_FC_MPI([test x"$mpi" != xfalse],
fi])
AS_IF([test x"$mpi" != xfalse],
[AC_PATH_PROGS([MPI_LAUNCH], [poe mpirun mpiexec], [true])
# do not check for launch if mpirun-check is disabled
[AS_IF([test "x$with_mpirun_check" != "xtrue"],
[AC_MSG_WARN([check for MPI_LAUNCH disabled])],
[AC_PATH_PROGS([MPI_LAUNCH], [poe mpirun mpiexec], [true])
# set MP_HOSTFILE if we are using IBM PE
if test x"$(basename $ac_cv_path_MPI_LAUNCH)" == x"poe"; then
# create tmp hostfile and export envVar MP_HOSTFILE
......@@ -193,11 +208,9 @@ AS_IF([test x"$mpi" != xfalse],
# reset MPI_LAUNCH to wrapper script
MPI_LAUNCH="$(pwd)/util/mpi_launch_poe"
ac_cv_path_MPI_LAUNCH=$MPI_LAUNCH
fi])
# check whether MPI environment is working
AS_IF([test x"$mpi" != xfalse],
[AS_IF([test x"$cross_compiling" = xno],
fi
# check whether MPI environment is working
AS_IF([test x"$cross_compiling" = xno],
[AC_MSG_CHECKING([if $MPI_LAUNCH works])
AC_LINK_IFELSE([AC_LANG_SOURCE([
@%:@include <stdio.h>
......@@ -227,12 +240,10 @@ main(int argc, char **argv)
[AS_IF([$MPI_LAUNCH -n 4 ./conftest$EXEEXT 4],
[AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([mpirun doesn't work])])],
AC_MSG_FAILURE([$MPI_LAUNCH doesn't work])])],
[AC_MSG_FAILURE([Cannot compile simple MPI program])])
])
AS_IF([test "x$MPI_LAUNCH" = xtrue],
[AC_MSG_WARN([MPI launch command unavailable])])
])
])])
AC_FC_PP_SRCEXT([f90])
......
......@@ -25,29 +25,25 @@ noinst_PROGRAMS += test_papi
LDADD += $(LTLIBPAPI)
endif
if !OPENMP
if !MPI
if !OPENMP
noinst_PROGRAMS += test_serial
endif
endif
if OPENMP
if !MPI
noinst_PROGRAMS += test_omp
endif
endif
if MPI
if MPICHECK
if !OPENMP
noinst_PROGRAMS += test_mpi
endif
endif
if MPI
if OPENMP
noinst_PROGRAMS += test_hybrid
endif
endif
endif
test_papi_SOURCES = test_papi.c
test_hdf5_SOURCES = test_hdf5.c
......@@ -76,29 +72,25 @@ TESTS += test_hdf5_run
TESTS += test_hdf5_fortran_run
endif
if !OPENMP
if !MPI
if !OPENMP
TESTS += test_serial_run
endif
endif
if OPENMP
if !MPI
TESTS += test_omp_run
endif
endif
if MPI
if MPICHECK
if !OPENMP
TESTS += test_mpi_run
endif
endif
if MPI
if OPENMP
TESTS += test_hybrid_run
endif
endif
endif
# Remove module files and hdf5 output upon make clean:
clean-local:
......
......@@ -7,7 +7,8 @@ export SCT_CALLSTATS=1
@OPENMP_TRUE@export OMP_NUM_THREADS=4
@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_hdf5_fortran
@MPICHECK_TRUE@@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_hdf5_fortran
@MPICHECK_FALSE@@MPI_TRUE@@abs_top_srcdir@/tests/test_hdf5_fortran
@MPI_FALSE@@abs_top_srcdir@/tests/test_hdf5_fortran
retval=$?
......
......@@ -8,7 +8,8 @@ export SCT_CALLSTATS=1
@OPENMP_TRUE@export OMP_NUM_THREADS=4
@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_hdf5
@MPICHECK_TRUE@@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_hdf5
@MPICHECK_FALSE@@MPI_TRUE@@abs_top_srcdir@/tests/test_hdf5
@MPI_FALSE@@abs_top_srcdir@/tests/test_hdf5
retval=$?
......
......@@ -8,7 +8,8 @@ export SCT_EVENTCOUNTERS=1
@OPENMP_TRUE@export OMP_NUM_THREADS=4
@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_papi
@MPICHECK_TRUE@@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_papi
@MPICHECK_FALSE@@MPI_TRUE@@abs_top_srcdir@/tests/test_papi
@MPI_FALSE@@abs_top_srcdir@/tests/test_papi
retval0=$?
......
......@@ -5,7 +5,8 @@ export SCT_CALLSTATS=0
@OPENMP_TRUE@export OMP_NUM_THREADS=4
@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_sct
@MPICHECK_TRUE@@MPI_TRUE@@MPI_LAUNCH@ -n 2 @abs_top_srcdir@/tests/test_sct
@MPICHECK_FALSE@@MPI_TRUE@@abs_top_srcdir@/tests/test_sct
@MPI_FALSE@@abs_top_srcdir@/tests/test_sct
retval=$?
......
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