]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Do not let TBB override the number of threads used 10382/head
authorMatthias Maier <tamiko@43-1.org>
Wed, 27 May 2020 15:58:48 +0000 (10:58 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 27 May 2020 16:02:06 +0000 (11:02 -0500)
source/base/multithread_info.cc

index 1484bafaeba75e8065085e5add6621d50b4209f1..6da31b9853ff5642a2f24ad632c36ec67e35f162 100644 (file)
@@ -81,20 +81,18 @@ MultithreadInfo::set_thread_limit(const unsigned int max_threads)
       }
   }
 
-#ifdef DEAL_II_WITH_TBB
-  // Without restrictions from the user query TBB for the recommended number
-  // of threads:
+  // If we have not set the number of allowed threads yet, just default to
+  // the number of available cores
   if (n_max_threads == numbers::invalid_unsigned_int)
-    n_max_threads = tbb::task_scheduler_init::default_num_threads();
+    n_max_threads = n_cores();
 
+#ifdef DEAL_II_WITH_TBB
   // Initialize the scheduler and destroy the old one before doing so
   static tbb::task_scheduler_init dummy(tbb::task_scheduler_init::deferred);
   if (dummy.is_active())
     dummy.terminate();
   dummy.initialize(n_max_threads);
 #endif
-  if (n_max_threads == numbers::invalid_unsigned_int)
-    n_max_threads = n_cores();
 }
 
 

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.