[MOAB-dev] r2102 - in MOAB/trunk: . parallel

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Mon Sep 29 14:24:14 CDT 2008


Author: kraftche
Date: 2008-09-29 14:24:13 -0500 (Mon, 29 Sep 2008)
New Revision: 2102

Modified:
   MOAB/trunk/configure.in
   MOAB/trunk/parallel/Makefile.am
Log:
Add rudimentary support for running tests in parallel.

Configure script now treats the following variables as special:
  MPIEXEC : program to run parallel tests (default: mpiexec or mpirun)
  MPIEXEC_NP : flag to specify number of processors (default: -np)
  NP : number of processors (default: 2)

Any of these values can be specified in the environment during configure
or during "make check", or specified on the command line during either
the configure step or while running "make check".  For example:
  cd parallel
  make check NP=8



Modified: MOAB/trunk/configure.in
===================================================================
--- MOAB/trunk/configure.in	2008-09-29 18:54:39 UTC (rev 2101)
+++ MOAB/trunk/configure.in	2008-09-29 19:24:13 UTC (rev 2102)
@@ -112,6 +112,9 @@
 #                              MPI OPTIONS
 ################################################################################
 
+AC_ARG_VAR(MPIEXEC,[Program to use to run parallel tests (default: mpiexec or mpirun)])
+AC_ARG_VAR(MPIEXEC_NP,[Command line flag to specify number of processors to use (default: -np)])
+AC_ARG_VAR(NP,[Number of processors to on which to run parallel tests (default: 2)])
 if test "x$WITH_MPI" != "xno"; then
   DEFINES="$DEFINES -DUSE_MPI"
   AC_CHECK_HEADER([mpi.h],[],[AC_MSG_ERROR([mpi.h not found or not working])])
@@ -129,8 +132,22 @@
          [AC_MSG_ERROR([mpi.h is not usable])]),
      CPPFLAGS="$save_CPPFLAGS"])
   AC_LANG_RESTORE
+  if test "x$MPIEXEC" = "x"; then
+    if test "x$WITH_MPI" != "xyes"; then
+      AC_CHECK_PROGS([MPIEXEC],[mpiexec mpirun],[true],[${WITH_MPI}:${WITH_MPI}/bin])
+    else
+      AC_CHECK_PROGS([MPIEXEC],[mpiexec mpirun],[true])
+    fi
+  fi
+  if test "x$MPIEXEC_NP" = "x"; then
+    MPIEXEC_NP="-np"
+  fi
+  if test "x$NP" = "x"; then
+    NP=2
+  fi
 fi
 AM_CONDITIONAL(USE_MPI, [test "xno" != "x$WITH_MPI"])
+AM_CONDITIONAL(USE_MPIEXEC, [test "x$MPIEXEC" != "xtrue"])
 
 ################################################################################
 #                              HDF5 OPTIONS

Modified: MOAB/trunk/parallel/Makefile.am
===================================================================
--- MOAB/trunk/parallel/Makefile.am	2008-09-29 18:54:39 UTC (rev 2101)
+++ MOAB/trunk/parallel/Makefile.am	2008-09-29 19:24:13 UTC (rev 2102)
@@ -14,6 +14,11 @@
 # The directory in which to install headers
 libMOABpar_la_includedir = $(includedir)
 
+# Run parallel tests in parallel
+if USE_MPIEXEC
+  OLD_ENVIRONMENT := ${TESTS_ENVIRONMENT}
+  TESTS_ENVIRONMENT = ${MPIEXEC} ${MPIEXEC_NP} ${NP} ${OLD_ENVIRONMENT}
+endif
 
 # Conditional sources
 MOAB_PARALLEL_SRCS =




More information about the moab-dev mailing list