From: maier Date: Sat, 28 Sep 2013 22:09:04 +0000 (+0000) Subject: Bugfix: Run related MPI tests sequentally to avoid a racecondition when creating... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=06ddf9d81bd4b20366e3faa885cd418e156e3fbd;p=dealii-svn.git Bugfix: Run related MPI tests sequentally to avoid a racecondition when creating the executable git-svn-id: https://svn.dealii.org/branches/branch_port_the_testsuite@31007 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/cmake/macros/macro_add_test.cmake b/tests/cmake/macros/macro_add_test.cmake index 1faea678c9..8f538d46e6 100644 --- a/tests/cmake/macros/macro_add_test.cmake +++ b/tests/cmake/macros/macro_add_test.cmake @@ -189,6 +189,25 @@ MACRO(DEAL_II_ADD_TEST _category _test_name _comparison_file _n_cpu) LABEL "${_category}" TIMEOUT ${TEST_TIME_LIMIT} ) + + # + # We have to be careful not to run different mpirun settings for the + # same executable in parallel because this triggers a race condition + # when compiling the not yet existent executable that is shared + # between the different tests. + # + # Luckily CMake has a mechanism to force a test to be run when + # another has finished (and both are scheduled): + # + IF(NOT "${_n_cpu}" STREQUAL "0") + IF(DEFINED TEST_DEPENDENCIES_${_target}) + SET_TESTS_PROPERTIES(${_test_full} PROPERTIES + DEPENDS ${TEST_DEPENDENCIES_${_target}} + ) + ENDIF() + SET(TEST_DEPENDENCIES_${_target} ${_test_full}) + ENDIF() + ENDIF() ENDFOREACH() ENDMACRO()