]> 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>
Thu, 6 Jan 2022 14:28:20 +0000 (08:28 -0600)
source/base/multithread_info.cc

index aeed71a479a370c54c95eefe1db47c231c0d9de7..f9d6c984d2ff0179bbdf438bf7c7e23926a016fa 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
@@ -96,11 +96,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
 
 #ifdef DEAL_II_WITH_TASKFLOW

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.