Skip to content
Snippets Groups Projects
Commit 18b555f0 authored by Rupert Nash's avatar Rupert Nash
Browse files

Make the tests run on Cray supercomputers - see issue #154

I've modified the Tester driver program to be configured by CMake. The
MPIEXEC program and its flag to specify the number of processes is now
given through CMake and a NEKTAR_TEST_FORCEMPIEXEC option added. If
the compiler has MPI_BUILTIN (as on Cray machines), then the minimum
necessary options that would have been set by FindMPI.cmake are set.
parent 513be8d1
No related branches found
No related tags found
No related merge requests found
......@@ -300,6 +300,9 @@ ENDIF (NEKTAR_BUILD_UTILITIES)
IF (NEKTAR_BUILD_TESTS)
INCLUDE_DIRECTORIES(tests)
ADD_SUBDIRECTORY(tests)
IF (NEKTAR_USE_MPI)
OPTION(NEKTAR_TEST_FORCEMPIEXEC "Force all tests to be run through the MPI job launcher." OFF)
ENDIF (NEKTAR_USE_MPI)
ENDIF (NEKTAR_BUILD_TESTS)
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake/Nektar++Config.cmake.in
......
......@@ -23,6 +23,18 @@ IF( NEKTAR_USE_MPI )
ELSE()
SET(MPI_BUILTIN ON)
MESSAGE(STATUS "Found MPI: built in")
FIND_PROGRAM(HAVE_APRUN aprun)
IF (HAVE_APRUN)
# Probably on Cray
SET(MPIEXEC "aprun" CACHE STRING "MPI job launching command")
SET(MPIEXEC_NUMPROC_FLAG "-n" CACHE STRING "MPI job launcher flag to specify number of processes")
ELSE()
SET(MPIEXEC "mpirun" CACHE STRING "MPI job launching command")
SET(MPIEXEC_NUMPROC_FLAG "-np" CACHE STRING "MPI job launcher flag to specify number of processes")
ENDIF()
MARK_AS_ADVANCED(MPIEXEC)
MARK_AS_ADVANCED(MPIEXEC_NUMPROC_FLAG)
UNSET(HAVE_APRUN CACHE)
ENDIF()
ADD_DEFINITIONS(-DNEKTAR_USE_MPI)
......
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/tests/Tester.cpp.in
${CMAKE_BINARY_DIR}/tests/Tester.cpp
@ONLY)
SET(TESTER_SOURCES
Metric.cpp
MetricFile.cpp
......@@ -5,7 +8,7 @@ SET(TESTER_SOURCES
MetricLInf.cpp
MetricRegex.cpp
TestData.cpp
Tester.cpp
${CMAKE_BINARY_DIR}/tests/Tester.cpp
sha1.cpp
)
......
......@@ -44,6 +44,8 @@
#include <boost/program_options.hpp>
#include <boost/thread.hpp>
#cmakedefine NEKTAR_TEST_FORCEMPIEXEC 1
using namespace std;
using namespace Nektar;
......@@ -206,9 +208,13 @@ int main(int argc, char *argv[])
// Construct test command to run. If in debug mode, append "-g"
// Output from stdout and stderr are directed to the files output.out
// and output.err, respectively.
if (file.GetNProcesses() > 1)
#ifdef NEKTAR_TEST_FORCEMPIEXEC
#else
if (file.GetNProcesses() > 1)
#endif
{
command += "mpirun -np "
command += "@MPIEXEC@ @MPIEXEC_NUMPROC_FLAG@ "
+ boost::lexical_cast<string>(file.GetNProcesses())
+ " ";
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment