hpx/distribution_policies/binpacking_distribution_policy.hpp#

See Public API for a list of names and headers that are part of the public HPX API.

namespace hpx
namespace components

Variables

constexpr char const *const default_binpacking_counter_name = "/runtime{locality/total}/count/component@"#
static 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

inline binpacking_distribution_policy()#

Default-construct a new instance of a binpacking_distribution_policy. This policy will represent one locality (the local locality).

inline 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 represent

  • perf_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).

inline 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 represent

  • perf_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).

inline 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 represent

  • perf_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>
inline hpx::future<hpx::id_type> create(Ts&&... vs) const#

Create one object on one of the localities associated by this policy instance

Parameters

vs – [in] The arguments which will be forwarded to the constructor of the new object.

Returns

A future holding the global address which represents the newly created object

template<typename Component, typename ...Ts>
inline 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

Parameters
  • count – [in] The number of objects to create

  • vs – [in] The arguments which will be forwarded to the constructors of the new objects.

Returns

A future holding the list of global addresses which represent the newly created objects

inline std::string const &get_counter_name() const#

Returns the name of the performance counter associated with this policy instance.

inline std::size_t get_num_localities() const#

Returns the number of associated localities for this distribution policy

Note

This function is part of the creation policy implemented by this class