From: Matthias Maier Date: Thu, 10 Feb 2022 22:09:17 +0000 (-0600) Subject: Performance tests: pass through ${ENABLE_PERFORMANCE_TESTS} variable X-Git-Tag: v9.4.0-rc1~508^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b46ef2df3c18a1777ea43b5d43b751d3e126bbfa;p=dealii.git Performance tests: pass through ${ENABLE_PERFORMANCE_TESTS} variable --- diff --git a/cmake/macros/macro_deal_ii_add_test.cmake b/cmake/macros/macro_deal_ii_add_test.cmake index df4319773f..d64df74c94 100644 --- a/cmake/macros/macro_deal_ii_add_test.cmake +++ b/cmake/macros/macro_deal_ii_add_test.cmake @@ -88,6 +88,17 @@ # additional threads. The special value 0 enforces no limit. Defaults # to 0. # +# ENABLE_PERFORMANCE_TESTS +# - If defined and set to true the execution of performance tests will +# be enabled. +# +# TESTING_ENVIRONMENT +# - Specifies the performance test testing environment. Valid options +# are: +# * "light": mobile laptop, >=2 physical cores, >=8GB RAM +# * "medium": workstation, >=8 physical cores, >=32GB RAM +# * "heavy": compute node, >=32 physical cores, >=128GB RAM +# # Usage: # DEAL_II_ADD_TEST(category test_name comparison_file) # @@ -227,6 +238,13 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) ENDIF() ENDFOREACH() + IF(NOT TESTING_ENVIRONMENT MATCHES "^(light|medium|heavy)$") + MESSAGE(FATAL_ERROR + "The TESTING_ENVIRONMENT variable must be set to either \"light\"," + " \"medium\", or \"heavy\"." + ) + ENDIF() + FOREACH(_build ${_build_types}) # @@ -374,8 +392,17 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file) ) SET_PROPERTY(TARGET ${_target} APPEND PROPERTY - COMPILE_DEFINITIONS SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" + COMPILE_DEFINITIONS + SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}" + TESTING_ENVIRONMENT=${TESTING_ENVIRONMENT} ) + + IF(ENABLE_PERFORMANCE_TESTS) + SET_PROPERTY(TARGET ${_target} APPEND PROPERTY + COMPILE_DEFINITIONS ENABLE_PERFORMANCE_TESTS + ) + ENDIF() + SET_PROPERTY(TARGET ${_target} PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_target_short}" ) diff --git a/cmake/macros/macro_deal_ii_pickup_tests.cmake b/cmake/macros/macro_deal_ii_pickup_tests.cmake index be45591131..ae7ddfd001 100644 --- a/cmake/macros/macro_deal_ii_pickup_tests.cmake +++ b/cmake/macros/macro_deal_ii_pickup_tests.cmake @@ -55,6 +55,17 @@ # - A regular expression to select only a subset of tests during setup. # An empty string is interpreted as a catchall (this is the default). # +# ENABLE_PERFORMANCE_TESTS +# - If defined and set to true the execution of performance tests +# will be enabled. +# +# TESTING_ENVIRONMENT +# - Specifies the performance test testing environment. Valid options +# are: +# * "light": mobile laptop, >=2 physical cores, >=8GB RAM +# * "medium": workstation, >=8 physical cores, >=32GB RAM +# * "heavy": compute node, >=32 physical cores, >=128GB RAM +# # numdiff is used for the comparison of test results. Its location can be # specified with NUMDIFF_DIR. # @@ -196,14 +207,23 @@ MACRO(DEAL_II_PICKUP_TESTS) SET_IF_EMPTY(TEST_THREAD_LIMIT "$ENV{TEST_THREAD_LIMIT}") SET_IF_EMPTY(TEST_THREAD_LIMIT 0) + # + # Other variables: + # + + SET_IF_EMPTY(TEST_PICKUP_REGEX "$ENV{TEST_PICKUP_REGEX}") + + SET_IF_EMPTY(ENABLE_PERFORMANCE_TESTS "$ENV{ENABLE_PERFORMANCE_TESTS}") + + SET_IF_EMPTY(TESTING_ENVIRONMENT "$ENV{TESTING_ENVIRONMENT}") + SET_IF_EMPTY(TESTING_ENVIRONMENT "light") + # # ... and finally pick up tests: # ENABLE_TESTING() - SET_IF_EMPTY(TEST_PICKUP_REGEX "$ENV{TEST_PICKUP_REGEX}") - IF("${ARGN}" STREQUAL "") GET_FILENAME_COMPONENT(_category ${CMAKE_CURRENT_SOURCE_DIR} NAME) ELSE() diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 73ce994f9a..1829e07259 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -100,7 +100,11 @@ FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake "") # # Always undefine the following variables in the setup_tests target: # -FOREACH(_var DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT TEST_MPI_RANK_LIMIT TEST_THREAD_LIMIT) +FOREACH(_var + DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT + TEST_MPI_RANK_LIMIT TEST_THREAD_LIMIT ENABLE_PERFORMANCE_TESTS + TESTING_ENVIRONMENT + ) LIST(APPEND _options "-U${_var}") IF(NOT "${${_var}}" STREQUAL "") LIST(APPEND _options "-D${_var}=${${_var}}") diff --git a/tests/setup_testsubproject.cmake b/tests/setup_testsubproject.cmake index bebdd255e7..d131b95ed9 100644 --- a/tests/setup_testsubproject.cmake +++ b/tests/setup_testsubproject.cmake @@ -3,7 +3,11 @@ FIND_PACKAGE(deal.II 9.2.0 REQUIRED HINTS ${DEAL_II_DIR}) SET(CMAKE_BUILD_TYPE ${DEAL_II_BUILD_TYPE} CACHE STRING "" FORCE) DEAL_II_INITIALIZE_CACHED_VARIABLES() -FOREACH(_var DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT TEST_MPI_RANK_LIMIT TEST_THREAD_LIMIT) +FOREACH(_var + DIFF_DIR NUMDIFF_DIR TEST_PICKUP_REGEX TEST_TIME_LIMIT + TEST_MPI_RANK_LIMIT TEST_THREAD_LIMIT ENABLE_PERFORMANCE_TESTS + TESTING_ENVIRONMENT + ) SET_IF_EMPTY(${_var} "$ENV{${_var}}") SET(${_var} "${${_var}}" CACHE STRING "" FORCE) ENDFOREACH()