HPX - High Performance ParalleX

PrevUpHomeNext

Function template inverse_fold

hpx::lcos::inverse_fold — Perform a distributed inverse folding operation.

Synopsis

// In header: <hpx/lcos/fold.hpp>


template<typename Action, typename FoldOp, typename Init, typename ArgN, ... > 
  hpx::future< decltype(Action(hpx::id_type, ArgN,...))> 
  inverse_fold(std::vector< hpx::id_type > const & ids, FoldOp && fold_op, 
               Init && init, ArgN argN, ...);

Description

The function hpx::lcos::inverse_fold performs an inverse distributed folding operation over results returned from action invocations on a given set of global identifiers. The action can be either a plain action (in which case the global identifiers have to refer to localities) or a component action (in which case the global identifiers have to refer to instances of a component type which exposes the action.

[Note] Note

The type of the initial value must be convertible to the result type returned from the invoked action.

Parameters:

argN

[in] Any number of arbitrary arguments (passed by value, by const reference or by rvalue reference) which will be forwarded to the action invocation.

fold_op

[in] A binary function expecting two results as returned from the action invocations. The function (or function object) is expected to return the result of the folding operation performed on its arguments.

ids

[in] A list of global identifiers identifying the target objects for which the given action will be invoked.

init

[in] The initial value to be used for the folding operation

Returns:

This function returns a future representing the result of the overall folding operation.


PrevUpHomeNext