distribution_policies¶
The contents of this module can be included with the header
hpx/modules/distribution_policies.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/distribution_policies.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
components
Variables
-
HPX_INLINE_CONSTEXPR_VARIABLE char const* const hpx::components::default_binpacking_counter_name= "/runtime{locality/total}/count/component@"
-
const binpacking_distribution_policy
binpacked
= {}¶ A predefined instance of the binpacking distribution_policy. It will represent the local locality and will place all items to create here.
-
struct
binpacking_distribution_policy
¶ - #include <binpacking_distribution_policy.hpp>
This class specifies the parameters for a binpacking distribution policy to use for creating a given number of items on a given set of localities. The binpacking policy will distribute the new objects in a way such that each of the localities will equalize the number of overall objects of this type based on a given criteria (by default this criteria is the overall number of objects of this type).
Public Functions
-
binpacking_distribution_policy
()¶ Default-construct a new instance of a binpacking_distribution_policy. This policy will represent one locality (the local locality).
-
binpacking_distribution_policy
operator()
(std::vector<id_type> const &locs, char const *perf_counter_name = default_binpacking_counter_name) const¶ Create a new default_distribution policy representing the given set of localities.
- Parameters
locs
: [in] The list of localities the new instance should representperf_counter_name
: [in] The name of the performance counter which should be used as the distribution criteria (by default the overall number of existing instances of the given component type will be used).
-
binpacking_distribution_policy
operator()
(std::vector<id_type> &&locs, char const *perf_counter_name = default_binpacking_counter_name) const¶ Create a new default_distribution policy representing the given set of localities.
- Parameters
locs
: [in] The list of localities the new instance should representperf_counter_name
: [in] The name of the performance counter which should be used as the distribution criteria (by default the overall number of existing instances of the given component type will be used).
-
binpacking_distribution_policy
operator()
(id_type const &loc, char const *perf_counter_name = default_binpacking_counter_name) const¶ Create a new default_distribution policy representing the given locality
- Parameters
loc
: [in] The locality the new instance should representperf_counter_name
: [in] The name of the performance counter that should be used as the distribution criteria (by default the overall number of existing instances of the given component type will be used).
-
template<typename
Component
, typename ...Ts
>
hpx::future<hpx::id_type>create
(Ts&&... vs) const¶ Create one object on one of the localities associated by this policy instance
- Return
A future holding the global address which represents the newly created object
- Parameters
vs
: [in] The arguments which will be forwarded to the constructor of the new object.
-
template<typename
Component
, typename ...Ts
>
hpx::future<std::vector<bulk_locality_result>>bulk_create
(std::size_t count, Ts&&... vs) const¶ Create multiple objects on the localities associated by this policy instance
- Return
A future holding the list of global addresses which represent the newly created objects
- Parameters
count
: [in] The number of objects to createvs
: [in] The arguments which will be forwarded to the constructors of the new objects.
-
-
-
namespace
-
namespace
hpx
-
namespace
components
Variables
-
const colocating_distribution_policy
colocated
= {}¶ A predefined instance of the co-locating distribution_policy. It will represent the local locality and will place all items to create here.
-
struct
colocating_distribution_policy
¶ - #include <colocating_distribution_policy.hpp>
This class specifies the parameters for a distribution policy to use for creating a given number of items on the locality where a given object is currently placed.
Public Functions
-
colocating_distribution_policy
()¶ Default-construct a new instance of a colocating_distribution_policy. This policy will represent the local locality.
-
colocating_distribution_policy
operator()
(id_type const &id) const¶ Create a new colocating_distribution_policy representing the locality where the given object is current located
- Parameters
id
: [in] The global address of the object with which the new instances should be colocated on
-
template<typename
Client
, typenameStub
>
colocating_distribution_policyoperator()
(client_base<Client, Stub> const &client) const¶ Create a new colocating_distribution_policy representing the locality where the given object is current located
- Parameters
client
: [in] The client side representation of the object with which the new instances should be colocated on
-
template<typename
Component
, typename ...Ts
>
hpx::future<hpx::id_type>create
(Ts&&... vs) const¶ Create one object on the locality of the object this distribution policy instance is associated with
- Note
This function is part of the placement policy implemented by this class
- Return
A future holding the global address which represents the newly created object
- Parameters
vs
: [in] The arguments which will be forwarded to the constructor of the new object.
-
template<typename
Component
, typename ...Ts
>
hpx::future<std::vector<bulk_locality_result>>bulk_create
(std::size_t count, Ts&&... vs) const¶ Create multiple objects colocated with the object represented by this policy instance
- Note
This function is part of the placement policy implemented by this class
- Return
A future holding the list of global addresses which represent the newly created objects
- Parameters
count
: [in] The number of objects to createvs
: [in] The arguments which will be forwarded to the constructors of the new objects.
-
template<typename
Action
, typename ...Ts
>
async_result<Action>::typeasync
(launch policy, Ts&&... vs) const¶
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
async_result<Action>::typeasync_cb
(launch policy, Callback &&cb, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameContinuation
, typename ...Ts
>
boolapply
(Continuation &&c, threads::thread_priority priority, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typename ...Ts
>
boolapply
(threads::thread_priority priority, Ts&&... vs) const¶
-
template<typename
Action
, typenameContinuation
, typenameCallback
, typename ...Ts
>
boolapply_cb
(Continuation &&c, threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
boolapply_cb
(threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶
-
template<typename
Action
>
structasync_result
¶ - #include <colocating_distribution_policy.hpp>
- Note
This function is part of the invocation policy implemented by this class
-
-
const colocating_distribution_policy
-
namespace
-
namespace
hpx
Variables
-
const container_distribution_policy
container_layout
= {}¶
-
struct
container_distribution_policy
: public default_distribution_policy¶ Public Functions
-
container_distribution_policy
()¶
-
container_distribution_policy
operator()
(std::size_t num_partitions) const¶
-
container_distribution_policy
operator()
(hpx::id_type const &locality) const¶
-
container_distribution_policy
operator()
(std::vector<id_type> const &localities) const¶
-
container_distribution_policy
operator()
(std::vector<id_type> &&localities) const¶
-
container_distribution_policy
operator()
(std::size_t num_partitions, std::vector<id_type> const &localities) const¶
-
container_distribution_policy
operator()
(std::size_t num_partitions, std::vector<id_type> &&localities) const¶
Private Functions
Friends
-
friend
hpx::hpx::serialization::access
-
-
namespace
traits
-
template<>
structnum_container_partitions
<container_distribution_policy>¶ Public Static Functions
-
static std::size_t
call
(container_distribution_policy const &policy)¶
-
static std::size_t
-
template<>
-
const container_distribution_policy
-
namespace
hpx
-
namespace
components
Variables
-
const target_distribution_policy
target
= {}¶ A predefined instance of the target_distribution_policy. It will represent the local locality and will place all items to create here.
-
struct
target_distribution_policy
¶ - #include <target_distribution_policy.hpp>
This class specifies the parameters for a simple distribution policy to use for creating (and evenly distributing) a given number of items on a given set of localities.
Public Functions
-
target_distribution_policy
()¶ Default-construct a new instance of a target_distribution_policy. This policy will represent one locality (the local locality).
-
target_distribution_policy
operator()
(id_type const &id) const¶ Create a new target_distribution_policy representing the given locality
- Parameters
loc
: [in] The locality the new instance should represent
-
template<typename
Component
, typename ...Ts
>
hpx::future<hpx::id_type>create
(Ts&&... vs) const¶ Create one object on one of the localities associated by this policy instance
- Note
This function is part of the placement policy implemented by this class
- Return
A future holding the global address which represents the newly created object
- Parameters
vs
: [in] The arguments which will be forwarded to the constructor of the new object.
-
template<typename
Component
, typename ...Ts
>
hpx::future<std::vector<bulk_locality_result>>bulk_create
(std::size_t count, Ts&&... vs) const¶ Create multiple objects on the localities associated by this policy instance
- Note
This function is part of the placement policy implemented by this class
- Return
A future holding the list of global addresses which represent the newly created objects
- Parameters
count
: [in] The number of objects to createvs
: [in] The arguments which will be forwarded to the constructors of the new objects.
-
template<typename
Action
, typename ...Ts
>
async_result<Action>::typeasync
(launch policy, Ts&&... vs) const¶
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
async_result<Action>::typeasync_cb
(launch policy, Callback &&cb, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameContinuation
, typename ...Ts
>
boolapply
(Continuation &&c, threads::thread_priority priority, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typename ...Ts
>
boolapply
(threads::thread_priority priority, Ts&&... vs) const¶
-
template<typename
Action
, typenameContinuation
, typenameCallback
, typename ...Ts
>
boolapply_cb
(Continuation &&c, threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
boolapply_cb
(threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶
-
template<typename
Action
>
structasync_result
¶ - #include <target_distribution_policy.hpp>
- Note
This function is part of the invocation policy implemented by this class
-
-
const target_distribution_policy
-
namespace
-
namespace
hpx
-
namespace
components
-
struct
unwrapping_result_policy
¶ - #include <unwrapping_result_policy.hpp>
This class is a distribution policy that can be using with actions that return futures. For those actions it is possible to apply certain optimizations if the action is invoked synchronously.
Public Functions
-
unwrapping_result_policy
(id_type const &id)¶
-
template<typename
Client
, typenameStub
>unwrapping_result_policy
(client_base<Client, Stub> const &client)¶
-
template<typename
Action
, typename ...Ts
>
async_result<Action>::typeasync
(launch policy, Ts&&... vs) const¶
-
template<typename
Action
, typename ...Ts
>
async_result<Action>::typeasync
(launch::sync_policy, Ts&&... vs) const¶
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
async_result<Action>::typeasync_cb
(launch policy, Callback &&cb, Ts&&... vs) const¶
-
template<typename
Action
, typenameContinuation
, typename ...Ts
>
boolapply
(Continuation &&c, threads::thread_priority priority, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typename ...Ts
>
boolapply
(threads::thread_priority priority, Ts&&... vs) const¶
-
template<typename
Action
, typenameContinuation
, typenameCallback
, typename ...Ts
>
boolapply_cb
(Continuation &&c, threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶ - Note
This function is part of the invocation policy implemented by this class
-
template<typename
Action
, typenameCallback
, typename ...Ts
>
boolapply_cb
(threads::thread_priority priority, Callback &&cb, Ts&&... vs) const¶
-
template<typename
Action
>
structasync_result
¶
-
-
struct
-
namespace