]> https://gitweb.dealii.org/ - dealii.git/commitdiff
port multithread_info.cc to oneAPI
authorMatthias Maier <tamiko@43-1.org>
Thu, 6 Jan 2022 12:36:58 +0000 (06:36 -0600)
committerMatthias Maier <tamiko@43-1.org>
Wed, 12 Jan 2022 10:17:14 +0000 (04:17 -0600)
source/base/multithread_info.cc

index 01d82759143d3438bfb1d6725a49322c077573d0..c78fbd7b8cdee5cd2304b5612a387f9f25d3d9eb 100644 (file)
@@ -22,7 +22,7 @@
 
 #ifdef DEAL_II_WITH_TBB
 #  ifdef DEAL_II_TBB_WITH_ONEAPI
-#    include <tbb/task_arena.h>
+#    include <tbb/global_control.h>
 #  else
 #    include <tbb/task_scheduler_init.h>
 #  endif
@@ -90,11 +90,16 @@ MultithreadInfo::set_thread_limit(const unsigned int max_threads)
     n_max_threads = n_cores();
 
 #ifdef DEAL_II_WITH_TBB
+#  ifdef DEAL_II_TBB_WITH_ONEAPI
+  tbb::global_control(tbb::global_control::max_allowed_parallelism,
+                      n_max_threads);
+#  else
   // 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
 #endif
 }
 

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.