async_distributed

The contents of this module can be included with the header hpx/modules/async_distributed.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/async_distributed.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

Functions

template<typename Action, typename F, typename ...Ts>
auto async(F &&f, Ts&&... ts)
namespace hpx

Functions

template<typename Action, typename F, typename ...Ts>
auto async_cb(F &&f, Ts&&... ts)
template<typename F, typename ...Ts>
auto async_cb(F &&f, Ts&&... ts)
namespace hpx

Functions

template<typename Action, typename Cont, typename ...Ts>
lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Action, Cont>::type>::type> async_continue(Cont &&cont, naming::id_type const &gid, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Cont, typename ...Ts>
lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Derived, Cont>::type>::type> async_continue(hpx::actions::basic_action<Component, Signature, Derived>, Cont &&cont, naming::id_type const &gid, Ts&&... vs)
template<typename Action, typename Cont, typename DistPolicy, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Action, Cont>::type>::type>>::type async_continue(Cont &&cont, DistPolicy const &policy, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Cont, typename DistPolicy, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Derived, Cont>::type>::type>>::type async_continue(hpx::actions::basic_action<Component, Signature, Derived>, Cont &&cont, DistPolicy const &policy, Ts&&... vs)
namespace hpx

Functions

template<typename Action, typename Cont, typename Callback, typename ...Ts>
lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Action, Cont>::type>::type> async_continue_cb(Cont &&cont, naming::id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Cont, typename Callback, typename ...Ts>
lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Derived, Cont>::type>::type> async_continue_cb(hpx::actions::basic_action<Component, Signature, Derived>, Cont &&cont, naming::id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Action, typename Cont, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Action, Cont>::type>::type>>::type async_continue_cb(Cont &&cont, DistPolicy const &policy, Callback &&cb, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Cont, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, lcos::future<typename traits::promise_local_result<typename detail::result_of_async_continue<Derived, Cont>::type>::type>>::type async_continue_cb(hpx::actions::basic_action<Component, Signature, Derived>, Cont &&cont, DistPolicy const &policy, Callback &&cb, Ts&&... vs)
template<>
struct get_lva<lcos::base_lco>

Public Static Functions

static lcos::base_lco *call(naming::address_type lva)
template<>
struct get_lva<lcos::base_lco const>

Public Static Functions

static lcos::base_lco const *call(naming::address_type lva)
namespace hpx
template<>
struct get_lva<lcos::base_lco>

Public Static Functions

static lcos::base_lco *call(naming::address_type lva)
template<>
struct get_lva<lcos::base_lco const>

Public Static Functions

static lcos::base_lco const *call(naming::address_type lva)
namespace lcos
class base_lco
#include <base_lco.hpp>

The base_lco class is the common base class for all LCO’s implementing a simple set_event action

Subclassed by hpx::lcos::base_lco_with_value< Result, RemoteResult, ComponentTag >, hpx::lcos::base_lco_with_value< void, void, ComponentTag >

Public Types

typedef components::managed_component<base_lco> wrapping_type
typedef base_lco base_type_holder

Public Functions

virtual void set_event() = 0
virtual void set_exception(std::exception_ptr const &e)
virtual void connect(naming::id_type const&)
virtual void disconnect(naming::id_type const&)
virtual ~base_lco()

Destructor, needs to be virtual to allow for clean destruction of derived objects

virtual void finalize()

finalize() will be called just before the instance gets destructed

void set_event_nonvirt()

The function set_event_nonvirt is called whenever a set_event_action is applied on a instance of a LCO. This function just forwards to the virtual function set_event, which is overloaded by the derived concrete LCO.

void set_exception_nonvirt(std::exception_ptr const &e)

The function set_exception is called whenever a set_exception_action is applied on a instance of a LCO. This function just forwards to the virtual function set_exception, which is overloaded by the derived concrete LCO.

Parameters
  • e: [in] The exception encapsulating the error to report to this LCO instance.

void connect_nonvirt(naming::id_type const &id)

The function connect_nonvirt is called whenever a connect_action is applied on a instance of a LCO. This function just forwards to the virtual function connect, which is overloaded by the derived concrete LCO.

Parameters
  • id: [in] target id

void disconnect_nonvirt(naming::id_type const &id)

The function disconnect_nonvirt is called whenever a disconnect_action is applied on a instance of a LCO. This function just forwards to the virtual function disconnect, which is overloaded by the derived concrete LCO.

Parameters
  • id: [in] target id

HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco, set_event_nonvirt, set_event_action)

Each of the exposed functions needs to be encapsulated into an action type, allowing to generate all required boilerplate code for threads, serialization, etc.

The set_event_action may be used to unconditionally trigger any LCO instances, it carries no additional parameters.

HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco, set_exception_nonvirt, set_exception_action)

The set_exception_action may be used to transfer arbitrary error information from the remote site to the LCO instance specified as a continuation. This action carries 2 parameters:

Parameters
  • std::exception_ptr: [in] The exception encapsulating the error to report to this LCO instance.

HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco, connect_nonvirt, connect_action)

The connect_action may be used to.

HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco, disconnect_nonvirt, disconnect_action)

The set_exception_action may be used to.

Public Static Functions

static components::component_type get_component_type()
static void set_component_type(components::component_type type)

Defines

HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION(...)
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_(...)
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION2(Value, RemoteValue, Name)
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_1(Value)
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_2(Value, Name)
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_3(Value, RemoteValue, Name)
HPX_REGISTER_BASE_LCO_WITH_VALUE_DECLARATION_4(Value, RemoteValue, Name, Tag)
HPX_REGISTER_BASE_LCO_WITH_VALUE(...)
HPX_REGISTER_BASE_LCO_WITH_VALUE_(...)
HPX_REGISTER_BASE_LCO_WITH_VALUE_1(Value)
HPX_REGISTER_BASE_LCO_WITH_VALUE_2(Value, Name)
HPX_REGISTER_BASE_LCO_WITH_VALUE_3(Value, RemoteValue, Name)
HPX_REGISTER_BASE_LCO_WITH_VALUE_4(Value, RemoteValue, Name, Tag)
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID(...)
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_(...)
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID2(Value, RemoteValue, Name, ActionIdGet, ActionIdSet)
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_4(Value, Name, ActionIdGet, ActionIdSet)
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_5(Value, RemoteValue, Name, ActionIdGet, ActionIdSet)
HPX_REGISTER_BASE_LCO_WITH_VALUE_ID_6(Value, RemoteValue, Name, ActionIdGet, ActionIdSet, Tag)
namespace hpx
namespace lcos
template<typename Result, typename RemoteResult, typename ComponentTag>
class base_lco_with_value : public hpx::lcos::base_lco, public ComponentTag
#include <base_lco_with_value.hpp>

The base_lco_with_value class is the common base class for all LCO’s synchronizing on a value. The RemoteResult template argument should be set to the type of the argument expected for the set_value action.

Template Parameters
  • RemoteResult: The type of the result value to be carried back to the LCO instance.

  • ComponentTag: The tag type representing the type of the component (either component_tag or managed_component_tag).

Public Types

template<>
using wrapping_type = typename detail::base_lco_wrapping_type<ComponentTag, base_lco_with_value>::type
template<>
using base_type_holder = base_lco_with_value

Public Functions

void set_value_nonvirt(RemoteResult &&result)

The function set_value_nonvirt is called whenever a set_value_action is applied on this LCO instance. This function just forwards to the virtual function set_value, which is overloaded by the derived concrete LCO.

Parameters
  • result: [in] The result value to be transferred from the remote operation back to this LCO instance.

Result get_value_nonvirt()

The function get_result_nonvirt is called whenever a get_result_action is applied on this LCO instance. This function just forwards to the virtual function get_result, which is overloaded by the derived concrete LCO.

HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco_with_value, set_value_nonvirt, set_value_action)

The set_value_action may be used to trigger any LCO instances while carrying an additional parameter of any type.

RemoteResult is taken by rvalue ref. This allows for perfect forwarding. When the action thread function is created, the values are moved into the called function. If we took it by const lvalue reference, we would disable the possibility to further move the result to the designated destination.

Parameters
  • RemoteResult: [in] The type of the result to be transferred back to this LCO instance.

HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco_with_value, get_value_nonvirt, get_value_action)

The get_value_action may be used to query the value this LCO instance exposes as its ‘result’ value.

Public Static Functions

static components::component_type get_component_type()
static void set_component_type(components::component_type type)

Protected Types

typedef std::conditional<std::is_void<Result>::value, util::unused_type, Result>::type result_type

Protected Functions

~base_lco_with_value()

Destructor, needs to be virtual to allow for clean destruction of derived objects

void set_event()
void set_event_nonvirt(std::false_type)
void set_event_nonvirt(std::true_type)
virtual void set_value(RemoteResult &&result) = 0
virtual result_type get_value() = 0
virtual result_type get_value(error_code&)
template<typename ComponentTag>
class base_lco_with_value<void, void, ComponentTag> : public hpx::lcos::base_lco, public ComponentTag
#include <base_lco_with_value.hpp>

The base_lco<void> specialization is used whenever the set_event action for a particular LCO doesn’t carry any argument.

Template Parameters
  • void: This specialization expects no result value and is almost completely equivalent to the plain base_lco.

Public Types

template<>
using wrapping_type = typename detail::base_lco_wrapping_type<ComponentTag, base_lco_with_value>::type
template<>
using base_type_holder = base_lco_with_value
template<>
using set_value_action = typename base_lco::set_event_action

Public Functions

void get_value()
HPX_DEFINE_COMPONENT_DIRECT_ACTION(base_lco_with_value, get_value, get_value_action)

Protected Functions

~base_lco_with_value()

Destructor, needs to be virtual to allow for clean destruction of derived objects

template<>
struct typed_continuation<void, util::unused_type> : public hpx::actions::continuation

Public Types

template<>
using result_type = void

Public Functions

typed_continuation()
typed_continuation(naming::id_type const &id)
typed_continuation(naming::id_type &&id)
template<typename F>
typed_continuation(naming::id_type const &id, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, F &&f)
typed_continuation(naming::id_type const &id, naming::address &&addr)
typed_continuation(naming::id_type &&id, naming::address &&addr)
template<typename F>
typed_continuation(naming::id_type const &id, naming::address &&addr, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, naming::address &&addr, F &&f)
template<typename F, typename Enable = typename std::enable_if<!std::is_same<typename std::decay<F>::type, typed_continuation>::value>::type>
typed_continuation(F &&f)
typed_continuation(typed_continuation&&)
typed_continuation &operator=(typed_continuation&&)
void trigger()
void trigger_value(util::unused_type&&)
void trigger_value(util::unused_type const&)

Private Types

template<>
using function_type = util::unique_function<void(naming::id_type)>

Private Functions

void serialize(hpx::serialization::input_archive &ar, unsigned)
void serialize(hpx::serialization::output_archive &ar, unsigned)

Private Members

function_type f_

Friends

friend hpx::serialization::access

serialization support

namespace hpx
namespace actions
class continuation

Subclassed by hpx::actions::typed_continuation< Result, Result >, hpx::actions::typed_continuation< void, util::unused_type >

Public Types

typedef void continuation_tag

Public Functions

continuation()
continuation(naming::id_type const &id)
continuation(naming::id_type &&id)
continuation(naming::id_type const &id, naming::address &&addr)
continuation(naming::id_type &&id, naming::address &&addr)
continuation(continuation &&o)
continuation &operator=(continuation &&o)
void trigger_error(std::exception_ptr const &e)
void trigger_error(std::exception_ptr &&e)
void serialize(hpx::serialization::input_archive &ar, unsigned)
void serialize(hpx::serialization::output_archive &ar, unsigned)
constexpr naming::id_type const &get_id() const
constexpr naming::address get_addr() const

Protected Attributes

naming::id_type id_
naming::address addr_
template<typename Result, typename RemoteResult>
struct typed_continuation

Public Functions

typed_continuation()
typed_continuation(naming::id_type const &id)
typed_continuation(naming::id_type &&id)
template<typename F>
typed_continuation(naming::id_type const &id, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, F &&f)
typed_continuation(naming::id_type const &id, naming::address &&addr)
typed_continuation(naming::id_type &&id, naming::address &&addr)
template<typename F>
typed_continuation(naming::id_type const &id, naming::address &&addr, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, naming::address &&addr, F &&f)
template<typename F, typename Enable = typename std::enable_if<!std::is_same<typename std::decay<F>::type, typed_continuation>::value>::type>
typed_continuation(F &&f)
typed_continuation(typed_continuation&&)
typed_continuation &operator=(typed_continuation&&)
void trigger_value(RemoteResult &&result)

Private Types

template<>
using base_type = typed_continuation<RemoteResult>
template<>
using function_type = util::unique_function<void(naming::id_type, RemoteResult)>

Private Functions

template<typename Archive>
void serialize(Archive &ar, unsigned)

Friends

friend hpx::actions::hpx::serialization::access

serialization support

template<typename Result>
struct typed_continuation<Result, Result> : public hpx::actions::continuation

Public Types

template<>
using result_type = Result

Public Functions

typed_continuation()
typed_continuation(naming::id_type const &id)
typed_continuation(naming::id_type &&id)
template<typename F>
typed_continuation(naming::id_type const &id, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, F &&f)
typed_continuation(naming::id_type const &id, naming::address &&addr)
typed_continuation(naming::id_type &&id, naming::address &&addr)
template<typename F>
typed_continuation(naming::id_type const &id, naming::address &&addr, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, naming::address &&addr, F &&f)
template<typename F, typename Enable = typename std::enable_if<!std::is_same<typename std::decay<F>::type, typed_continuation>::value>::type>
typed_continuation(F &&f)
typed_continuation(typed_continuation&&)
typed_continuation &operator=(typed_continuation&&)
void trigger_value(Result &&result)

Protected Attributes

function_type f_

Private Types

template<>
using function_type = util::unique_function<void(naming::id_type, Result)>

Private Functions

template<typename Archive>
void serialize(Archive &ar, unsigned)

Friends

friend hpx::actions::hpx::serialization::access

serialization support

template<>
struct typed_continuation<void, util::unused_type> : public hpx::actions::continuation

Public Types

template<>
using result_type = void

Public Functions

typed_continuation()
typed_continuation(naming::id_type const &id)
typed_continuation(naming::id_type &&id)
template<typename F>
typed_continuation(naming::id_type const &id, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, F &&f)
typed_continuation(naming::id_type const &id, naming::address &&addr)
typed_continuation(naming::id_type &&id, naming::address &&addr)
template<typename F>
typed_continuation(naming::id_type const &id, naming::address &&addr, F &&f)
template<typename F>
typed_continuation(naming::id_type &&id, naming::address &&addr, F &&f)
template<typename F, typename Enable = typename std::enable_if<!std::is_same<typename std::decay<F>::type, typed_continuation>::value>::type>
typed_continuation(F &&f)
typed_continuation(typed_continuation&&)
typed_continuation &operator=(typed_continuation&&)
void trigger()
void trigger_value(util::unused_type&&)
void trigger_value(util::unused_type const&)

Private Types

template<>
using function_type = util::unique_function<void(naming::id_type)>

Private Functions

void serialize(hpx::serialization::input_archive &ar, unsigned)
void serialize(hpx::serialization::output_archive &ar, unsigned)

Private Members

function_type f_

Friends

friend hpx::actions::hpx::serialization::access

serialization support

namespace hpx
namespace actions
template<typename Cont, typename F>
struct continuation2_impl

Public Functions

continuation2_impl()
template<typename Cont_, typename F_>
continuation2_impl(Cont_ &&cont, hpx::id_type const &target, F_ &&f)
virtual ~continuation2_impl()
template<typename T>
util::invoke_result<function_type, hpx::id_type, typename util::invoke_result<cont_type, hpx::id_type, T>::type>::type operator()(hpx::id_type const &lco, T &&t) const

Private Types

template<>
using cont_type = typename std::decay<Cont>::type
template<>
using function_type = typename std::decay<F>::type

Private Functions

template<typename Archive>
void serialize(Archive &ar, unsigned int const)

Private Members

cont_type cont_
hpx::id_type target_
function_type f_

Friends

friend hpx::actions::hpx::serialization::access
namespace hpx
namespace actions

Functions

template<typename Result, typename RemoteResult, typename F, typename ...Ts>
void trigger(typed_continuation<Result, RemoteResult>&&, F&&, Ts&&...)
namespace hpx
namespace actions
template<typename Cont>
struct continuation_impl

Public Functions

continuation_impl()
template<typename Cont_>
continuation_impl(Cont_ &&cont, hpx::id_type const &target)
virtual ~continuation_impl()
template<typename T>
util::invoke_result<cont_type, hpx::id_type, T>::type operator()(hpx::id_type const &lco, T &&t) const

Private Types

template<>
using cont_type = typename std::decay<Cont>::type

Private Functions

template<typename Archive>
void serialize(Archive &ar, unsigned int const)

Private Members

cont_type cont_
hpx::id_type target_

Friends

friend hpx::actions::hpx::serialization::access
namespace hpx

Functions

template<typename Action, typename T0, typename ...Ts, typename Enable = typename std::enable_if<traits::is_action<Action>::value>::type>
auto dataflow(T0 &&t0, Ts&&... ts)
template<typename Action, typename Allocator, typename T0, typename ...Ts, typename Enable = typename std::enable_if<traits::is_action<Action>::value>::type>
auto dataflow_alloc(Allocator const &alloc, T0 &&t0, Ts&&... ts)
namespace hpx

Functions

hpx::actions::set_lco_value_continuation make_continuation()
template<typename Cont>
hpx::actions::continuation_impl<typename std::decay<Cont>::type> make_continuation(Cont &&cont)
template<typename Cont>
hpx::actions::continuation_impl<typename std::decay<Cont>::type> make_continuation(Cont &&f, hpx::id_type const &target)
template<typename Cont, typename F>
std::enable_if<!std::is_same<typename std::decay<F>::type, hpx::id_type>::value, hpx::actions::continuation2_impl<typename std::decay<Cont>::type, typename std::decay<F>::type>>::type make_continuation(Cont &&cont, F &&f)
template<typename Cont, typename F>
hpx::actions::continuation2_impl<typename std::decay<Cont>::type, typename std::decay<F>::type> make_continuation(Cont &&cont, hpx::id_type const &target, F &&f)
namespace hpx
namespace lcos
template<typename Action, typename Result, bool DirectExecute>
class packaged_action
#include <packaged_action.hpp>

A packaged_action can be used by a single thread to invoke a (remote) action and wait for the result. The result is expected to be sent back to the packaged_action using the LCO’s set_event action

A packaged_action is one of the simplest synchronization primitives provided by HPX. It allows to synchronize on a eager evaluated remote operation returning a result of the type Result.

Note

The action executed using the packaged_action as a continuation must return a value of a type convertible to the type as specified by the template parameter Result.

Template Parameters
  • Action: The template parameter Action defines the action to be executed by this packaged_action instance. The arguments arg0,… argN are used as parameters for this action.

  • Result: The template parameter Result defines the type this packaged_action is expected to return from its associated future packaged_action::get_future.

  • DirectExecute: The template parameter DirectExecute is an optimization aid allowing to execute the action directly if the target is local (without spawning a new thread for this). This template does not have to be supplied explicitly as it is derived from the template parameter Action.

template<typename Action, typename Result>
class packaged_action<Action, Result, false> : public promise<Result, hpx::traits::extract_action<Action>::remote_result_type>

Subclassed by hpx::lcos::packaged_action< Action, Result, true >

Public Functions

packaged_action()
template<typename Allocator>
packaged_action(std::allocator_arg_t, Allocator const &alloc)
template<typename ...Ts>
void apply(naming::id_type const &id, Ts&&... vs)
template<typename ...Ts>
void apply(naming::address &&addr, naming::id_type const &id, Ts&&... vs)
template<typename Callback, typename ...Ts>
void apply_cb(naming::id_type const &id, Callback &&cb, Ts&&... vs)
template<typename Callback, typename ...Ts>
void apply_cb(naming::address &&addr, naming::id_type const &id, Callback &&cb, Ts&&... vs)
template<typename ...Ts>
void apply_p(naming::id_type const &id, threads::thread_priority priority, Ts&&... vs)
template<typename ...Ts>
void apply_p(naming::address &&addr, naming::id_type const &id, threads::thread_priority priority, Ts&&... vs)
template<typename Callback, typename ...Ts>
void apply_p_cb(naming::id_type const &id, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Callback, typename ...Ts>
void apply_p_cb(naming::address &&addr, naming::id_type const &id, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename ...Ts>
void apply_deferred(naming::address &&addr, naming::id_type const &id, Ts&&... vs)
template<typename Callback, typename ...Ts>
void apply_deferred_cb(naming::address &&addr, naming::id_type const &id, Callback &&cb, Ts&&... vs)

Protected Types

template<>
using action_type = typename hpx::traits::extract_action<Action>::type
template<>
using remote_result_type = typename action_type::remote_result_type
template<>
using base_type = promise<Result, remote_result_type>

Protected Functions

template<typename ...Ts>
void do_apply(naming::address &&addr, naming::id_type const &id, threads::thread_priority priority, Ts&&... vs)
template<typename ...Ts>
void do_apply(naming::id_type const &id, threads::thread_priority priority, Ts&&... vs)
template<typename Callback, typename ...Ts>
void do_apply_cb(naming::address &&addr, naming::id_type const &id, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Callback, typename ...Ts>
void do_apply_cb(naming::id_type const &id, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename Result>
class packaged_action<Action, Result, true> : public hpx::lcos::packaged_action<Action, Result, false>

Public Functions

packaged_action()

Construct a (non-functional) instance of an packaged_action. To use this instance its member function apply needs to be directly called.

template<typename Allocator>
packaged_action(std::allocator_arg_t, Allocator const &alloc)
template<typename ...Ts>
void apply(naming::id_type const &id, Ts&&... vs)
template<typename ...Ts>
void apply(naming::address &&addr, naming::id_type const &id, Ts&&... vs)
template<typename Callback, typename ...Ts>
void apply_cb(naming::id_type const &id, Callback &&cb, Ts&&... vs)
template<typename Callback, typename ...Ts>
void apply_cb(naming::address &&addr, naming::id_type const &id, Callback &&cb, Ts&&... vs)

Private Types

template<>
using action_type = typename packaged_action::action_type
namespace hpx
namespace actions
struct set_lco_value_continuation

Public Functions

template<typename T>
T operator()(naming::id_type const &lco, T &&t) const
struct set_lco_value_unmanaged_continuation

Public Functions

template<typename T>
T operator()(naming::id_type const &lco, T &&t) const
namespace hpx

Functions

template<typename Action, typename F, typename ...Ts>
auto sync(F &&f, Ts&&... ts)
namespace hpx
namespace actions

Functions

template<typename Result, typename RemoteResult, typename F, typename ...Ts>
void trigger(typed_continuation<Result, RemoteResult> &&cont, F &&f, Ts&&... vs)
template<typename Result, typename F, typename ...Ts>
void trigger(typed_continuation<Result, util::unused_type> &&cont, F &&f, Ts&&... vs)
namespace hpx

Functions

void trigger_lco_event(naming::id_type const &id, naming::address &&addr, bool move_credits = true)

Trigger the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should be triggered.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void trigger_lco_event(naming::id_type const &id, bool move_credits = true)

Trigger the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should be triggered.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void trigger_lco_event(naming::id_type const &id, naming::address &&addr, naming::id_type const &cont, bool move_credits = true)

Trigger the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should be triggered.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void trigger_lco_event(naming::id_type const &id, naming::id_type const &cont, bool move_credits = true)

Trigger the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should be triggered.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

template<typename Result>
void set_lco_value(naming::id_type const &id, naming::address &&addr, Result &&t, bool move_credits = true)

Set the result value for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the given value.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • t: [in] This is the value which should be sent to the LCO.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

template<typename Result>
std::enable_if<!std::is_same<typename std::decay<Result>::type, naming::address>::value>::type set_lco_value(naming::id_type const &id, Result &&t, bool move_credits = true)

Set the result value for the (managed) LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the given value.

  • t: [in] This is the value which should be sent to the LCO.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

template<typename Result>
std::enable_if<!std::is_same<typename std::decay<Result>::type, naming::address>::value>::type set_lco_value_unmanaged(naming::id_type const &id, Result &&t, bool move_credits = true)

Set the result value for the (unmanaged) LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the given value.

  • t: [in] This is the value which should be sent to the LCO.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

template<typename Result>
void set_lco_value(naming::id_type const &id, naming::address &&addr, Result &&t, naming::id_type const &cont, bool move_credits = true)

Set the result value for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the given value.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • t: [in] This is the value which should be sent to the LCO.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

template<typename Result>
std::enable_if<!std::is_same<typename std::decay<Result>::type, naming::address>::value>::type set_lco_value(naming::id_type const &id, Result &&t, naming::id_type const &cont, bool move_credits = true)

Set the result value for the (managed) LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the given value.

  • t: [in] This is the value which should be sent to the LCO.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

template<typename Result>
std::enable_if<!std::is_same<typename std::decay<Result>::type, naming::address>::value>::type set_lco_value_unmanaged(naming::id_type const &id, Result &&t, naming::id_type const &cont, bool move_credits = true)

Set the result value for the (unmanaged) LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the given value.

  • t: [in] This is the value which should be sent to the LCO.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, naming::address &&addr, std::exception_ptr const &e, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • e: [in] This is the error value which should be sent to the LCO.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, naming::address &&addr, std::exception_ptr &&e, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • e: [in] This is the error value which should be sent to the LCO.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, std::exception_ptr const &e, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • e: [in] This is the error value which should be sent to the LCO.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, std::exception_ptr &&e, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • e: [in] This is the error value which should be sent to the LCO.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, naming::address &&addr, std::exception_ptr const &e, naming::id_type const &cont, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • e: [in] This is the error value which should be sent to the LCO.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, naming::address &&addr, std::exception_ptr &&e, naming::id_type const &cont, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • addr: [in] This represents the addr of the LCO which should be triggered.

  • e: [in] This is the error value which should be sent to the LCO.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, std::exception_ptr const &e, naming::id_type const &cont, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • e: [in] This is the error value which should be sent to the LCO.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

void set_lco_error(naming::id_type const &id, std::exception_ptr &&e, naming::id_type const &cont, bool move_credits = true)

Set the error state for the LCO referenced by the given id.

Parameters
  • id: [in] This represents the id of the LCO which should receive the error value.

  • e: [in] This is the error value which should be sent to the LCO.

  • cont: [in] This represents the LCO to trigger after completion.

  • move_credits: [in] If this is set to true then it is ok to send all credits in id along with the generated message. The default value is true.

namespace hpx

Functions

template<typename Action, typename ...Ts>
bool apply_p(naming::id_type const &id, threads::thread_priority priority, Ts&&... vs)
template<typename Action, typename Client, typename Stub, typename ...Ts>
bool apply_p(components::client_base<Client, Stub> const &c, threads::thread_priority priority, Ts&&... vs)
template<typename Action, typename DistPolicy, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_p(DistPolicy const &policy, threads::thread_priority priority, Ts&&... vs)
template<typename Action, typename ...Ts>
bool apply(naming::id_type const &id, Ts&&... vs)
template<typename Action, typename Client, typename Stub, typename ...Ts>
bool apply(components::client_base<Client, Stub> const &c, Ts&&... vs)
template<typename Action, typename DistPolicy, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, bool>::type apply(DistPolicy const &policy, Ts&&... vs)
template<typename Action, typename Continuation, typename ...Ts>
std::enable_if<traits::is_continuation<Continuation>::value, bool>::type apply_p(Continuation &&c, naming::id_type const &gid, threads::thread_priority priority, Ts&&... vs)
template<typename Action, typename Continuation, typename Client, typename Stub, typename ...Ts>
std::enable_if<traits::is_continuation<Continuation>::value, bool>::type apply_p(Continuation &&cont, components::client_base<Client, Stub> const &c, threads::thread_priority priority, Ts&&... vs)
template<typename Action, typename Continuation, typename DistPolicy, typename ...Ts>
std::enable_if<traits::is_continuation<Continuation>::value && traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_p(Continuation &&c, DistPolicy const &policy, threads::thread_priority priority, Ts&&... vs)
template<typename Action, typename Continuation, typename ...Ts>
std::enable_if<traits::is_continuation<Continuation>::value, bool>::type apply(Continuation &&c, naming::id_type const &gid, Ts&&... vs)
template<typename Action, typename Continuation, typename Client, typename Stub, typename ...Ts>
std::enable_if<traits::is_continuation<Continuation>::value, bool>::type apply(Continuation &&cont, components::client_base<Client, Stub> const &c, Ts&&... vs)
template<typename Action, typename Continuation, typename DistPolicy, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value && traits::is_continuation<Continuation>::value, bool>::type apply(Continuation &&c, DistPolicy const &policy, Ts&&... vs)
template<typename Action, typename ...Ts>
bool apply_c_p(naming::id_type const &contgid, naming::id_type const &gid, threads::thread_priority priority, Ts&&... vs)
template<typename Action, typename ...Ts>
bool apply_c(naming::id_type const &contgid, naming::id_type const &gid, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename ...Ts>
bool apply_c(hpx::actions::basic_action<Component, Signature, Derived>, naming::id_type const &contgid, naming::id_type const &gid, Ts&&... vs)
namespace hpx

Functions

template<typename Action, typename Callback, typename ...Ts>
bool apply_p_cb(naming::id_type const &gid, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename Callback, typename ...Ts>
bool apply_cb(naming::id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Callback, typename ...Ts>
bool apply_cb(hpx::actions::basic_action<Component, Signature, Derived>, naming::id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Action, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_p_cb(DistPolicy const &policy, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_cb(DistPolicy const &policy, Callback &&cb, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_cb(hpx::actions::basic_action<Component, Signature, Derived>, DistPolicy const &policy, Callback &&cb, Ts&&... vs)
template<typename Action, typename Continuation, typename Callback, typename ...Ts>
bool apply_p_cb(Continuation &&c, naming::address &&addr, naming::id_type const &gid, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename Continuation, typename Callback, typename ...Ts>
bool apply_p_cb(Continuation &&c, naming::id_type const &gid, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename Continuation, typename Callback, typename ...Ts>
bool apply_cb(Continuation &&c, naming::id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Component, typename Continuation, typename Signature, typename Derived, typename Callback, typename ...Ts>
bool apply_cb(Continuation &&c, hpx::actions::basic_action<Component, Signature, Derived>, naming::id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Action, typename Continuation, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_continuation<Continuation>::value && traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_p_cb(Continuation &&c, DistPolicy const &policy, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename Continuation, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_continuation<Continuation>::value && traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_cb(Continuation &&c, DistPolicy const &policy, Callback &&cb, Ts&&... vs)
template<typename Component, typename Continuation, typename Signature, typename Derived, typename DistPolicy, typename Callback, typename ...Ts>
std::enable_if<traits::is_distribution_policy<DistPolicy>::value, bool>::type apply_cb(Continuation &&c, hpx::actions::basic_action<Component, Signature, Derived>, DistPolicy const &policy, Callback &&cb, Ts&&... vs)
template<typename Action, typename Callback, typename ...Ts>
bool apply_c_p_cb(naming::id_type const &contgid, naming::id_type const &gid, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename Callback, typename ...Ts>
bool apply_c_cb(naming::id_type const &contgid, naming::id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Action, typename Callback, typename ...Ts>
bool apply_c_p_cb(naming::id_type const &contgid, naming::address &&addr, naming::id_type const &gid, threads::thread_priority priority, Callback &&cb, Ts&&... vs)
template<typename Action, typename Callback, typename ...Ts>
bool apply_c_cb(naming::id_type const &contgid, naming::address &&addr, naming::id_type const &gid, Callback &&cb, Ts&&... vs)
namespace functional

Functions

template<typename Action, typename Callback, typename ...Ts>
apply_c_p_cb_impl<Action, typename std::decay<Callback>::type, typename std::decay<Ts>::type...> apply_c_p_cb(naming::id_type const &contid, naming::address &&addr, naming::id_type const &id, threads::thread_priority p, Callback &&cb, Ts&&... vs)
template<typename Action, typename Callback, typename ...Ts>
struct apply_c_p_cb_impl

Public Types

typedef hpx::tuple<Ts...> tuple_type

Public Functions

template<typename ...Ts_>
apply_c_p_cb_impl(naming::id_type const &contid, naming::address &&addr, naming::id_type const &id, threads::thread_priority p, Callback &&cb, Ts_&&... vs)
apply_c_p_cb_impl(apply_c_p_cb_impl &&rhs)
apply_c_p_cb_impl &operator=(apply_c_p_cb_impl &&rhs)
void operator()()

Protected Functions

template<std::size_t... Is>
void apply_action(util::index_pack<Is...>)

Private Members

naming::id_type contid_
naming::address addr_
naming::id_type id_
threads::thread_priority p_
Callback cb_
tuple_type args_
namespace hpx

Functions

template<typename Action, typename Cont, typename ...Ts>
bool apply_continue(Cont &&cont, id_type const &gid, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Cont, typename ...Ts>
bool apply_continue(hpx::actions::basic_action<Component, Signature, Derived>, Cont &&cont, id_type const &gid, Ts&&... vs)
template<typename Action, typename ...Ts>
bool apply_continue(id_type const &cont, id_type const &gid, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename ...Ts>
bool apply_continue(hpx::actions::basic_action<Component, Signature, Derived>, id_type const &cont, id_type const &gid, Ts&&... vs)
namespace hpx

Functions

template<typename Action, typename Cont, typename Callback, typename ...Ts>
bool apply_continue_cb(Cont &&cont, id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Cont, typename Callback, typename ...Ts>
bool apply_continue_cb(hpx::actions::basic_action<Component, Signature, Derived>, Cont &&cont, id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Action, typename Callback, typename ...Ts>
bool apply_continue_cb(id_type const &cont, id_type const &gid, Callback &&cb, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Callback, typename ...Ts>
bool apply_continue_cb(hpx::actions::basic_action<Component, Signature, Derived>, id_type const &cont, id_type const &gid, Callback &&cb, Ts&&... vs)
namespace hpx

Functions

template<typename Action, typename Cont, typename ...Ts>
bool apply_continue(Cont &&cont, naming::id_type const &gid, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename Cont, typename ...Ts>
bool apply_continue(hpx::actions::basic_action<Component, Signature, Derived>, Cont &&cont, naming::id_type const &gid, Ts&&... vs)
template<typename Action, typename ...Ts>
bool apply_continue(naming::id_type const &cont, naming::id_type const &gid, Ts&&... vs)
template<typename Component, typename Signature, typename Derived, typename ...Ts>
bool apply_continue(hpx::actions::basic_action<Component, Signature, Derived>, naming::id_type const &cont, naming::id_type const &gid, Ts&&... vs)
namespace hpx
namespace applier

Functions

template<typename Arg0>
void trigger(naming::id_type const &k, Arg0 &&arg0)
void trigger(naming::id_type const &k)
void trigger_error(naming::id_type const &k, std::exception_ptr const &e)
void trigger_error(naming::id_type const &k, std::exception_ptr &&e)
template<typename Result, typename RemoteResult>
struct action_trigger_continuation<actions::typed_continuation<Result, RemoteResult>>

Public Static Functions

template<typename F, typename ...Ts>
static void call(actions::typed_continuation<Result, RemoteResult> &&cont, F &&f, Ts&&... ts)
namespace hpx
namespace traits
template<typename Result, typename RemoteResult>
struct action_trigger_continuation<actions::typed_continuation<Result, RemoteResult>>

Public Static Functions

template<typename F, typename ...Ts>
static void call(actions::typed_continuation<Result, RemoteResult> &&cont, F &&f, Ts&&... ts)