]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Performance tests: limit concurrency of tests
authorMatthias Maier <tamiko@43-1.org>
Sun, 20 Feb 2022 16:47:11 +0000 (10:47 -0600)
committerMatthias Maier <tamiko@43-1.org>
Mon, 21 Feb 2022 11:03:06 +0000 (05:03 -0600)
Our usual strategy of limiting test concurrency by attributing a
workload of "mpi ranks / 2" to a test that uses mpirun doesn't really
work in case of performance tests where the underlying machine should
not be overcommitted.

cmake/macros/macro_deal_ii_add_test.cmake

index c6edca761765ad4c0eb17a51f85e1cdaa70e2abc..99131a6c51090850d9d3d325a7d97172c692f80c 100644 (file)
@@ -495,16 +495,35 @@ FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file)
         TIMEOUT ${TEST_TIME_LIMIT}
         )
 
-      #
-      # Limit concurrency of mpi tests. We can only set concurrency
-      # for the entire test, which includes the compiling and linking
-      # stages that are purely sequential. There is no good way to model
-      # this without unnecessarily restricting concurrency. Consequently,
-      # we just choose to model an "average" concurrency as one half of
-      # the number of MPI jobs.
-      #
-      IF(_n_cpu GREATER 2)
-        MATH(EXPR _slots "${_n_cpu} / 2")
+      IF(NOT ENABLE_PERFORMANCE_TESTS)
+
+      IF(NOT ENABLE_PERFORMANCE_TESTS)
+        #
+        # Limit concurrency of mpi tests. We can only set concurrency for
+        # the entire test, which includes the compiling and linking stages
+        # that are purely sequential. There is no good way to model this
+        # without unnecessarily restricting concurrency. Consequently, we
+        # just choose to model an "average" concurrency as one half of the
+        # number of MPI jobs.
+        #
+        IF(_n_cpu GREATER 2)
+          MATH(EXPR _slots "${_n_cpu} / 2")
+          SET_TESTS_PROPERTIES(${_test_full} PROPERTIES PROCESSORS ${_slots})
+        ENDIF()
+
+      ELSE()
+        #
+        # In case ENABLE_PERFORMANCE_TESTS is set we limit the concurrency
+        # of performance tests to the number of specified mpi ranks times
+        # the number of specified threads.
+        #
+        SET(_slots 1)
+        IF(_n_cpu GREATER 0)
+          MATH(EXPR _slots "${_slots} * ${_n_cpu}")
+        ENDIF()
+        IF(_n_threads GREATER 0)
+          MATH(EXPR _slots "${_slots} * ${_n_threads}")
+        ENDIF()
         SET_TESTS_PROPERTIES(${_test_full} PROPERTIES PROCESSORS ${_slots})
       ENDIF()
 

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.