STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Member Functions | Protected Attributes
stapl::runtime::allgather_object< T > Class Template Reference

Performs an allgather over all locations of the current gang. More...

Public Member Functions

 allgather_object (context &ctx)
 
rmi_handle::reference const & get_rmi_handle (void) noexcept
 
rmi_handle::const_reference const & get_rmi_handle (void) const noexcept
 
void operator() (T const &t)
 
void operator() (T &&t)
 
size_type size (void) const noexcept final
 
bool valid (const size_type n) const final
 Returns true if the n-th result has been received.
 
bool valid (void) const final
 Returns true if all the results have been received.
 
void wait (const size_type n) const final
 Waits for the n-th result to be received. More...
 
void wait (void) const final
 Waits for all the results to be received. More...
 
void wait (context &ctx) const
 Waits for the n-th result to be received. More...
 
get (const size_type n) final
 Returns the n-th received result. More...
 
std::vector< T > get (void) final
 Returns all the received results. More...
 
void set_value (const size_type n, storage_type *const p, void *const base, message_shared_ptr &m)
 Sets the n-th result. More...
 
void set_value (const size_type n, T const &value)
 Sets the n th result. More...
 
void set_value (const size_type n, T &&value)
 
void set_owned (void) noexcept
 
bool is_owned (void) const noexcept
 
template<typename Function >
void async_then (Function &&f)
 

Public Types

using value_type = T
 
typedef futures_base< T >::size_type size_type
 
typedef internal_storage_type::storage_type storage_type
 
using aggregate_result_type = typename std::conditional< std::is_void< T >::value, void, std::vector< T > >::type
 

Protected Member Functions

bool valid_no_yield (void) const noexcept final
 Returns true if the result has been received.
 
void schedule_continuation (void)
 Schedules a continuation if async_then() was called.
 

Protected Attributes

std::mutex m_mtx
 

Detailed Description

template<typename T>
class stapl::runtime::allgather_object< T >

Performs an allgather over all locations of the current gang.

Template Parameters
TObject type.

Member Function Documentation

◆ wait() [1/3]

void stapl::runtime::values_handle< T >::wait ( const size_type  n) const
finalvirtualinherited

Waits for the n-th result to be received.

Blocks until valid(const size_type) const returns true.

Implements stapl::runtime::futures_base< T >.

◆ wait() [2/3]

void stapl::runtime::values_handle< T >::wait ( void  ) const
finalvirtualinherited

Waits for all the results to be received.

Blocks until valid() const returns true.

Implements stapl::runtime::futures_base< T >.

◆ wait() [3/3]

void stapl::runtime::values_handle< T >::wait ( context ctx) const
inherited

Waits for the n-th result to be received.

Blocks until valid(const size_type) const returns true.

◆ get() [1/2]

T stapl::runtime::values_handle< T >::get ( const size_type  n)
finalvirtualinherited

Returns the n-th received result.

This function waits until the n-th result has been received and returns it.

Calling valid() const or valid(const size_type) const returns false after a call to this function.

The lock ensures that set_value() has finished before the get() continues, to avoid calling schedule_continuation() on an object that has been destroyed.

Warning
You cannot mix calls of this function and get().

Implements stapl::runtime::futures_base< T >.

◆ get() [2/2]

std::vector<T > stapl::runtime::values_handle< T >::get ( void  )
finalvirtualinherited

Returns all the received results.

This function waits until all results have been received and returns them.

Calling valid() const or valid(const size_type) const returns false after a call to this function.

The lock ensures that set_value() has finished before the get() continues, to avoid calling schedule_continuation() on an object that has been destroyed.

Warning
You cannot mix calls of this function and get(size_type).

Implements stapl::runtime::futures_base< T >.

◆ set_value() [1/3]

void stapl::runtime::values_handle< T >::set_value ( const size_type  n,
storage_type *const  p,
void *const  base,
message_shared_ptr m 
)
inherited

Sets the n-th result.

This function keeps a pointer to the buffer where the result remains packed until get() or get(const size_type) are called.

Parameters
nResult index.
pPointer to the stapl::runtime::arg_storage in the buffer.
baseAddress in the buffer that the stapl::runtime::arg_storage is stored in.
mBuffer that contains the stapl::runtime::arg_storage.
See also
arg_storage, message

◆ set_value() [2/3]

void stapl::runtime::values_handle< T >::set_value ( const size_type  n,
T const &  value 
)
inherited

Sets the n th result.

Parameters
nResult index.
valueValue to be set.

◆ set_value() [3/3]

void stapl::runtime::values_handle< T >::set_value ( const size_type  n,
T &&  value 
)
inherited


The documentation for this class was generated from the following file: