From a4a87604491ce15b37dae4f2ba226d69bdb85d41 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sat, 28 Sep 2013 22:09:04 +0000 Subject: [PATCH] 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 --- tests/cmake/macros/macro_add_test.cmake | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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() -- 2.39.5