hpx/distribution_policies/colocating_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

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, typename Stub>
colocating_distribution_policy operator()(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 create

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

template<typename Action, typename ...Ts>
async_result<Action>::type async(launch policy, Ts&&... vs) const
template<typename Action, typename Callback, typename ...Ts>
async_result<Action>::type async_cb(launch policy, Callback &&cb, Ts&&... vs) const

Note

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

template<typename Action, typename Continuation, typename ...Ts>
bool apply(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>
bool apply(threads::thread_priority priority, Ts&&... vs) const
template<typename Action, typename Continuation, typename Callback, typename ...Ts>
bool apply_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, typename Callback, typename ...Ts>
bool apply_cb(threads::thread_priority priority, Callback &&cb, Ts&&... vs) const
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

hpx::id_type get_next_target() const

Returns the locality which is anticipated to be used for the next async operation

template<typename Action>
struct async_result
#include <colocating_distribution_policy.hpp>

Note

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

Public Types

template<>
using type = hpx::future<typename traits::promise_local_result<typename hpx::traits::extract_action<Action>::remote_result_type>::type>