STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::runtime::context_impl::aggregator Class Reference

RMI request aggregator to a destination location. More...

Public Member Functions

 aggregator (context &ctx, full_location const &dest, gang_md &g, const bool intragang) noexcept
 Creates a new aggregator to an intragang/intergang destination with the gang metadata being known. More...
 
 aggregator (context &ctx, full_location const &dest) noexcept
 Creates a new aggregator to an intergang destination.
 
 ~aggregator (void)
 Destroys this aggregator. More...
 
bool is_on_shmem (void) const noexcept
 Returns true if the destination is on shared memory, otherwise false.
 
void * allocate (const std::size_t size, const epoch_type e, const bool implicit_flush)
 Allocates space for a new request. More...
 
std::pair< void *, void * > allocate (rmi_delegate const &delegate, const std::size_t size, const std::size_t combined_size, const epoch_type e, const bool implicit_flush)
 Allocates space for a new request that supports combining. More...
 
void flush (void)
 Flushes the buffer.
 
void check_and_flush (void)
 Flushes the buffer if it has at least a request in it.
 
void try_flush (void)
 Flushes the buffer if it has enough requests in it. More...
 

Public Types

using epoch_type = logical_clock::time_type
 

Detailed Description

RMI request aggregator to a destination location.

This class keeps an internal buffer where requests are aggregated and then sent using one message.

If STAPL_RUNTIME_DISABLE_COMBINING is not defined, it holds additional information for combining requests (

See also
async_rmi).

Constructor & Destructor Documentation

◆ aggregator()

stapl::runtime::context_impl::aggregator::aggregator ( context ctx,
full_location const &  dest,
gang_md g,
const bool  intragang 
)
noexcept

Creates a new aggregator to an intragang/intergang destination with the gang metadata being known.

If it is an intergang aggregator, then the reference count on gang_md is increased to avoid deleting the gang_md object in case that it is ready to be destroyed.

◆ ~aggregator()

stapl::runtime::context_impl::aggregator::~aggregator ( void  )

Destroys this aggregator.

The destructor flushes the buffer if necessary and releases the reference count on gang_md if it was an intergang aggegrator.

Member Function Documentation

◆ allocate() [1/2]

void* stapl::runtime::context_impl::aggregator::allocate ( const std::size_t  size,
const epoch_type  e,
const bool  implicit_flush 
)

Allocates space for a new request.

It will flush any aggregated requests if the new request is in a newer epoch than the last one or if there is not enough space for it.

◆ allocate() [2/2]

std::pair<void*, void*> stapl::runtime::context_impl::aggregator::allocate ( rmi_delegate const &  delegate,
const std::size_t  size,
const std::size_t  combined_size,
const epoch_type  e,
const bool  implicit_flush 
)

Allocates space for a new request that supports combining.

It will flush any aggregated requests if the new request is in a newer epoch than the last one or if there is not enough space for it.

Returns
The request that is used to combine the current one and a pointer to available space.

◆ try_flush()

void stapl::runtime::context_impl::aggregator::try_flush ( void  )

Flushes the buffer if it has enough requests in it.

See also
get_aggregation()

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