15 #ifndef CORE_UTIL_THREAD_INFO_H_
16 #define CORE_UTIL_THREAD_INFO_H_
93 int tid = omp_get_thread_num();
116 str <<
"\nthread to numa mapping\t: ";
121 str <<
"\nthread id in numa node\t: ";
126 str <<
"\nnum threads per numa\t: ";
159 auto proc_bind = omp_get_proc_bind();
160 if (proc_bind != 1 && proc_bind != 4) {
167 "ThreadInfo::ThreadInfo",
168 "The environment variable OMP_PROC_BIND must be set to "
169 "true prior to running BioDynaMo ('export OMP_PROC_BIND=true')");
static void Warning(const std::string &location, const Args &... parts)
Prints warning message.
This class stores information about each thread. (e.g. to which NUMA node it belongs to....
int GetMyNumaThreadId() const
Return the numa thread id of an openmp thread.
static ThreadInfo * GetInstance()
std::vector< int > numa_thread_id_
ThreadInfo & operator=(const ThreadInfo &)=delete
int GetMyNumaNode() const
ThreadInfo(const ThreadInfo &)=delete
uint16_t numa_nodes_
Number of NUMA nodes on this machine.
uint64_t GetMaxUniversalThreadId() const
int max_threads_
Maximum number of threads for this simulation.
int GetNumaNode(int omp_thread_id) const
Returns the numa node the given openmp thread is bound to.
friend std::ostream & operator<<(std::ostream &str, const ThreadInfo &ti)
int GetThreadsInNumaNode(int numa_node) const
Returns the number of threads in a given NUMA node.
std::vector< int > thread_numa_mapping_
int GetMyThreadId() const
std::vector< int > threads_in_numa_
static std::atomic< uint64_t > thread_counter_
int GetNumaNodes() const
Returns the number of NUMA nodes on this machine.
uint64_t GetUniversalThreadId() const
int GetNumaThreadId(int omp_thread_id) const
Return the numa thread id of an openmp thread.
int GetMaxThreads() const
Return the maximum number of threads.
int numa_num_configured_nodes()
int numa_node_of_cpu(int)