]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Bugfix: Run related MPI tests sequentally to avoid a racecondition when creating...
authormaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 28 Sep 2013 22:09:04 +0000 (22:09 +0000)
committermaier <maier@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 28 Sep 2013 22:09:04 +0000 (22:09 +0000)
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

index 1faea678c916ad763296ffe9f9d36f14ac783de1..8f538d46e692d5970749073610a1bec17adfd03a 100644 (file)
@@ -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()

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.