]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Performance tests: pass through ${ENABLE_PERFORMANCE_TESTS} variable
authorMatthias Maier <tamiko@43-1.org>
Thu, 10 Feb 2022 22:09:17 +0000 (16:09 -0600)
committerMatthias Maier <tamiko@43-1.org>
Fri, 11 Feb 2022 10:10:33 +0000 (04:10 -0600)
cmake/macros/macro_deal_ii_add_test.cmake
cmake/macros/macro_deal_ii_pickup_tests.cmake
tests/CMakeLists.txt
tests/setup_testsubproject.cmake

index df4319773ff4b85b2187ef696e6c881ae88d3cc2..d64df74c94faba1c301bcdd5c8c8a9994ec54c81 100644 (file)
 #       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}"
           )
index be45591131e98115b90da135d1a4fc9e20d0013c..ae7ddfd0015e61384a54de16a911d4f798a9a188 100644 (file)
 #       - 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()
index 73ce994f9a4edc4f25c4cc52b42009cbbb852b8c..1829e07259b3d435ab2f4752585ebd4d2eb3f728 100644 (file)
@@ -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}}")
index bebdd255e7c40736d6df6f7047d040ffc9bb0aed..d131b95ed99e2bd8745a11e8d6f742187901ba31 100644 (file)
@@ -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()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.