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

Wrapper to store a context and allow queueing it into a boost::intrusive::list. More...

Public Member Functions

 ctx_impl (context::id const &cid, location_md &l, const process_id pid)
 
template<typename Runqueue >
void message_push (message_ptr m, const epoch_type e, Runqueue &rq)
 
template<typename Runqueue >
size_type operator() (const bool light_yield, Runqueue &rq)
 
id const & get_id (void) const noexcept
 
full_location const & get_initiator (void) const noexcept
 Returns the gang id and location id as a full_location object that created this context object.
 
full_location const & get_current_location (void) const noexcept
 Returns the gang id and location id associated with this context as a full_location object.
 
gang_md const & get_gang_md (void) const noexcept
 
gang_mdget_gang_md (void) noexcept
 
location_md const & get_location_md (void) const noexcept
 
location_mdget_location_md (void) noexcept
 
gang_md::id get_gang_id (void) const noexcept
 
location_md::id get_location_id (void) const noexcept
 
process_id get_source_process_id (void) const noexcept
 
bool is_intragang (void) const noexcept
 
nesting_level get_nesting (void) const noexcept
 
bool is_base (void) const noexcept
 
void set_epoch (const epoch_type e)
 Sets the epoch this context is in. More...
 
epoch_type get_epoch (void) const noexcept
 
void * allocate_return (const std::size_t size)
 Allocates space for a return value request.
 
aggregator_typeget_aggregator (full_location const &loc)
 Returns a request aggregator to the given destination. More...
 
void flush_requests (void)
 Flushes all aggregated requests.
 
void flush (void)
 Flushes all aggregated requests and fence metadata.
 
void count_pending (full_location const &loc)
 Increases the count of pending buffers. More...
 
void count_pending (const gang_md::id dst_gid, const unsigned int N)
 Increases the count of pending buffers by N. More...
 
void count_processed (void)
 Increases the count of processed buffers. More...
 

Public Types

using size_type = std::size_t
 
using id = context_id
 
using aggregator_type = context_impl::aggregator
 
using epoch_type = logical_clock::time_type
 

Detailed Description

Wrapper to store a context and allow queueing it into a boost::intrusive::list.

Member Function Documentation

◆ set_epoch()

void stapl::runtime::context::set_epoch ( const epoch_type  e)
inherited

Sets the epoch this context is in.

If epoch differs from the previous, requests will be flushed.

◆ get_aggregator()

aggregator_type& stapl::runtime::context::get_aggregator ( full_location const &  loc)
inherited

Returns a request aggregator to the given destination.

The aggregator from the previous call to get_aggregator() is memoized unless flush() has been called.

Warning
While memoization may have a positive effect when a location communicates with the same location repeatedly, it may have no or negative performance effects under a less repeated communication pattern.
If the gang metadata is not known, requests are sent to the owner process of the destination gang id, which always knows where to forward them. This can potentially create a choking point.

◆ count_pending() [1/2]

void stapl::runtime::context::count_pending ( full_location const &  loc)
inherited

Increases the count of pending buffers.

This function is called when the destination of the requests in the buffer is loc.

◆ count_pending() [2/2]

void stapl::runtime::context::count_pending ( const gang_md::id  dst_gid,
const unsigned int  N 
)
inherited

Increases the count of pending buffers by N.

This function is called when the destination of the requests in the buffer is some or all locations in gang dst_gid.

◆ count_processed()

void stapl::runtime::context::count_processed ( void  )
inherited

Increases the count of processed buffers.

This function flushes the buffer containing return values, since blocking calls may be waiting for them.


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