BioDynaMo
v1.05.120-25dc9790
|
Go to the documentation of this file.
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')");
177 #endif // CORE_UTIL_THREAD_INFO_H_
int numa_node_of_cpu(int)
static ThreadInfo * GetInstance()
int GetNumaNodes() const
Returns the number of NUMA nodes on this machine.
static std::atomic< uint64_t > thread_counter_
int GetMyNumaThreadId() const
Return the numa thread id of an openmp thread.
std::vector< int > thread_numa_mapping_
int GetNumaThreadId(int omp_thread_id) const
Return the numa thread id of an openmp thread.
static void Warning(const std::string &location, const Args &... parts)
Prints warning message.
int GetMyNumaNode() const
uint16_t numa_nodes_
Number of NUMA nodes on this machine.
int numa_num_configured_nodes()
ThreadInfo & operator=(const ThreadInfo &)=delete
std::vector< int > threads_in_numa_
std::vector< int > numa_thread_id_
int GetMaxThreads() const
Return the maximum number of threads.
uint64_t GetMaxUniversalThreadId() const
int max_threads_
Maximum number of threads for this simulation.
friend std::ostream & operator<<(std::ostream &str, const ThreadInfo &ti)
int GetMyThreadId() const
uint64_t GetUniversalThreadId() const
This class stores information about each thread. (e.g. to which NUMA node it belongs to....
int GetNumaNode(int omp_thread_id) const
Returns the numa node the given openmp thread is bound to.
int GetThreadsInNumaNode(int numa_node) const
Returns the number of threads in a given NUMA node.