7#ifdef CompilerHasSysinfo
12 std::stringstream out;
14#ifdef CompilerHasSysinfo
16 sched_getaffinity(0,
sizeof(cpu_set_t), &mask);
18 for (
auto i = 0
u; i < std::thread::hardware_concurrency(); i++) {
19 if (CPU_ISSET(i, &mask) != 0) {
26 out <<
" -- not available -- ";
33#ifdef CompilerHasSysinfo
35 sched_getaffinity(0,
sizeof(cpu_set_t), &mask);
38 for (
auto i = 0
u; i < std::thread::hardware_concurrency(); i++) {
39 if (CPU_ISSET(i, &mask) != 0) {
46 return std::thread::hardware_concurrency();
50#ifndef SharedMemoryParallelisation
70#ifdef CompilerHasSysinfo
71 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.
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...