STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
Classes | Typedefs | Functions | Variables
ARMI Requests Building Blocks

Support functions and class for Adaptive Remote Method Invocation (ARMI). More...

+ Collaboration diagram for ARMI Requests Building Blocks:

Classes

class  stapl::runtime::aggregator
 Aggregator for point-to-point requests. More...
 
class  stapl::runtime::bcast_aggregator
 Aggregator for ordered and unordered broadcast requests. More...
 
class  stapl::runtime::rpc_aggregator
 Aggregator for RPC requests to a process or a range of processes. More...
 
class  stapl::runtime::location_rpc_aggregator
 Aggregator for RPC requests to a single location. More...
 
class  stapl::runtime::all_locations_rpc_aggregator
 Aggregator for RPC requests to all locations of a gang. More...
 
class  stapl::runtime::managed_locations_rpc_aggregator
 Aggregator for RPC requests to all locations in shared memory. More...
 
class  stapl::runtime::response_aggregator
 Aggregator for responses to requests. More...
 
class  stapl::runtime::async_result< T, IsBasic >
 Storage for a result that can be asynchronously assigned and retrieved. More...
 
class  stapl::runtime::async_results< T >
 Storage for an array of results that can be asynchronously assigned and retrieved. More...
 
class  stapl::runtime::continuation_request< Function, Future >
 Calls function f with a Future created with t.... More...
 
class  stapl::runtime::future_base< T >
 Provides a common base for an asynchronously returned object. More...
 
class  stapl::runtime::futures_base< T >
 Provides a common base for asynchronously returned arrays of objects. More...
 
class  stapl::runtime::ready_future< T >
 future_base implementation for ready values. More...
 
class  stapl::runtime::ready_futures< T >
 futures_base implementation for ready values. More...
 
struct  stapl::runtime::message_delete
 Deleter for message objects. More...
 
class  stapl::runtime::message
 Communication buffer. More...
 
class  stapl::runtime::message_shared_ptr
 Intrusive message shared pointer. More...
 
class  stapl::runtime::message_slist
 Intrusive message list. More...
 
class  stapl::runtime::managed_locations_info
 Container that associates parent gang to child gang location ids only for locally managed locations. More...
 
class  stapl::runtime::single_location_construct_request< Callback, Function >
 Request to construct an object in a new single location gang. More...
 
class  stapl::runtime::all_locs_construct_request< Callback, Function, LocallyManagedOnly >
 Request to construct an object on all locally managed locations. More...
 
class  stapl::runtime::construct_request< Callback, Function, LocationMapping >
 Request to construct an object in a new gang over specific locations of an existing gang. More...
 
class  stapl::runtime::call_promise_set_value
 Calls promise<rmi_handle::reference>::set_value() from location 0. More...
 
struct  stapl::runtime::create_object< T >
 Calls the constructor of T with Args. More...
 
struct  stapl::runtime::external_caller< R >
 Function object that calls a function passed from external_call(). More...
 
class  stapl::runtime::delete_object_request< T, Deleter >
 Request to delete a distributed object. More...
 
class  stapl::runtime::response< Handle >
 Function object to assign an object to a known address. More...
 
class  stapl::runtime::indexed_response< Handle >
 Function object to assign an object to a known address that expects multiple objects. More...
 
class  stapl::runtime::handle_response< ObjectHandle, Handle >
 Function object to assign an object to a distributed object via the Handle::set_value() function. More...
 
class  stapl::runtime::indexed_handle_response< ObjectHandle, Handle >
 Function object to assign an object to a distributed object that accepts multiple objects via the Handle::set_value() function. More...
 
class  stapl::runtime::active_handle_response< ObjectHandle, Handle >
 Function object to call the function operator of a distributed object with the given value. More...
 
class  stapl::runtime::restore_request< ObjectHandle, MemFun, T >
 Request for restoring an SPMD section. More...
 
class  stapl::runtime::async_rpc_request< FunPtr, T >
 Remote Procedure Call (RPC) request that discards return values. More...
 
class  stapl::runtime::arg_storage< T >
 Storage for an object of type T that is retrieved by lvalue reference. More...
 
struct  stapl::runtime::make_arg_storage< T, R, typename >
 Argument storage type creation metafunction. More...
 
class  stapl::runtime::non_const_arg_storage< T >
 Storage for a non-const, non-basic, non-distributed object that is retrieved by non-const lvalue reference to non-basic object. More...
 
class  stapl::runtime::p_object_ref_storage< T >
 Storage for an lvalue reference to a distributed object. More...
 
class  stapl::runtime::non_const_ptr_storage< T >
 Storage for a pointer to non-const, non-basic, non-distributed object that is retrieved by pointer to a non-const, non-basic object. More...
 
class  stapl::runtime::rval_storage< T >
 Storage for an object that is retrieved by rvalue reference. More...
 
class  stapl::runtime::moved_object_storage< T >
 Storage for an object that is moved and retrieved either by copy or by rvalue reference. More...
 
class  stapl::runtime::moved_cref_storage< T >
 Storage for a moved object that is retrieved by const reference. More...
 
class  stapl::runtime::moved_ref_storage< T >
 Storage for a moved object that is retrieved by reference. More...
 
class  stapl::runtime::copied_arg_storage< T >
 Storage for a moved object that is retrieved by copy or by const reference. More...
 
class  stapl::runtime::copied_ref_storage< T >
 Storage for a moved object that is retrieved by non-const reference. More...
 
struct  stapl::runtime::make_arguments< F, T... >
 Metafuction for creating a tuple of arg_storage_t to store the objects in list T. More...
 
class  stapl::runtime::nc_async_rmi_request< ObjectHandle, MemFun, T >
 RMI request that discards the return value. More...
 
class  stapl::runtime::async_rmi_request< ObjectHandle, MemFun, T >
 RMI request that discards the return value and supports combining. More...
 
class  stapl::runtime::header
 Provides the enum and the different headers for communication. More...
 
class  stapl::runtime::location_rpc_request
 Encapsulates an RPC request directed to a location for subsequent execution via the function operator. More...
 
struct  stapl::runtime::packed_value< T >
 Handles unpacking objects stored in an arg_storage. More...
 
class  stapl::runtime::rmi_delegate
 Delegate for an RMI request. More...
 
class  stapl::runtime::rmi_request
 Encapsulates an RMI request for subsequent execution via the function operator. More...
 
class  stapl::runtime::combined_request_size
 Information about the size of combined requests. More...
 
class  stapl::runtime::combinable_rmi_request< EmptyArgs >
 Encapsulates an RMI request that supports combining for subsequent execution via the function operator. More...
 
class  stapl::runtime::rpc_request
 Encapsulates an RPC request directed to a process for subsequent execution via the function operator. More...
 
class  stapl::runtime::sync_rmi_request< ReturnCallback, ObjectHandle, MemFun, T >
 RMI request that calls the given callback with the return value of the function. More...
 
class  stapl::runtime::executor_rmi_request< Function, RetFunction >
 Request for executing the given function on the destination location. More...
 
class  stapl::runtime::reduce_rmi_handle< T, BinaryOperation >
 Handle to wait for values from reduce_rmi(). More...
 
class  stapl::runtime::try_rmi_request< MemFun, T >
 RMI request that will not execute if the distributed object has been destroyed and that discards the return value. More...
 
class  stapl::runtime::packed_handle
 Packs rmi_handle::reference and rmi_handle::const_reference for use in requests. More...
 
class  stapl::runtime::packed_handle_epoch
 Packs rmi_handle::reference and rmi_handle::const_reference and the epoch for use in requests. More...
 
struct  stapl::runtime::is_appropriate_handle< Handle, PMF >
 Returns std::true_type if Handle can be used to call PMF, otherwise std::false_type. More...
 
struct  stapl::runtime::no_implicit_flush_t
 Tag type to mark that a flush is not implicit. More...
 
class  stapl::runtime::value_handle< R >
 Handle for receiving one result. More...
 
class  stapl::runtime::values_handle< R >
 Handle for receiving multiple results. More...
 

Typedefs

using stapl::runtime::message_ptr = std::unique_ptr< message, message_delete >
 message unique pointer. More...
 
using stapl::runtime::message_hook_type = boost::intrusive::member_hook< message, message::slist_hook_type, &message::slist_hook >
 Intrusive message list hook. More...
 
using stapl::runtime::message_raw_ptr_slist = typename boost::intrusive::make_slist< message, message_hook_type, boost::intrusive::cache_last< true >, boost::intrusive::constant_time_size< false > >::type
 Intrusive message list for message pointers. More...
 
template<typename T , typename R >
using stapl::runtime::arg_storage_t = typename make_arg_storage< T, R >::type
 Argument storage type. More...
 
template<typename F , typename... T>
using stapl::runtime::arguments_t = typename make_arguments< F, T... >::type
 A tuple of arg_storage_t to store the objects in list T.
 
template<typename T , typename BinaryOperation >
using stapl::runtime::binary_operation_result_t = decltype(std::declval< BinaryOperation >()(std::declval< T >(), std::declval< T >()))
 Returns the result of binary operation BinaryOperation when passed T.
 
using stapl::runtime::packed_handle_type = packed_handle_epoch
 Default handle type for requests.
 

Functions

template<typename Handle >
context::epoch_type stapl::runtime::find_target_epoch (context const &ctx, Handle const &h) noexcept
 Returns the epoch that a request from context ctx on handle h should execute in. More...
 
template<typename Handle >
gang_mdstapl::runtime::find_target_gang_md (context &ctx, Handle const &h) noexcept
 Returns if possible the gang metadata associated with h, otherwise nullptr. More...
 
message_ptr stapl::runtime::make_message_ptr (message *const m)
 Returns a message_ptr from m. More...
 
template<typename Callback , typename Function >
void stapl::runtime::construct_all_impl (Callback &&c, gang_md &g, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Creates a distributed object through f on all locations of gang g. More...
 
template<typename ProcessRange , typename Callback , typename Function >
void stapl::runtime::call_construct_all_impl (ProcessRange &&pids, Callback &&c, const gang_md::id gid, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Calls construct_all_impl() on processes pids. More...
 
template<typename Callback , typename T , typename Function >
void stapl::runtime::construct_range_impl (Callback &&c, gang_md &g, location_range_wrapper< T > const &r, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Creates a distributed object through f on the subset locs of the locations of the gang associated with g. More...
 
template<typename ProcessRange , typename Callback , typename T , typename Function >
void stapl::runtime::call_construct_range_impl (ProcessRange &&pids, Callback &&c, const gang_md::id gid, location_range_wrapper< T > const &r, const context::epoch_type e, const gang_md::id new_gid, Function &&f)
 Calls construct_range_impl() on processes pids. More...
 
template<typename Callback , typename T , typename Function >
void stapl::runtime::fwd_construct_range_impl (Callback &&c, gang_md &g, location_range_wrapper< T > const &r, const context::epoch_type e, Function &&f)
 Target for forwarding the request to construct_range_impl(). More...
 
template<typename T , typename... Args>
auto stapl::runtime::call_constructor (Args &&... args) -> decltype(std::bind(create_object< T >
 Creates a function object used to construct an instance T with args.
 
template<typename Callback , typename Function >
void stapl::runtime::construct_single (Callback &&c, gang_md::id gid, gang_md *g, const location_md::id lid, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new single location gang over location lid of gang g. More...
 
template<typename Callback , typename Function >
void stapl::runtime::construct_neighbors (Callback &&c, gang_md &g, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new gang over all the locations of the gang associated with ctx that are on shared memory. More...
 
template<typename Callback , typename Function >
void stapl::runtime::construct_all (Callback &&c, const gang_md::id gid, gang_md *g, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new gang over all locations of the gang of h. More...
 
template<typename Callback , typename T , typename Function >
void stapl::runtime::construct_range (Callback &&c, gang_md::id gid, gang_md *g, location_range_wrapper< T > const &r, const context::epoch_type e, Function &&f)
 Creates a distributed object through f in a new gang over the range r of the locations of the gang associated with g. More...
 
template<typename F , typename Range , typename... T>
void stapl::runtime::rpc (F &&f, Range &&pids, T &&... t)
 Remote Procedure Call (RPC) to process primitive. More...
 
template<typename Tuple , std::size_t... I, typename... T>
std::size_t stapl::runtime::dynamic_size (index_sequence< I... >, T &&... t) noexcept
 Returns the dynamic size required for storing the objects t... in a arguments_t.
 
template<typename F , typename Tuple , std::size_t... I>
auto stapl::runtime::invoke (F &&f, Tuple &args, void *const base, index_sequence< I... >) -> decltype(std::forward< F >(f)(std::get< I >(args).get(base)...))
 Calls f with the stored objects in args passed as arguments. More...
 
template<typename MemFun , typename Base , typename Tuple , std::size_t... I>
auto stapl::runtime::invoke (MemFun const &pmf, Base &ref, Tuple &args, void *const base, index_sequence< I... >) -> decltype((ref.*pmf)(std::get< I >(args).get(base)...))
 Calls the member function pmf on ref with the stored objects in args passed as arguments. More...
 
template<typename MemFun , typename Base , typename Tuple , std::size_t... I>
auto stapl::runtime::invoke (MemFun const &pmf, Base &ref, Tuple &args, void *const base, std::size_t &size, index_sequence< I... >) -> decltype((ref.*pmf)(std::get< I >(args).get(base, size)...))
 Calls the member function pmf on ref with the stored objects in args passed as arguments. More...
 
template<typename Tuple , std::size_t... I>
void stapl::runtime::cleanup (Tuple &, index_sequence< I... >)
 Releases any resources associated with the stored objects if invoke() was not called. More...
 
void stapl::runtime::rmi_fence (context &)
 Ensures that all outstanding RMI requests have been completed. More...
 
void stapl::runtime::rmi_fence (context &, std::function< bool(void)> f)
 Ensures that all outstanding RMI requests have been completed and the return value of f is true. More...
 
void stapl::runtime::scheduling_point (context &)
 Yields the location to execute some requests.
 
template<typename Predicate >
bool stapl::runtime::yield_until (context &ctx, Predicate &&pred)
 Yields until pred returns true. More...
 
template<typename Predicate >
bool stapl::runtime::yield_until (const no_context_t, Predicate &&pred)
 Yields until pred returns true. More...
 
template<typename Predicate >
bool stapl::runtime::yield_until (Predicate &&pred)
 Yields until pred returns true. More...
 
template<typename Predicate >
bool stapl::runtime::yield_if_not (context &ctx, Predicate &&pred)
 Yields if pred does not return true. More...
 
template<typename Predicate >
bool stapl::runtime::yield_if_not (const no_context_t, Predicate &&pred)
 Yields if pred does not return true. More...
 
template<typename Predicate >
bool stapl::runtime::yield_if_not (Predicate &&pred)
 Yields if pred does not return true. More...
 
template<typename Function >
void stapl::runtime::rmi_fence_impl (context &ctx, Function &&f)
 RMI fence implementation. More...
 

Variables

constexpr no_implicit_flush_t stapl::runtime::no_implicit_flush = { }
 Tag to mark that a flush is not implicit.
 

Detailed Description

Support functions and class for Adaptive Remote Method Invocation (ARMI).

Typedef Documentation

◆ message_ptr

using stapl::runtime::message_ptr = typedef std::unique_ptr<message, message_delete>

message unique pointer.

See also
message

◆ message_hook_type

using stapl::runtime::message_hook_type = typedef boost::intrusive::member_hook< message, message::slist_hook_type, &message::slist_hook>

Intrusive message list hook.

See also
message, message_slist

◆ message_raw_ptr_slist

using stapl::runtime::message_raw_ptr_slist = typedef typename boost::intrusive::make_slist< message, message_hook_type, boost::intrusive::cache_last<true>, boost::intrusive::constant_time_size<false> >::type

Intrusive message list for message pointers.

See also
message, message_slist_hook

◆ arg_storage_t

template<typename T , typename R >
using stapl::runtime::arg_storage_t = typedef typename make_arg_storage<T, R>::type

Argument storage type.

Template Parameters
TStored object type.
RObject retrieval type.

This class provides a storage type that is suitable for storing an object of type T when retrieved as R.

Function Documentation

◆ find_target_epoch()

template<typename Handle >
context::epoch_type stapl::runtime::find_target_epoch ( context const &  ctx,
Handle const &  h 
)
noexcept

Returns the epoch that a request from context ctx on handle h should execute in.

Parameters
ctxCurrent context.
hDestination object handle.

◆ find_target_gang_md()

template<typename Handle >
gang_md* stapl::runtime::find_target_gang_md ( context ctx,
Handle const &  h 
)
noexcept

Returns if possible the gang metadata associated with h, otherwise nullptr.

Parameters
ctxCurrent context.
hDestination object handle.

◆ make_message_ptr()

message_ptr stapl::runtime::make_message_ptr ( message *const  m)

Returns a message_ptr from m.

Warning
This function checks the reference count and creates a clone of m if it is not 1. This may cause performance degradation if

◆ construct_all_impl()

template<typename Callback , typename Function >
void stapl::runtime::construct_all_impl ( Callback &&  c,
gang_md g,
const context::epoch_type  e,
const gang_md::id  new_gid,
Function &&  f 
)

Creates a distributed object through f on all locations of gang g.

Parameters
cCallback to pass a pointer to the constructed object.
gDestination gang metadata.
eCaller epoch.
new_gidNew gang id; if invalid_gang_id, then a new id will be generated.
fObject creation function.

◆ call_construct_all_impl()

template<typename ProcessRange , typename Callback , typename Function >
void stapl::runtime::call_construct_all_impl ( ProcessRange &&  pids,
Callback &&  c,
const gang_md::id  gid,
const context::epoch_type  e,
const gang_md::id  new_gid,
Function &&  f 
)

Calls construct_all_impl() on processes pids.

Parameters
pidsDestination processes.
cCallback to pass a pointer to the constructed object.
gidDestination gang id.
eCaller epoch.
new_gidNew gang id.
fObject creation function.

◆ construct_range_impl()

template<typename Callback , typename T , typename Function >
void stapl::runtime::construct_range_impl ( Callback &&  c,
gang_md g,
location_range_wrapper< T > const &  r,
const context::epoch_type  e,
const gang_md::id  new_gid,
Function &&  f 
)

Creates a distributed object through f on the subset locs of the locations of the gang associated with g.

Parameters
cCallback to pass a pointer to the constructed object.
gDestination gang metadata.
rDestination locations of g.
eCaller epoch.
new_gidNew gang id; if invalid_gang_id, then a new id will be generated.
fObject creation function.

◆ call_construct_range_impl()

template<typename ProcessRange , typename Callback , typename T , typename Function >
void stapl::runtime::call_construct_range_impl ( ProcessRange &&  pids,
Callback &&  c,
const gang_md::id  gid,
location_range_wrapper< T > const &  r,
const context::epoch_type  e,
const gang_md::id  new_gid,
Function &&  f 
)

Calls construct_range_impl() on processes pids.

Parameters
pidsDestination processes.
cCallback to pass a pointer to the constructed object.
gidDestination gang id.
rDestination locations of g.
eCaller epoch.
new_gidNew gang id.
fObject creation function.

◆ fwd_construct_range_impl()

template<typename Callback , typename T , typename Function >
void stapl::runtime::fwd_construct_range_impl ( Callback &&  c,
gang_md g,
location_range_wrapper< T > const &  r,
const context::epoch_type  e,
Function &&  f 
)

Target for forwarding the request to construct_range_impl().

Parameters
cCallback to pass a pointer to the constructed object.
gDestination gang metadata.
rDestination locations of g.
eCaller epoch.
fObject creation function.

◆ construct_single()

template<typename Callback , typename Function >
void stapl::runtime::construct_single ( Callback &&  c,
gang_md::id  gid,
gang_md g,
const location_md::id  lid,
const context::epoch_type  e,
Function &&  f 
)

Creates a distributed object through f in a new single location gang over location lid of gang g.

Parameters
cCallback to pass a pointer to the constructed object.
gidDestination gang id.
gDestination gang metadata.
lidDestination location id.
eCaller epoch.
fObject creation function.

◆ construct_neighbors()

template<typename Callback , typename Function >
void stapl::runtime::construct_neighbors ( Callback &&  c,
gang_md g,
const context::epoch_type  e,
Function &&  f 
)

Creates a distributed object through f in a new gang over all the locations of the gang associated with ctx that are on shared memory.

Parameters
cCallback to pass a pointer to the constructed object.
gDestination gang metadata.
eCaller epoch.
fObject creation function.

◆ construct_all()

template<typename Callback , typename Function >
void stapl::runtime::construct_all ( Callback &&  c,
const gang_md::id  gid,
gang_md g,
const context::epoch_type  e,
Function &&  f 
)

Creates a distributed object through f in a new gang over all locations of the gang of h.

Parameters
cCallback to pass a pointer to the constructed object.
gidDestination gang id.
gDestination gang metadata.
eCaller epoch.
fObject creation function.

◆ construct_range()

template<typename Callback , typename T , typename Function >
void stapl::runtime::construct_range ( Callback &&  c,
gang_md::id  gid,
gang_md g,
location_range_wrapper< T > const &  r,
const context::epoch_type  e,
Function &&  f 
)

Creates a distributed object through f in a new gang over the range r of the locations of the gang associated with g.

Parameters
cCallback to pass a pointer to the constructed object.
gidDestination gang id.
gDestination gang metadata.
rDestination locations of g.
eCaller epoch.
fObject creation function.

◆ rpc()

template<typename F , typename Range , typename... T>
void stapl::runtime::rpc ( F &&  f,
Range &&  pids,
T &&...  t 
)

Remote Procedure Call (RPC) to process primitive.

This function calls f on the destination processes.

Parameters
fCallable object.
pidsDestination processes.
tArguments to pass to the function.

◆ invoke() [1/3]

template<typename F , typename Tuple , std::size_t... I>
auto stapl::runtime::invoke ( F &&  f,
Tuple &  args,
void *const  base,
index_sequence< I... >   
) -> decltype(std::forward<F>(f)(std::get<I>(args).get(base)...))

Calls f with the stored objects in args passed as arguments.

Parameters
baseBase address that args are stored in.
fFunction to invoke.
argsArguments to unpack.
Returns
The result of f.

◆ invoke() [2/3]

template<typename MemFun , typename Base , typename Tuple , std::size_t... I>
auto stapl::runtime::invoke ( MemFun const &  pmf,
Base &  ref,
Tuple &  args,
void *const  base,
index_sequence< I... >   
) -> decltype((ref.*pmf)(std::get<I>(args).get(base)...))

Calls the member function pmf on ref with the stored objects in args passed as arguments.

Parameters
pmfMember function to invoke.
refObject to invoke pmf on.
argsArguments to unpack.
baseBase address that args are stored in.
Returns
The result of pmf.

◆ invoke() [3/3]

template<typename MemFun , typename Base , typename Tuple , std::size_t... I>
auto stapl::runtime::invoke ( MemFun const &  pmf,
Base &  ref,
Tuple &  args,
void *const  base,
std::size_t &  size,
index_sequence< I... >   
) -> decltype((ref.*pmf)(std::get<I>(args).get(base, size)...))

Calls the member function pmf on ref with the stored objects in args passed as arguments.

Parameters
pmfMember function to invoke.
refObject to invoke pmf on.
argsArguments to unpack.
baseBase address that args are stored in.
sizeVariable to store how many bytes were unpacked.
Returns
The result of pmf.

◆ cleanup()

template<typename Tuple , std::size_t... I>
void stapl::runtime::cleanup ( Tuple &  ,
index_sequence< I... >   
)

Releases any resources associated with the stored objects if invoke() was not called.

◆ rmi_fence() [1/2]

void stapl::runtime::rmi_fence ( context ctx)

Ensures that all outstanding RMI requests have been completed.

This function also is an implicit barrier.

Warning
This is an SPMD function.

◆ rmi_fence() [2/2]

void stapl::runtime::rmi_fence ( context ctx,
std::function< bool(void)>  f 
)

Ensures that all outstanding RMI requests have been completed and the return value of f is true.

This function also is an implicit barrier.

Warning
This is an SPMD function.

◆ yield_until() [1/3]

template<typename Predicate >
bool stapl::runtime::yield_until ( context ctx,
Predicate &&  pred 
)

Yields until pred returns true.

This function will flush aggregated requests if pred returns false.

Returns
true if it yielded, otherwise false.

◆ yield_until() [2/3]

template<typename Predicate >
bool stapl::runtime::yield_until ( const no_context_t  ,
Predicate &&  pred 
)

Yields until pred returns true.

This function does not flush aggregated requests.

Returns
true if it yielded, otherwise false.

◆ yield_until() [3/3]

template<typename Predicate >
bool stapl::runtime::yield_until ( Predicate &&  pred)

Yields until pred returns true.

This function will flush aggregated requests if a context exists and pred returns false.

Returns
true if it yielded, otherwise false.

◆ yield_if_not() [1/3]

template<typename Predicate >
bool stapl::runtime::yield_if_not ( context ctx,
Predicate &&  pred 
)

Yields if pred does not return true.

This function will flush aggregated requests if pred returns false.

Returns
The result of pred.

◆ yield_if_not() [2/3]

template<typename Predicate >
bool stapl::runtime::yield_if_not ( const no_context_t  ,
Predicate &&  pred 
)

Yields if pred does not return true.

This function does not flush aggregated requests.

Returns
The result of pred.

◆ yield_if_not() [3/3]

template<typename Predicate >
bool stapl::runtime::yield_if_not ( Predicate &&  pred)

Yields if pred does not return true.

This function will flush aggregated requests if a context exists and pred returns false.

Returns
The result of pred.

◆ rmi_fence_impl()

template<typename Function >
void stapl::runtime::rmi_fence_impl ( context ctx,
Function &&  f 
)

RMI fence implementation.

For one location, the fence succeeds iff $ \sum_{lid=i}^{p} (sent - processed) + |f()| = 0 $.

For more than one locations, the fence succeeds iff $ \sum_{lid=i}^{p} (sent - processed) + new_sent + f() = 0 $ for at least two iterations.

The fence ensures that all outstanding RMI requests have completed.

In the simple case, iterating is not necessary. However, two special cases make iterating necessary for correctness:

  1. if an RMI invokes a method that makes another RMI, which invokes a method that makes another RMI, etc.
  2. the communication layer does not make ordering guarantees between point- to-point traffic and collective operations' traffic.
Warning
This is an SPMD function.