struct topology
Declaration
struct topology { /* full declaration omitted */ };Declared at: libs/pika/topology/include/pika/topology/topology.hpp:101
Method Overview
- public void * allocate(std::size_t len) const
- public void * allocate_membind(std::size_t len, pika::threads::detail::hwloc_bitmap_ptr bitmap, pika::threads::detail::pika_hwloc_membind_policy policy, int flags) const
- public pika::threads::detail::mask_type bitmap_to_mask(hwloc_bitmap_t bitmap, hwloc_obj_type_t htype) const
- public pika::threads::detail::hwloc_bitmap_ptr cpuset_to_nodeset(pika::threads::detail::mask_cref_type cpuset) const
- public void deallocate(void * addr, std::size_t len) const
- public threads::detail::mask_type get_area_membind_nodeset(const void * addr, std::size_t len) const
- public pika::threads::detail::mask_cref_type get_core_affinity_mask(std::size_t num_thread, pika::error_code & ec = throws) const
- public std::size_t get_core_number(std::size_t num_thread, pika::error_code & = throws) const
- public pika::threads::detail::mask_type get_cpubind_mask(pika::error_code & ec = throws) const
- public pika::threads::detail::mask_type get_cpubind_mask(std::thread & handle, pika::error_code & ec = throws) const
- public pika::threads::detail::mask_cref_type get_machine_affinity_mask(pika::error_code & ec = throws) const
- public int get_numa_domain(const void * addr) const
- public pika::threads::detail::mask_cref_type get_numa_node_affinity_mask(std::size_t num_thread, pika::error_code & ec = throws) const
- public pika::threads::detail::mask_type get_numa_node_affinity_mask_from_numa_node(std::size_t num_node) const
- public std::size_t get_numa_node_number(std::size_t num_thread, pika::error_code & = throws) const
- public std::size_t get_number_of_core_pus(std::size_t core) const
- public std::size_t get_number_of_cores() const
- public std::size_t get_number_of_numa_node_cores(std::size_t numa) const
- public std::size_t get_number_of_numa_node_pus(std::size_t numa) const
- public std::size_t get_number_of_numa_nodes() const
- public std::size_t get_number_of_pus() const
- public std::size_t get_number_of_socket_cores(std::size_t socket) const
- public std::size_t get_number_of_socket_pus(std::size_t socket) const
- public std::size_t get_number_of_sockets() const
- public std::size_t get_pu_number(std::size_t num_core, std::size_t num_pu, pika::error_code & ec = throws) const
- public pika::threads::detail::mask_type get_service_affinity_mask(pika::threads::detail::mask_cref_type used_processing_units, pika::error_code & ec = throws) const
- public pika::threads::detail::mask_cref_type get_socket_affinity_mask(std::size_t num_thread, pika::error_code & ec = throws) const
- public std::size_t get_socket_number(std::size_t num_thread, pika::error_code & = throws) const
- public pika::threads::detail::mask_cref_type get_thread_affinity_mask(std::size_t num_thread, pika::error_code & ec = throws) const
- public pika::threads::detail::mask_type get_thread_affinity_mask_from_lva(const void * lva, pika::error_code & ec = throws) const
- public pika::threads::detail::mask_type init_core_affinity_mask_from_core(std::size_t num_core, pika::threads::detail::mask_cref_type default_mask = empty_mask) const
- public pika::threads::detail::mask_type init_numa_node_affinity_mask_from_numa_node(std::size_t num_numa_node) const
- public pika::threads::detail::mask_type init_socket_affinity_mask_from_socket(std::size_t num_socket) const
- public pika::threads::detail::mask_type init_thread_affinity_mask(std::size_t num_core, std::size_t num_pu) const
- public pika::threads::detail::mask_type init_thread_affinity_mask(std::size_t num_thread) const
- public hwloc_bitmap_t mask_to_bitmap(pika::threads::detail::mask_cref_type mask, hwloc_obj_type_t htype) const
- public void print_affinity_mask(std::ostream & os, std::size_t num_thread, pika::threads::detail::mask_cref_type m, const std::string & pool_name) const
- public void print_hwloc(std::ostream &) const
- public void print_mask_vector(std::ostream & os, const std::vector<mask_type> & v) const
- public void print_vector(std::ostream & os, const std::vector<std::size_t> & v) const
- public bool reduce_thread_priority(pika::error_code & ec = throws) const
- public bool set_area_membind_nodeset(const void * addr, std::size_t len, void * nodeset) const
- public void set_thread_affinity_mask(pika::threads::detail::mask_cref_type mask, pika::error_code & ec = throws) const
- public topology()
- public void write_to_log() const
- public ~topology()
Methods
void* allocate(std::size_t len) const
void* allocate(std::size_t len) constDescription
This is equivalent to malloc(), except that it tries to allocate page-aligned memory from the OS.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:280
Parameters
- std::size_t len
void* allocate_membind(
std::size_t len,
pika::threads::detail::hwloc_bitmap_ptr
bitmap,
pika::threads::detail::
pika_hwloc_membind_policy policy,
int flags) const
void* allocate_membind(
std::size_t len,
pika::threads::detail::hwloc_bitmap_ptr
bitmap,
pika::threads::detail::
pika_hwloc_membind_policy policy,
int flags) constDescription
allocate memory with binding to a numa node set as specified by the policy and flags (see hwloc docs)
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:284
Parameters
- std::size_t len
- pika::threads::detail::hwloc_bitmap_ptr bitmap
- pika::threads::detail::pika_hwloc_membind_policy policy
- int flags
pika::threads::detail::mask_type bitmap_to_mask(
hwloc_bitmap_t bitmap,
hwloc_obj_type_t htype) const
pika::threads::detail::mask_type bitmap_to_mask(
hwloc_bitmap_t bitmap,
hwloc_obj_type_t htype) constDescription
////////////////////////////////////////////////////////////////////////
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:316
Parameters
- hwloc_bitmap_t bitmap
- hwloc_obj_type_t htype
pika::threads::detail::hwloc_bitmap_ptr
cpuset_to_nodeset(
pika::threads::detail::mask_cref_type cpuset)
const
pika::threads::detail::hwloc_bitmap_ptr
cpuset_to_nodeset(
pika::threads::detail::mask_cref_type cpuset)
constDescription
convert a cpu mask into a numa node mask in hwloc bitmap form
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:274
Parameters
- pika::threads::detail::mask_cref_type cpuset
void deallocate(void* addr, std::size_t len) const
void deallocate(void* addr, std::size_t len) constDescription
Free memory that was previously allocated by allocate
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:296
Parameters
- void* addr
- std::size_t len
threads::detail::mask_type
get_area_membind_nodeset(const void* addr,
std::size_t len) const
threads::detail::mask_type
get_area_membind_nodeset(const void* addr,
std::size_t len) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:287
Parameters
- const void* addr
- std::size_t len
pika::threads::detail::mask_cref_type
get_core_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) const
pika::threads::detail::mask_cref_type
get_core_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) constDescription
Return a bit mask where each set bit corresponds to a processing unit available to the given thread inside the core it is running on.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:187
Parameters
- std::size_t num_thread
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
std::size_t get_core_number(
std::size_t num_thread,
pika::error_code& = throws) const
std::size_t get_core_number(
std::size_t num_thread,
pika::error_code& = throws) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:260
Parameters
- std::size_t num_thread
- pika::error_code& = throws
pika::threads::detail::mask_type get_cpubind_mask(
pika::error_code& ec = throws) const
pika::threads::detail::mask_type get_cpubind_mask(
pika::error_code& ec = throws) constDescription
////////////////////////////////////////////////////////////////////////
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:269
Parameters
- pika::error_code& ec = throws
pika::threads::detail::mask_type get_cpubind_mask(
std::thread& handle,
pika::error_code& ec = throws) const
pika::threads::detail::mask_type get_cpubind_mask(
std::thread& handle,
pika::error_code& ec = throws) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:270
Parameters
- std::thread& handle
- pika::error_code& ec = throws
pika::threads::detail::mask_cref_type
get_machine_affinity_mask(
pika::error_code& ec = throws) const
pika::threads::detail::mask_cref_type
get_machine_affinity_mask(
pika::error_code& ec = throws) constDescription
Return a bit mask where each set bit corresponds to a processing unit available to the application.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:136
Parameters
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
int get_numa_domain(const void* addr) const
int get_numa_domain(const void* addr) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:293
Parameters
- const void* addr
pika::threads::detail::mask_cref_type
get_numa_node_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) const
pika::threads::detail::mask_cref_type
get_numa_node_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) constDescription
Return a bit mask where each set bit corresponds to a processing unit available to the given thread inside the NUMA domain it is running on.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:168
Parameters
- std::size_t num_thread
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
pika::threads::detail::mask_type
get_numa_node_affinity_mask_from_numa_node(
std::size_t num_node) const
pika::threads::detail::mask_type
get_numa_node_affinity_mask_from_numa_node(
std::size_t num_node) constDescription
Return a bit mask where each set bit corresponds to a processing unit associated with the given NUMA node.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:177
Parameters
- std::size_t num_node
std::size_t get_numa_node_number(
std::size_t num_thread,
pika::error_code& = throws) const
std::size_t get_numa_node_number(
std::size_t num_thread,
pika::error_code& = throws) constDescription
Return the NUMA node number of the processing unit the given thread is running on.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:124
Parameters
- std::size_t num_thread
- pika::error_code& = throws
std::size_t get_number_of_core_pus(
std::size_t core) const
std::size_t get_number_of_core_pus(
std::size_t core) constDescription
Return number of processing units in given core
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:255
Parameters
- std::size_t core
std::size_t get_number_of_cores() const
std::size_t get_number_of_cores() constDescription
Return the number of available cores
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:240
std::size_t get_number_of_numa_node_cores(
std::size_t numa) const
std::size_t get_number_of_numa_node_cores(
std::size_t numa) constDescription
Return number of cores in given numa domain
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:246
Parameters
- std::size_t numa
std::size_t get_number_of_numa_node_pus(
std::size_t numa) const
std::size_t get_number_of_numa_node_pus(
std::size_t numa) constDescription
Return number of processing units in a given numa domain
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:249
Parameters
- std::size_t numa
std::size_t get_number_of_numa_nodes() const
std::size_t get_number_of_numa_nodes() constDescription
Return the number of available NUMA domains
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:237
std::size_t get_number_of_pus() const
std::size_t get_number_of_pus() constDescription
Return the number of available hardware processing units
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:243
std::size_t get_number_of_socket_cores(
std::size_t socket) const
std::size_t get_number_of_socket_cores(
std::size_t socket) constDescription
Return number of cores units in given socket
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:258
Parameters
- std::size_t socket
std::size_t get_number_of_socket_pus(
std::size_t socket) const
std::size_t get_number_of_socket_pus(
std::size_t socket) constDescription
Return number of processing units in a given socket
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:252
Parameters
- std::size_t socket
std::size_t get_number_of_sockets() const
std::size_t get_number_of_sockets() constDescription
Return the number of available NUMA domains
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:234
std::size_t get_pu_number(
std::size_t num_core,
std::size_t num_pu,
pika::error_code& ec = throws) const
std::size_t get_pu_number(
std::size_t num_core,
std::size_t num_pu,
pika::error_code& ec = throws) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:266
Parameters
- std::size_t num_core
- std::size_t num_pu
- pika::error_code& ec = throws
pika::threads::detail::mask_type
get_service_affinity_mask(
pika::threads::detail::mask_cref_type
used_processing_units,
pika::error_code& ec = throws) const
pika::threads::detail::mask_type
get_service_affinity_mask(
pika::threads::detail::mask_cref_type
used_processing_units,
pika::error_code& ec = throws) constDescription
Return a bit mask where each set bit corresponds to a processing unit available to the service threads in the application.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:147
Parameters
- pika::threads::detail::mask_cref_type used_processing_units
- [in] This is the mask of processing units which are not available for service threads.
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
pika::threads::detail::mask_cref_type
get_socket_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) const
pika::threads::detail::mask_cref_type
get_socket_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) constDescription
Return a bit mask where each set bit corresponds to a processing unit available to the given thread inside the socket it is running on.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:158
Parameters
- std::size_t num_thread
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
std::size_t get_socket_number(
std::size_t num_thread,
pika::error_code& = throws) const
std::size_t get_socket_number(
std::size_t num_thread,
pika::error_code& = throws) constDescription
Return the Socket number of the processing unit the given thread is running on.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:112
Parameters
- std::size_t num_thread
- pika::error_code& = throws
pika::threads::detail::mask_cref_type
get_thread_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) const
pika::threads::detail::mask_cref_type
get_thread_affinity_mask(
std::size_t num_thread,
pika::error_code& ec = throws) constDescription
Return a bit mask where each set bit corresponds to a processing unit available to the given thread.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:196
Parameters
- std::size_t num_thread
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
pika::threads::detail::mask_type
get_thread_affinity_mask_from_lva(
const void* lva,
pika::error_code& ec = throws) const
pika::threads::detail::mask_type
get_thread_affinity_mask_from_lva(
const void* lva,
pika::error_code& ec = throws) constDescription
Return a bit mask where each set bit corresponds to a processing unit co-located with the memory the given address is currently allocated on.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:219
Parameters
- const void* lva
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
pika::threads::detail::mask_type
init_core_affinity_mask_from_core(
std::size_t num_core,
pika::threads::detail::mask_cref_type
default_mask = empty_mask) const
pika::threads::detail::mask_type
init_core_affinity_mask_from_core(
std::size_t num_core,
pika::threads::detail::mask_cref_type
default_mask = empty_mask) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:308
Parameters
- std::size_t num_core
- pika::threads::detail::mask_cref_type default_mask = empty_mask
pika::threads::detail::mask_type
init_numa_node_affinity_mask_from_numa_node(
std::size_t num_numa_node) const
pika::threads::detail::mask_type
init_numa_node_affinity_mask_from_numa_node(
std::size_t num_numa_node) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:306
Parameters
- std::size_t num_numa_node
pika::threads::detail::mask_type
init_socket_affinity_mask_from_socket(
std::size_t num_socket) const
pika::threads::detail::mask_type
init_socket_affinity_mask_from_socket(
std::size_t num_socket) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:304
Parameters
- std::size_t num_socket
pika::threads::detail::mask_type
init_thread_affinity_mask(
std::size_t num_core,
std::size_t num_pu) const
pika::threads::detail::mask_type
init_thread_affinity_mask(
std::size_t num_core,
std::size_t num_pu) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:311
Parameters
- std::size_t num_core
- std::size_t num_pu
pika::threads::detail::mask_type
init_thread_affinity_mask(
std::size_t num_thread) const
pika::threads::detail::mask_type
init_thread_affinity_mask(
std::size_t num_thread) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:310
Parameters
- std::size_t num_thread
hwloc_bitmap_t mask_to_bitmap(
pika::threads::detail::mask_cref_type mask,
hwloc_obj_type_t htype) const
hwloc_bitmap_t mask_to_bitmap(
pika::threads::detail::mask_cref_type mask,
hwloc_obj_type_t htype) constDescription
////////////////////////////////////////////////////////////////////////
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:314
Parameters
- pika::threads::detail::mask_cref_type mask
- hwloc_obj_type_t htype
void print_affinity_mask(
std::ostream& os,
std::size_t num_thread,
pika::threads::detail::mask_cref_type m,
const std::string& pool_name) const
void print_affinity_mask(
std::ostream& os,
std::size_t num_thread,
pika::threads::detail::mask_cref_type m,
const std::string& pool_name) constDescription
Prints the
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:223
Parameters
- std::ostream& os
- std::size_t num_thread
- pika::threads::detail::mask_cref_type m
- to os in a human readable form
- const std::string& pool_name
void print_hwloc(std::ostream&) const
void print_hwloc(std::ostream&) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:302
Parameters
- std::ostream&
void print_mask_vector(
std::ostream& os,
const std::vector<mask_type>& v) const
void print_mask_vector(
std::ostream& os,
const std::vector<mask_type>& v) constDescription
////////////////////////////////////////////////////////////////////////
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:300
Parameters
- std::ostream& os
- const std::vector<mask_type>& v
void print_vector(
std::ostream& os,
const std::vector<std::size_t>& v) const
void print_vector(
std::ostream& os,
const std::vector<std::size_t>& v) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:298
Parameters
- std::ostream& os
- const std::vector<std::size_t>& v
bool reduce_thread_priority(
pika::error_code& ec = throws) const
bool reduce_thread_priority(
pika::error_code& ec = throws) constDescription
Reduce thread priority of the current thread.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:231
Parameters
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
bool set_area_membind_nodeset(const void* addr,
std::size_t len,
void* nodeset) const
bool set_area_membind_nodeset(const void* addr,
std::size_t len,
void* nodeset) constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:290
Parameters
- const void* addr
- std::size_t len
- void* nodeset
void set_thread_affinity_mask(
pika::threads::detail::mask_cref_type mask,
pika::error_code& ec = throws) const
void set_thread_affinity_mask(
pika::threads::detail::mask_cref_type mask,
pika::error_code& ec = throws) constDescription
Use the given bit mask to set the affinity of the given thread. Each set bit corresponds to a processing unit the thread will be allowed to run on.
Declared at: libs/pika/topology/include/pika/topology/topology.hpp:209
Parameters
- pika::threads::detail::mask_cref_type mask
- pika::error_code& ec = throws
- [in,out] this represents the error status on exit, if this is pre-initialized to \athe function will throw on error instead.
topology()
topology()Declared at: libs/pika/topology/include/pika/topology/topology.hpp:103
void write_to_log() const
void write_to_log() constDeclared at: libs/pika/topology/include/pika/topology/topology.hpp:276
~topology()
~topology()Declared at: libs/pika/topology/include/pika/topology/topology.hpp:104