resource_partitioner

#include <hpx/resource_partitioner/partitioner_fwd.hpp>

namespace hpx
namespace resource

Typedefs

using scheduler_function = util::function_nonser<std::unique_ptr<hpx::threads::thread_pool_base>(hpx::threads::thread_pool_init_parameters, hpx::threads::policies::thread_queue_init_parameters)>

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.

#include <hpx/resource_partitioner/partitioner.hpp>

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

partitioner(util::function_nonser<int(hpx::program_options::variables_map &vm)> const &f, hpx::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default, )
partitioner(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default, )
partitioner(util::function_nonser<int(int, char **)> const &f, int argc, char **argv, std::vector<std::string> const &cfg, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default, )
partitioner(int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)
partitioner(int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)
partitioner(hpx::program_options::options_description const &desc_cmdline, int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)
partitioner(hpx::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)
partitioner(std::nullptr_t f, int argc, char **argv, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default)
partitioner(std::nullptr_t f, int argc, char **argv, std::vector<std::string> const &cfg, resource::partitioner_mode rpmode = resource::mode_default, hpx::runtime_mode mode = hpx::runtime_mode_default)
partitioner(std::nullptr_t f, hpx::program_options::options_description const &desc_cmdline, int argc, char **argv, std::vector<std::string> ini_config, resource::partitioner_mode rpmode = resource::mode_default, runtime_mode mode = runtime_mode_default)
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

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

#include <compatibility/hpx/runtime/resource/partitioner_fwd.hpp>

#include <compatibility/hpx/runtime/resource/partitioner.hpp>