From 66f35acc2b7da55a556f35ea42cd7f8f785ca703 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Thu, 6 Jan 2022 08:35:14 -0600 Subject: [PATCH] disable threading in task_info.cc for oneAPI TBB with oneAPI API has deprecated and removed the tbb::tasks backend. With this it is no longer possible to compile the following code that builds a directed acyclic graph (DAG) of (thread parallel) tasks without a major porting effort. It turned out that such a dynamic handling of dependencies and structures is not as competitive as initially assumed. Consequently, this part of the matrix free infrastructure has seen less attention than the rest over the last years and is (presumably) rarely used. So in case of detected oneAPI backend we simply disable threading in the matrix free backend for now. --- doc/news/changes/minor/20220106BangerthMaier | 5 ++++- .../matrix_free/matrix_free.templates.h | 22 +++++++++++++++++++ source/matrix_free/task_info.cc | 19 ++++++++++++++++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/doc/news/changes/minor/20220106BangerthMaier b/doc/news/changes/minor/20220106BangerthMaier index ef8c2e7982..5b75e8638a 100644 --- a/doc/news/changes/minor/20220106BangerthMaier +++ b/doc/news/changes/minor/20220106BangerthMaier @@ -1,4 +1,7 @@ Fixed: deal.II has been updated to support the new OneAPI api interface -introduced by the Intel Threading Building Blocks Library. +introduced by the Intel Threading Building Blocks Library. Note that the +threading support of the matrix-free backend will be disabled in this case: +For now, the MatrixFree::AdditionalData::tasks_parallel_scheme control has +no effect and simply defaults to the serial loop.
(Wolfgang Bangerth, Matthias Maier, 2022/01/06) diff --git a/include/deal.II/matrix_free/matrix_free.templates.h b/include/deal.II/matrix_free/matrix_free.templates.h index 0a10940d1e..3b91149a89 100644 --- a/include/deal.II/matrix_free/matrix_free.templates.h +++ b/include/deal.II/matrix_free/matrix_free.templates.h @@ -53,6 +53,24 @@ DEAL_II_ENABLE_EXTRA_DIAGNOSTICS #include +// +// TBB with oneAPI API has deprecated and removed the +// tbb::tasks backend. With this it is no longer possible to +// compile the following code that builds a directed acyclic graph (DAG) of +// (thread parallel) tasks without a major porting effort. It turned out +// that such a dynamic handling of dependencies and structures is not as +// competitive as initially assumed. Consequently, this part of the matrix +// free infrastructure has seen less attention than the rest over the last +// years and is (presumably) not used that often. +// +// In case of detected oneAPI backend we simply disable threading in the +// matrix free backend for now. +// +// Matthias Maier, Martin Kronbichler, 2021 +// +#ifdef DEAL_II_TBB_WITH_ONEAPI +# undef DEAL_II_WITH_TBB +#endif DEAL_II_NAMESPACE_OPEN @@ -2269,4 +2287,8 @@ MatrixFree::print(std::ostream &out) const DEAL_II_NAMESPACE_CLOSE +#ifdef DEAL_II_TBB_WITH_ONEAPI +# define DEAL_II_WITH_TBB +#endif + #endif diff --git a/source/matrix_free/task_info.cc b/source/matrix_free/task_info.cc index 0c987505d9..0338a3e423 100644 --- a/source/matrix_free/task_info.cc +++ b/source/matrix_free/task_info.cc @@ -36,6 +36,25 @@ #include #include +// +// TBB with oneAPI API has deprecated and removed the +// tbb::tasks backend. With this it is no longer possible to +// compile the following code that builds a directed acyclic graph (DAG) of +// (thread parallel) tasks without a major porting effort. It turned out +// that such a dynamic handling of dependencies and structures is not as +// competitive as initially assumed. Consequently, this part of the matrix +// free infrastructure has seen less attention than the rest over the last +// years and is (presumably) not used that often. +// +// In case of detected oneAPI backend we simply disable threading in the +// matrix free backend for now. +// +// Matthias Maier, Martin Kronbichler, 2021 +// +#ifdef DEAL_II_TBB_WITH_ONEAPI +# undef DEAL_II_WITH_TBB +#endif + DEAL_II_NAMESPACE_OPEN -- 2.39.5