8#ifdef CompilerHasSysinfo
13 std::stringstream out;
15#ifdef CompilerHasSysinfo
17 sched_getaffinity(0,
sizeof(cpu_set_t), &mask);
19 for (
auto i = 0
u; i < std::thread::hardware_concurrency(); i++) {
20 if (CPU_ISSET(i, &mask) != 0) {
27 out <<
" -- not available -- ";
34#ifdef CompilerHasSysinfo
36 sched_getaffinity(0,
sizeof(cpu_set_t), &mask);
39 for (
auto i = 0
u; i < std::thread::hardware_concurrency(); i++) {
40 if (CPU_ISSET(i, &mask) != 0) {
47 return std::thread::hardware_concurrency();
51#ifndef SharedMemoryParallelisation
71#ifdef CompilerHasSysinfo
72 return sched_getcpu();
bool isInitialised() const
int getCoreNumber() const
static Core & getInstance()
int getNumberOfThreads() const
Returns the number of threads that is used.
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.
void processAllReadyTasks()
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...