resource_partitioner

The contents of this module can be included with the header hpx/modules/resource_partitioner.hpp. These headers may be used by user-code but are not guaranteed stable (neither header location nor contents). You are using these at your own risk. If you wish to use non-public functionality from a module we strongly suggest only including the module header hpx/modules/resource_partitioner.hpp, not the particular header in which the functionality you would like to use is defined. See Public API for a list of names that are part of the public HPX API.

namespace hpx
namespace resource
class core

Public Functions

core(std::size_t id = invalid_core_id, numa_domain *domain = nullptr)
std::vector<pu> const &pus() const
std::size_t id() const

Private Functions

std::vector<core> cores_sharing_numa_domain()

Private Members

std::size_t id_
numa_domain *domain_
std::vector<pu> pus_

Private Static Attributes

constexpr const std::size_t invalid_core_id = std::size_t(-1)

Friends

friend hpx::resource::pu
friend hpx::resource::numa_domain
class numa_domain

Public Functions

numa_domain(std::size_t id = invalid_numa_domain_id)
std::vector<core> const &cores() const
std::size_t id() const

Private Members

std::size_t id_
std::vector<core> cores_

Private Static Attributes

constexpr const std::size_t invalid_numa_domain_id = std::size_t(-1)

Friends

friend hpx::resource::pu
friend hpx::resource::core
class partitioner

Public Functions

void create_thread_pool(std::string const &name, scheduling_policy sched = scheduling_policy::unspecified, hpx::threads::policies::scheduler_mode = hpx::threads::policies::scheduler_mode::default_mode)
void create_thread_pool(std::string const &name, scheduler_function scheduler_creation)
void set_default_pool_name(std::string const &name)
const std::string &get_default_pool_name() const
void add_resource(hpx::resource::pu const &p, std::string const &pool_name, std::size_t num_threads = 1)
void add_resource(hpx::resource::pu const &p, std::string const &pool_name, bool exclusive, std::size_t num_threads = 1)
void add_resource(std::vector<hpx::resource::pu> const &pv, std::string const &pool_name, bool exclusive = true)
void add_resource(hpx::resource::core const &c, std::string const &pool_name, bool exclusive = true)
void add_resource(std::vector<hpx::resource::core> &cv, std::string const &pool_name, bool exclusive = true)
void add_resource(hpx::resource::numa_domain const &nd, std::string const &pool_name, bool exclusive = true)
void add_resource(std::vector<hpx::resource::numa_domain> const &ndv, std::string const &pool_name, bool exclusive = true)
std::vector<numa_domain> const &numa_domains() const
std::size_t get_number_requested_threads()
hpx::threads::topology const &get_topology() const
void configure_pools()

Private Functions

partitioner(resource::partitioner_mode rpmode, hpx::util::section rtcfg, hpx::threads::policies::detail::affinity_data affinity_data)

Private Members

detail::partitioner &partitioner_
class pu

Public Functions

pu(std::size_t id = invalid_pu_id, core *core = nullptr, std::size_t thread_occupancy = 0)
std::size_t id() const

Private Functions

std::vector<pu> pus_sharing_core()
std::vector<pu> pus_sharing_numa_domain()

Private Members

std::size_t id_
core *core_
std::size_t thread_occupancy_
std::size_t thread_occupancy_count_

Private Static Attributes

constexpr const std::size_t invalid_pu_id = std::size_t(-1)

Friends

friend hpx::resource::core
friend hpx::resource::numa_domain
namespace hpx
namespace resource

Enums

enum partitioner_mode

This enumeration describes the modes available when creating a resource partitioner.

Values:

mode_default = 0

Default mode.

mode_allow_oversubscription = 1

Allow processing units to be oversubscribed, i.e. multiple worker threads to share a single processing unit.

mode_allow_dynamic_pools = 2

Allow worker threads to be added and removed from thread pools.

enum scheduling_policy

This enumeration lists the available scheduling policies (or schedulers) when creating thread pools.

Values:

user_defined = -2
unspecified = -1
local = 0
local_priority_fifo = 1
local_priority_lifo = 2
static_ = 3
static_priority = 4
abp_priority_fifo = 5
abp_priority_lifo = 6
shared_priority = 7

Functions

detail::partitioner &get_partitioner()

May be used anywhere in code and returns a reference to the single, global resource partitioner.

bool is_partitioner_valid()

Returns true if the resource partitioner has been initialized. Returns false otherwise.