8#ifdef CompilerHasSysinfo
17#include <tbb/global_control.h>
19#include <oneapi/tbb/task_arena.h>
25 ::tbb::global_control* globalControl =
nullptr;
33 _numberOfThreads( ::
tbb::info::default_concurrency() ) {
47 if (globalControl!=
nullptr)
delete globalControl;
48 globalControl =
nullptr;
49 if (numberOfThreads != UseDefaultNumberOfThreads) {
50 _numberOfThreads = numberOfThreads;
51 globalControl =
new oneapi::tbb::global_control(oneapi::tbb::global_control::max_allowed_parallelism,numberOfThreads);
54 _numberOfThreads = oneapi::tbb::info::default_concurrency();
65 if (globalControl!=
nullptr)
delete globalControl;
66 globalControl =
nullptr;
76 return _numberOfThreads;
81 #ifdef CompilerHasSysinfo
82 return sched_getcpu();
91 return tbb::this_task_arena::current_thread_index();
99 std::this_thread::yield();
#define logWarning(methodName, logMacroMessageStream)
Wrapper macro around tarch::tarch::logging::Log to improve logging.
bool isInitialised() const
int getCoreNumber() const
static Core & getInstance()
int getNumberOfThreads() const
Returns the number of threads that is used.
static tarch::logging::Log _log
Logging device.
void configure(int numberOfThreads=UseDefaultNumberOfThreads)
Configure the whole node, i.e.
void shutdown()
Shutdown parallel environment.
int getThreadNumber() const
void yield()
Wrapper around backend-specific yield.
std::string printUnmaskedThreads()
Creates a string representation of those threads which are available to the processes.
int getNumberOfUnmaskedThreads()
This routine runs through the Unix thread mask and counts how many threads SLURM allows a code to use...
I've written an API to IIT, but I'm not currently using.