BioDynaMo
v1.05.120-25dc9790
|
This class stores information about each thread. (e.g. to which NUMA node it belongs to.) NB: Threads must be bound to CPUs using OMP_PROC_BIND=true
.
More...
#include <thread_info.h>
Public Member Functions | |
ThreadInfo (const ThreadInfo &)=delete | |
ThreadInfo & | operator= (const ThreadInfo &)=delete |
int | GetMyThreadId () const |
int | GetMyNumaNode () const |
int | GetMyNumaThreadId () const |
Return the numa thread id of an openmp thread. More... | |
int | GetNumaNodes () const |
Returns the number of NUMA nodes on this machine. More... | |
int | GetNumaNode (int omp_thread_id) const |
Returns the numa node the given openmp thread is bound to. More... | |
int | GetThreadsInNumaNode (int numa_node) const |
Returns the number of threads in a given NUMA node. More... | |
int | GetNumaThreadId (int omp_thread_id) const |
Return the numa thread id of an openmp thread. More... | |
int | GetMaxThreads () const |
Return the maximum number of threads. More... | |
uint64_t | GetUniversalThreadId () const |
uint64_t | GetMaxUniversalThreadId () const |
void | Renew () |
Static Public Member Functions | |
static ThreadInfo * | GetInstance () |
Private Member Functions | |
ThreadInfo () | |
Private Attributes | |
int | max_threads_ |
Maximum number of threads for this simulation. More... | |
uint16_t | numa_nodes_ |
Number of NUMA nodes on this machine. More... | |
std::vector< int > | thread_numa_mapping_ |
std::vector< int > | numa_thread_id_ |
std::vector< int > | threads_in_numa_ |
Static Private Attributes | |
static std::atomic< uint64_t > | thread_counter_ |
Friends | |
std::ostream & | operator<< (std::ostream &str, const ThreadInfo &ti) |
This class stores information about each thread. (e.g. to which NUMA node it belongs to.) NB: Threads must be bound to CPUs using OMP_PROC_BIND=true
.
Definition at line 31 of file thread_info.h.
|
delete |
|
inlineprivate |
Definition at line 158 of file thread_info.h.
|
static |
Definition at line 21 of file thread_info.cc.
|
inline |
Return the maximum number of threads.
Definition at line 66 of file thread_info.h.
|
inline |
Definition at line 72 of file thread_info.h.
|
inline |
Definition at line 42 of file thread_info.h.
|
inline |
Return the numa thread id of an openmp thread.
Definition at line 45 of file thread_info.h.
|
inline |
Definition at line 39 of file thread_info.h.
|
inline |
Returns the numa node the given openmp thread is bound to.
Definition at line 51 of file thread_info.h.
|
inline |
Returns the number of NUMA nodes on this machine.
Definition at line 48 of file thread_info.h.
|
inline |
Return the numa thread id of an openmp thread.
Definition at line 61 of file thread_info.h.
|
inline |
Returns the number of threads in a given NUMA node.
Definition at line 56 of file thread_info.h.
uint64_t bdm::ThreadInfo::GetUniversalThreadId | ( | ) | const |
Returns a unique thread id even for parallel regions that don't use OpenMP.
Definition at line 26 of file thread_info.cc.
|
delete |
|
inline |
Renews the metadata.
Whenever a thread is scheduled on a different cpu, e.g. using numa_run_on_node
, Renew()
must be called to update the thread metadata.
Definition at line 78 of file thread_info.h.
|
friend |
Definition at line 112 of file thread_info.h.
|
private |
Maximum number of threads for this simulation.
Definition at line 138 of file thread_info.h.
|
private |
Number of NUMA nodes on this machine.
Definition at line 140 of file thread_info.h.
|
private |
Contains the mapping omp_thread_id -> numa thread id
each thread in a numa domain has a unique id in the range 0 to number
of threads in this numa domain
Definition at line 150 of file thread_info.h.
|
staticprivate |
Definition at line 135 of file thread_info.h.
|
private |
Contains the mapping thread id -> numa node
vector position = omp_thread_id
vector value = numa node
Definition at line 145 of file thread_info.h.
|
private |
Contains the mapping numa node -> total number of threads in this numa node
vector position: numa node
vector value number of threads
Definition at line 156 of file thread_info.h.