瀏覽代碼

StarPU-MPI: Specify when make -C mpi check should be run

make -C mpi check is executed:
- if run from a svn checkout, or if the user specifically ask for it with --enable-mpi-check when running configure
and
- if mpiexec is available
Nathalie Furmento 14 年之前
父節點
當前提交
464e1dcf36
共有 2 個文件被更改,包括 34 次插入1 次删除
  1. 31 0
      configure.ac
  2. 3 1
      mpi/Makefile.am

+ 31 - 0
configure.ac

@@ -801,6 +801,37 @@ else
 fi
 AC_SUBST(CC_OR_MPICC, $cc_or_mpicc)
 
+# If the user specifically asks for it, or if we are in a developer checkout, we enable mpi check
+AC_ARG_ENABLE(mpi-check, AC_HELP_STRING([--enable-mpi-check], [Enable execution of MPI testcases]))
+running_mpi_check=0
+if test -d "$srcdir/.svn" ; then
+    running_mpi_check=yes
+fi
+if test x$enable_mpi_check = xyes ; then
+    running_mpi_check=yes
+fi
+if test x$enable_mpi_check = xno ; then
+    running_mpi_check=no
+fi
+
+# Check if mpiexec is available
+mpiexec=$(dirname $mpicc_path)/mpiexec
+if test ! -x $mpiexec ; then
+    mpiexec=""
+    running_mpi_check=no
+fi
+
+if test x$use_mpi = xyes; then
+        AC_MSG_CHECKING(whether mpiexec is available)
+        AC_MSG_RESULT($mpiexec)
+        AC_MSG_CHECKING(whether MPI tests should be run)
+        AC_MSG_RESULT($running_mpi_check)
+        if test x$running_mpi_check = xyes; then
+            AC_SUBST(MPIEXEC,$mpiexec)
+        fi
+        AM_CONDITIONAL(STARPU_MPI_CHECK, test x$running_mpi_check = xyes)
+fi
+
 AC_MSG_CHECKING(whether the StarPU MPI library should be generated)
 AC_MSG_RESULT($use_mpi)
 AC_SUBST(USE_MPI, $use_mpi)

+ 3 - 1
mpi/Makefile.am

@@ -16,8 +16,10 @@
 
 CC=$(MPICC)
 
-TESTS_ENVIRONMENT	=	$(shell dirname $(MPICC))/mpiexec -np 2
+if STARPU_MPI_CHECK
+TESTS_ENVIRONMENT	=	$(MPIEXEC) -np 2
 TESTS			=	$(check_PROGRAMS)
+endif
 
 check_PROGRAMS =