# - specifying the maximal wall clock time in seconds a test is allowed
# to run
#
+# TEST_MPI_RANK_LIMIT
+# - specifying the maximal number of MPI ranks that can be used. If a
+# test variant configures a larger number of MPI ranks (via
+# .mpirun=N. in the output file) than this limit the test will be
+# dropped. The special value "0" enforces no limit.
+#
# Usage:
# DEAL_II_ADD_TEST(category test_name comparison_file)
#
-MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file)
+FUNCTION(DEAL_II_ADD_TEST _category _test_name _comparison_file)
IF(NOT DEAL_II_PROJECT_CONFIG_INCLUDED)
MESSAGE(FATAL_ERROR
STRING(REGEX REPLACE "^mpirun=([0-9]*)$" "\\1" _n_cpu ${_n_cpu})
ENDIF()
+ #
+ # If the number of MPI ranks specified for the test via .mpirun=N.
+ # exceeds the limit ${TEST_MPI_RANK_LIMIT}, skip defining the test
+ #
+ IF(TEST_MPI_RANK_LIMIT GREATER 0 AND _n_cpu GREATER TEST_MPI_RANK_LIMIT)
+ RETURN()
+ ENDIF()
+
#
# Determine the expected build stage of this test:
#
DEPENDS ${TEST_DEPENDENCIES_${_target}}
)
ENDIF()
- SET(TEST_DEPENDENCIES_${_target} ${_test_full})
+ SET(TEST_DEPENDENCIES_${_target} ${_test_full} PARENT_SCOPE)
ENDIF()
ENDIF()
ENDFOREACH()
-ENDMACRO()
+ENDFUNCTION()
# TEST_TIME_LIMIT
# - Specifies the maximal wall clock time in seconds a test is
# allowed to run. Defaults to 600.
+# TEST_MPI_RANK_LIMIT
+# - specifying the maximal number of MPI ranks that can be used. If a
+# test variant configures a larger number of MPI ranks (via
+# .mpirun=N. in the output file) than this limit the test will be
+# dropped. The special value "0" enforces no limit.
+#
# TEST_PICKUP_REGEX
# - A regular expression to select only a subset of tests during setup.
# An empty string is interpreted as a catchall (this is the default).
# DEAL_II_PICKUP_TESTS()
#
-# We use CONTINUE(), which is new in cmake 3.2
-CMAKE_MINIMUM_REQUIRED(VERSION 3.2.0)
-
#
# Two very small macros that are used below:
#
ENDIF()
#
- # Set time limit:
+ # Set various limits:
#
SET_IF_EMPTY(TEST_TIME_LIMIT "$ENV{TEST_TIME_LIMIT}")
SET_IF_EMPTY(TEST_TIME_LIMIT 600)
+ SET_IF_EMPTY(TEST_MPI_RANK_LIMIT "$ENV{TEST_MPI_RANK_LIMIT}")
+ SET_IF_EMPTY(TEST_MPI_RANK_LIMIT 0)
+
#
# ... and finally pick up tests:
#