struct topology

Declaration

struct topology { /* full declaration omitted */ };

Declared at: libs/pika/topology/include/pika/topology/topology.hpp:101

Method Overview

Methods

void* allocate(std::size_t len) const

Description

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

Description

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

Description

////////////////////////////////////////////////////////////////////////

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

Description

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

Description

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

Declared 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

Description

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

Declared 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

Description

////////////////////////////////////////////////////////////////////////

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

Declared 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

Description

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

Declared 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

Description

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

Description

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

Description

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

Description

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

Description

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

Description

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

Description

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

Description

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

Description

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

Description

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

Description

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

Description

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

Declared 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

Description

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

Description

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

Description

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

Description

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

Description

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

Declared 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

Declared 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

Declared 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

Declared 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

Declared 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

Description

////////////////////////////////////////////////////////////////////////

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

Description

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

Declared 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

Description

////////////////////////////////////////////////////////////////////////

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

Declared 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

Description

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

Declared 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

Description

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()

Declared at: libs/pika/topology/include/pika/topology/topology.hpp:103

void write_to_log() const

Declared at: libs/pika/topology/include/pika/topology/topology.hpp:276

~topology()

Declared at: libs/pika/topology/include/pika/topology/topology.hpp:104