From 761d16e55e4bf751f6e43d48aa19a22bd98d8277 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Mon, 30 Mar 2015 22:30:18 +0200 Subject: [PATCH] Testsuite: Bugfix: Use MPI information found at configure time --- cmake/config/Config.cmake.in | 8 ++++++++ cmake/config/Make.global_options.in | 10 ++++++++++ cmake/macros/macro_deal_ii_add_test.cmake | 3 ++- tests/CMakeLists.txt | 5 +---- tests/setup_testsubproject.cmake | 5 +---- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/cmake/config/Config.cmake.in b/cmake/config/Config.cmake.in index a1696dd3d3..cb3fc69f05 100644 --- a/cmake/config/Config.cmake.in +++ b/cmake/config/Config.cmake.in @@ -138,6 +138,14 @@ SET(DEAL_II_USER_DEFINITIONS_DEBUG "@DEAL_II_USER_DEFINITIONS_DEBUG@") # _additionally_ used for release targets: SET(DEAL_II_USER_DEFINITIONS_RELEASE "@DEAL_II_USER_DEFINITIONS_RELEASE@") +# +# MPI runtime: +# + +SET(DEAL_II_MPIEXEC "@MPIEXEC@") +SET(DEAL_II_MPIEXEC_NUMPROC_FLAG "@MPIEXEC_NUMPROC_FLAG@") +SET(DEAL_II_MPIEXEC_PREFLAGS "@MPIEXEC_PREFLAGS@") +SET(DEAL_II_MPIEXEC_POSTFLAGS "@MPIEXEC_POSTFLAGS@") # # Build a static executable: diff --git a/cmake/config/Make.global_options.in b/cmake/config/Make.global_options.in index 86b7616989..e27daf7a1f 100644 --- a/cmake/config/Make.global_options.in +++ b/cmake/config/Make.global_options.in @@ -105,6 +105,16 @@ DEAL_II_USER_DEFINITIONS_DEBUG = @MAKEFILE_USER_DEFINITIONS_DEBUG@ DEAL_II_USER_DEFINITIONS_RELEASE = @MAKEFILE_USER_DEFINITIONS_RELEASE@ +# +# MPI runtime: +# + +DEAL_II_MPIEXEC = @MPIEXEC@ +DEAL_II_MPIEXEC_NUMPROC_FLAG = @MPIEXEC_NUMPROC_FLAG@ +DEAL_II_MPIEXEC_PREFLAGS = @MPIEXEC_PREFLAGS@ +DEAL_II_MPIEXEC_POSTFLAGS = @MPIEXEC_POSTFLAGS@ + + # # Build a static executable: # diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index 11134b6c8f..9f45ca4722 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -148,7 +148,8 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file) SET(_diff_target ${_test_name}.mpirun${_n_cpu}.${_build_lowercase}.diff) # diff target name SET(_test_full ${_category}/${_test_name}.mpirun=${_n_cpu}.${_build_lowercase}) # full test name SET(_test_directory ${CMAKE_CURRENT_BINARY_DIR}/${_target}/mpirun=${_n_cpu}) # directory to run the test in - SET(_run_command "${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} ${_n_cpu} ${MPIEXEC_PREFLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${_target}/${_target} ${MPIEXEC_POSTFLAGS}") # the command to issue + # the command to issue + SET(_run_command "${DEAL_II_MPIEXEC} ${DEAL_II_MPIEXEC_NUMPROC_FLAG} ${_n_cpu} ${DEAL_II_MPIEXEC_PREFLAGS} ${CMAKE_CURRENT_BINARY_DIR}/${_target}/${_target} ${DEAL_II_MPIEXEC_POSTFLAGS}") ENDIF() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ef3b2dc842..13c452de4b 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -77,10 +77,7 @@ FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake "") # # Append further configuration to _options: # -FOREACH(_var - DIFF_DIR NUMDIFF_DIR TEST_DIFF TEST_PICKUP_REGEX TEST_TIME_LIMIT - MPIEXEC MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS - ) +FOREACH(_var DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT) LIST(APPEND _options "-U${_var}") IF(DEFINED ${_var}) LIST(APPEND _options "-D${_var}=${${_var}}") diff --git a/tests/setup_testsubproject.cmake b/tests/setup_testsubproject.cmake index 305133c83e..b91850e801 100644 --- a/tests/setup_testsubproject.cmake +++ b/tests/setup_testsubproject.cmake @@ -6,10 +6,7 @@ DEAL_II_INITIALIZE_CACHED_VARIABLES() # # Silence warnings: # -FOREACH(_var - DIFF_DIR NUMDIFF_DIR TEST_DIFF TEST_PICKUP_REGEX TEST_TIME_LIMIT MPIEXEC - MPIEXEC_NUMPROC_FLAG MPIEXEC_PREFLAGS MPIEXEC_POSTFLAGS - ) +FOREACH(_var DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT) IF(DEFINED ${_var}) SET(_bogus "${${_var}}") ENDIF() -- 2.39.5