]> https://gitweb.dealii.org/ - dealii.git/commit
TBB oneAPI: make global_control object static
authorMatthias Maier <tamiko@43-1.org>
Sun, 22 May 2022 20:18:52 +0000 (15:18 -0500)
committerMatthias Maier <tamiko@43-1.org>
Sun, 22 May 2022 20:19:37 +0000 (15:19 -0500)
commitc7f714ea564046650ea16709b4ed53cfd7499144
treeb29dcb869239b4c6bdc18be2a0c9a7365b3f0667
parenta56c2ee2e15b54833bcdd02162a620285e84d56c
TBB oneAPI: make global_control object static

tbb::global_control is a class that affects the specified behavior of
tbb during its lifetime. Thus, in order to set a global thread limit for
tbb we have to maintain the object throughout the execution of the
program. We do this by maintaining a static std::unique_ptr.

A std::unique_ptr is a good choice here because tbb::global_control does
not provide a mechanism to override its setting - we can only delete the
old and replace it with a new one.
source/base/multithread_info.cc

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.