]> https://gitweb.dealii.org/ - dealii.git/commitdiff
make tests/fe/cell_similariy_11 work without MPI 1178/head
authorTimo Heister <timo.heister@gmail.com>
Thu, 23 Jul 2015 13:01:26 +0000 (09:01 -0400)
committerTimo Heister <timo.heister@gmail.com>
Thu, 23 Jul 2015 13:01:26 +0000 (09:01 -0400)
Avoid exception "Calling set_thread_limit() more than once is not
supported!".

tests/fe/cell_similarity_11.cc
tests/tests.h

index 151e69f079174ab150ba9d5ff5e7adb3b65db163..06a05cb2db34eb6c525927b304748da1139770f7 100644 (file)
 // a MappingQ to switch between a Q1 while passing through the mesh
 //
 // this tests outputs the Jacobian of the transformation and the derivatives
-// in real space in two locations inside the cell. to make sure the cell
-// similarity code is used, only run the program with one thread
+// in real space in two locations inside the cell.
 
+// To make sure the cell similarity code is used, only run the program with
+// one thread. For this we need to disable LimitConcurreny in ../tests.h and
+// then set the number of threads to 1 (in main() below):
+#define DEAL_II_TEST_DO_NOT_SET_THREAD_LIMIT
 
 #include "../tests.h"
 #include <deal.II/base/logstream.h>
index 86b8a47be87b9d4a8701f4b47ad89613e1f6e285..7661a9554eeb3c8657bc005e34935972102ceae8 100644 (file)
@@ -196,7 +196,7 @@ std::string unify_pretty_function (const std::string &text)
  * calls MPI_InitFinalize itself, we can't adjust the thread count
  * for this here.
  */
-#ifndef DEAL_II_WITH_MPI
+#if !defined(DEAL_II_WITH_MPI) && !defined(DEAL_II_TEST_DO_NOT_SET_THREAD_LIMIT)
 struct LimitConcurrency
 {
   LimitConcurrency ()

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.