From: Matthias Maier Date: Mon, 30 Mar 2015 20:30:18 +0000 (+0200) Subject: Testsuite: Bugfix: Use MPI information found at configure time X-Git-Tag: v8.3.0-rc1~339^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F710%2Fhead;p=dealii.git Testsuite: Bugfix: Use MPI information found at configure time --- 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()