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 Types | Protected Attributes
stapl::edge_container Class Referencefinal

The edge container maintains a distributed representation of the dependence (edges) for the PARAGRAPH and the various data flows they represent. It is the primary container for the PARAGRAPH infrastructure which is traversed during PARAGRAPH execution as tasks complete execution and notify the edge_container of their return value (if any), triggering data flow to all specified successors in the system. More...

Public Member Functions

bool has_pending_consumers () const
 Returns true if any producer task executing on this location has (or possibly has) any outstanding consumers to be registered.
 
template<typename T >
detail::edge_entry< T > & get_entry_ref (edge_entry_t &entry) const
 Convert an iterator to edge_entry_base to a reference to the derived class of the entry, edge_entry<T>. More...
 
template<typename T , typename Filter >
tuple< detail::edge_entry_base *, detail::edge_version_storage< typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type)>::type >::type > * > setup_flow (index_type producer_tid, boost::function< void(executor_base &, typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type)>::type >::type const &) > const &notifier, Filter const &filter, bool b_inc_local_usr_cnt=true)
 Called by successors to create an edge in the edge_container. More...
 
template<typename T , typename Notifier >
void setup_flow_remote (index_type producer_tid, Notifier notifier)
 Target of RMI from child PARAGRAPH consuming a value from a parent PARAGRAPH's input port (i.e., an inter-PARAGRAPH dataflow instance of edge_container). Calls setup_flow with identify filter and without incrementing the local user count. setup_flow receives a type erased boost::function (which can't be serialized), this version receives the fully typed notifier which is type erased prior to calling the former. More...
 
template<typename T >
void setup_promise_flow (index_type producer_tid, promise< typename df_stored_type< T >::type > pr)
 Called by out of gang successors to initiate data flow which is handled via a promise. More...
 
void setup_signal_flow (index_type producer_tid, signal_notifier_t const &notifier)
 Called by successors to create an signal edge in the edge_container. More...
 
template<typename T >
detail::edge_entry< T > & add_producer (index_type tid, size_t consumer_cnt, bool b_migrated=false)
 Mark this location as the execution location for a given task. More...
 
template<typename T , typename Filter >
void send_remote_notifier (const index_type producer_tid, detail::edge_entry_wrapper< T > entry, Filter const &filter, const unsigned int version_id, const bool b_is_upgrade, const bool add_local=false)
 Add remote notifier for value consumption on the location where the producer task is located. Facilitates inter-location data flow which will subsequently trigger all associated local notifications. More...
 
template<typename T , typename Functor >
void migrate_entry (const index_type producer_tid, const size_t dest, Functor const &f)
 Called by the PARAGRAPH to migrate all of an edge_entry's metadata about a local producer task (i.e., notifications, unknown consumer counts) to a new location. More...
 
template<typename T >
tuple< detail::edge_entry_base *, detail::edge_version_storage< typename df_stored_type< T >::type > * > set_migrated_value (const index_type producer_tid, typename df_stored_type< T >::type const &val)
 Called during the migration of a producer task to new location for each of its predecessor data flows. More...
 
bool migration_enabled (void) const
 
 edge_container (bool b_migration_enabled, paragraph_impl::task_graph *tg, bool b_is_persistent)
 Constructor of edge_container. More...
 
template<typename TaskMapperParam >
 edge_container (bool b_migration_enabled, paragraph_impl::task_graph *tg, bool b_is_persistent, TaskMapperParam &&task_mapper_param)
 Alternate constructor signature used when the PARAGRAPH defines a custom task to location mapper to be used in the directory.
 
 ~edge_container () final
 Destructor of edge_container. More...
 
void try_base_eviction (edge_entry_t &entry) const
 Attempt the eviction (deletion) of an element of the value cache through the virtual method of the edge_entry_base. More...
 
template<typename T , typename Notifier >
tuple< detail::edge_entry_base *, detail::edge_version_storage< typename df_stored_type< typename boost::result_of< detail::df_identity< T >typename df_stored_type< T >::type)>::type >::type > * > set_result (index_type tid, Notifier notifier)
 Add notifier that will associate the data flow value on this location of the outgoing edge of the PARAGRAPH with a the specified task's produced value. More...
 
template<typename T , typename Notifier >
void add_remote_notifier (const index_type tid, const size_t loc, Notifier const &notifier, const bool b_is_upgrade)
 Invoked by consumer locations via the directory to add a remote notifier to the edge_entry at this producer location. More...
 
void add_remote_signal_notifier (index_type tid, size_t loc)
 Invoked by consumer locations via the directory to add a remote signal notifier to the edge_entry at this producer location. More...
 
template<typename T , typename ValueParam >
void set_element (const index_type tid, ValueParam &&val)
 Called by task_graph::processed (which is invoked when a task finishes execution) to trigger the initial data flow of producer task. More...
 
void set_element (index_type tid)
 Called by task_graph::processed (which is invoked when a task finishes execution) to trigger the initial data flow of producer task when the task's return value type is void. More...
 
void setup_signal (index_type producer_tid, edge_container::local_notifier_t *notifier_ptr)
 Public method called by the PARAGRAPH to request invocation of the notifier represented by notifier_ptr when the task identified by producer_tid has finished execution. More...
 
void receive_signal (const index_type tid)
 Target of RMI invoked by a remote signal notifier to trigger data flow on the remote consumption location. More...
 
template<typename T , typename Filter >
void receive_value (const index_type tid, detail::edge_entry_wrapper< T > entry, typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type) >::type >::type const &val, const unsigned int version_id)
 Target of RMI invoked by a remote notifier to trigger data flow on the remote consumption location. More...
 
template<typename T , typename Filter >
void receive_move_value (const index_type tid, detail::edge_entry_wrapper< T > entry, typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type) >::type >::type &&val, const unsigned int version_id)
 Target of RMI invoked by a remote notifier to trigger data flow on the remote consumption location when moving the flowed value.
 
template<typename T , typename Filter >
void receive_shared_value (const index_type tid, detail::edge_entry_wrapper< T > entry, immutable_shared< typename df_stored_type< T >::type > const &wrapper, const unsigned int version_id)
 Target of RMI invoked by a remote notifier to trigger data flow on the remote consumption location when sharing the flowed value.
 
template<typename T >
void try_eviction (edge_entry_t &entry) const
 Attempt the eviction (deletion) of an element of the value cache when the concrete type (i.e., edge value type) is known at the call site. More...
 
template<typename T >
void try_eviction (detail::edge_entry< T > &entry) const
 Attempt the eviction (deletion) of an element of the value cache when the concrete type (i.e., edge value type) is known at the call site. More...
 
void reset_entry_values (void) const
 Resets edge entry data flow triggers and all notifiers to prepare for a reinvocation of a persistent PARAGRAPH. More...
 
void release (void)
 Notify the edge_container that it is no longer needed by the PARAGRAPH. Termination detection (at least on the location) has succeeded. More...
 
task_graphtg () const
 
directory_tloc_directory (void)
 
bool is_persistent (void) const
 
bool contains_producer_tid (index_type tid) const
 Returns true if this location is currently marked as the execution location for the given task.
 
void set_num_succs (index_type producer_tid, size_t num_succs)
 Define the number of successors for a task (producer_tid) that was previously delayed by passing defer_spec to add_producer.
 
template<typename T , typename Filter >
void receive_move_value (const index_type tid, detail::edge_entry_wrapper< T > entry, typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type)>::type >::type &&val, const unsigned int version_id)
 
bool has_perfect_mapper (void) const
 
mapper_t const & key_mapper (void) const
 
mapper_t & key_mapper (void)
 
bool empty (void) const
 Returns true if there are no entries in directory's registry on this location.
 
void reset (void)
 Clear all local registrations and pending messages in directory. Used by clear() methods of container distributions.
 
bool try_register_key_local (std::size_t const &key)
 Attempt registration from the managing location. Return true if successful (i.e., not already registered).
 
void register_key (std::size_t const &key)
 Associate key in directory's registry with the location invoking this method. More...
 
void register_keys (std::pair< std::size_t, std::size_t > const &keys)
 
void register_apply (std::size_t const &key, Functor &&f)
 Associate key in directory's registry with location invoking this method. Registration location is implicitly set to be caller of this method. More...
 
void register_apply (std::size_t const &key, Functor &&f, location_type location)
 Associate key in directory's registry with location invoking this method. More...
 
void unregister_key (std::size_t const &key)
 Unregister key in directory's registry.
 
void unregister_apply (std::size_t const &key, Functor &&f)
 Unregister key and apply a function object f at location where directory's registry manages key. More...
 
void invoke_where (Functor &&f, std::size_t const &key)
 Invoke function object at the location where key is currently registered. More...
 
void try_invoke_where (Functor &&f, std::size_t const &key)
 Invoke function object at the location where key is currently registered if the key is registered. More...
 
void unordered_invoke_where (Functor &&f, std::size_t const &key)
 Invoke function object at the location where key is currently registered, disregarding RMI causal ordering. More...
 
locality_info locality (std::size_t const &key)
 Provide locality information about a key managed by the directory. More...
 
runtime::location_md const & get_location_md (void) const noexcept
 Returns the location metadata of the location this object registered in.
 
runtime::location_mdget_location_md (void) noexcept
 Returns the location metadata of the location this object registered in. noexcept More...
 
edge_entry_tlookup_ptr (index_type tid) const
 Search for entry with key tid. If found, return a pointer else return a nullptr.
 
edge_entry_tlookup_expect (index_type tid)
 Search for entry with key tid. The entry is expected to exist; assert if it is not found. Return a reference to the entry.
 
bool contains (index_type tid) const
 Returns true if there is an entry for task tid in the value cache.
 
bool empty (void) const
 
void erase (edge_entry_t &entry_ref) const
 
void clear (void)
 
bool insert (edge_entry_t &entry_ref)
 
template<typename EntryFactory >
edge_entry_tlookup_or_insert (const index_type tid, EntryFactory factory)
 Check if entry exists for given task id and create one if it doesn't. Returns a reference to the entry.
 
template<typename Functor >
void for_each (Functor f) const
 Apply functor on all entries in the value cache.
 
Distributed Object Management
rmi_handle::const_reference const & get_rmi_handle (void) const noexcept
 Returns the associated rmi_handle.
 
rmi_handle::reference const & get_rmi_handle (void) noexcept
 Returns the associated rmi_handle.
 
size_type get_location_id (void) const noexcept
 Returns the location id of the local sub-object.
 
size_type get_num_locations (void) const noexcept
 Returns the number of locations of the gang of this p_object.
 
void advance_epoch (void)
 Advances the epoch of the object. More...
 
void unlock (void)
 Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs. More...
 
void lock (void)
 Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs. More...
 
bool try_lock (void)
 Attempt to maintain atomicity with respect to incoming RMIs. More...
 

Public Types

using local_notifier_t = detail::edge_local_notifier_base
 The successor notifier type passed to the edge_container by consumption requests originating in task_graph_impl::add_task.
 
using manager_type = mapper_t
 
using registry_type = registry_t
 
using key_type = std::size_t
 
using size_type = rmi_handle::size_type
 
using index_type = std::size_t
 The task identifier type used by the PARAGRAPH.
 
using edge_entry_t = detail::edge_entry_base
 The edge entry type held by the value cache.
 

Protected Member Functions

void execute (Functor &&f)
 Internal method, target of RMI called via migrate_impl to invoke functor f at new registration location, post registry update. More...
 
void invoke_at_manager (std::size_t const &key, void(Directory::*const pmf)(PMFArgs...), Args &&... args)
 Forwards functor and arguments to location managing key. The location managing the key will invoke the method with the supplied arguments. More...
 
void invoke_at_manager (std::size_t const &key, void(Directory::*const pmf)(PMFArgs...) const, Args &&... args) const
 Forwards const functor and arguments to location managing key. The location managing the key will invoke the method with the supplied arguments. More...
 
void invoke_at_manager_impl (std::size_t const &key, void(Directory::*const pmf)(PMFArgs...), Args &&... args)
 Implementation of. More...
 
void invoke_at_manager_impl (std::size_t const &key, void(Directory::*const pmf)(PMFArgs...) const, Args &&... args) const
 Implementation of. More...
 
void flush_pending (const location_type loc, std::size_t const &key, queue_t &pending)
 Forward all buffered requests for key to location loc. More...
 
void request_forward (std::size_t const &key, Functor &&f)
 Internal method used to facilitate invocation of f on location where key is currently registered. Called via RMI on directory location where key is managed. More...
 
void try_request_forward (std::size_t const &key, Functor &&f)
 Internal method used to facilitate invocation of f on location where key is currently registered. If key is not registered, the request is dropped; otherwise, it is called via RMI on directory location where key is managed. This is directed at situations where it is legal for a key to not exist, i.e. erasing non-existent keys in the unordered set container. More...
 
void check_increase_size (void) const
 Called by edge_container methods that increase the number of entries stored in the local cache. If load factor is 1, resize by a power of two.
 

Protected Types

using mapper_t = typename select_parameter< boost::function< std::pair< location_type, loc_qual >(size_t)>, detail::default_key_mapper< std::size_t > >::type
 
using registry_t = typename select_parameter< use_default, boost::unordered_map< std::size_t, location_type, boost::hash< std::size_t >, std::equal_to< std::size_t >, pool_allocator< std::pair< std::size_t const, location_type > > > >::type
 
using transmitter_type = typename select_parameter< try_transmitter, async_transmitter >::type
 
using queue_t = request_queue< request_t >
 
using queues_t = boost::unordered_map< std::size_t, queue_t, stapl::hash< std::size_t >, std::equal_to< std::size_t >, pool_allocator< std::pair< std::size_t const, queue_t > > >
 

Protected Attributes

registry_t m_registry
 Stores key to locations mapping.
 
queues_t m_pending
 Map of queues, indexed by Key. Entry for keys exists when messages arrive and must be buffered prior to registration, during migration, etc.
 
mapper_t m_key_mapper
 Map a key to location that manages it (i.e., where it has entry in m_registry).
 
bool m_b_perfect_mapper
 

Detailed Description

The edge container maintains a distributed representation of the dependence (edges) for the PARAGRAPH and the various data flows they represent. It is the primary container for the PARAGRAPH infrastructure which is traversed during PARAGRAPH execution as tasks complete execution and notify the edge_container of their return value (if any), triggering data flow to all specified successors in the system.

The edge container facilitates the unordered creation of predecessor and successor tasks, allowing the edge creation to occur without any synchronization between the two.

In ephemeral mode, storage for both intermediate values and the dependence information is aggressively reclaimed to minimize the footprint of the PARAGRAPH

Constructor & Destructor Documentation

◆ edge_container()

stapl::edge_container::edge_container ( bool  b_migration_enabled,
paragraph_impl::task_graph tg,
bool  b_is_persistent 
)

Constructor of edge_container.

The directory is passed a functor wrapping a method of this class, which returns true if the given task identifier is registered as a producer on this location. Also, initialized such that communication from this object is not buffered by ARMI and is not included in bookkeeping for fences.

◆ ~edge_container()

stapl::edge_container::~edge_container ( )
final

Destructor of edge_container.

Verify the the edge_container is empty if not in persistent mode. If in persistent mode, manually deconstruct all edge entries and then clear the value cache.

Member Function Documentation

◆ get_entry_ref()

template<typename T >
detail::edge_entry<T>& stapl::edge_container::get_entry_ref ( edge_entry_t entry) const

Convert an iterator to edge_entry_base to a reference to the derived class of the entry, edge_entry<T>.

Template Parameters
TThe edge value type. Parameter is explicitly specified by the calling edge_container method.
Parameters
iterAn iterator to edge_entry_base. Must be valid.

down_cast is used to check the downcast with a dynamic_cast when in debug mode.

See also
down_cast

◆ setup_flow()

template<typename T , typename Filter >
tuple< detail::edge_entry_base *, detail::edge_version_storage< typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type)>::type >::type > * > stapl::edge_container::setup_flow ( index_type  producer_tid,
boost::function< void(executor_base &, typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type)>::type >::type const &) > const &  notifier,
Filter const &  filter,
bool  b_inc_local_usr_cnt = true 
)

Called by successors to create an edge in the edge_container.

Searches the local value cache for information about this producer_tid before sending a directory forwarded message to the producer.

Template Parameters
TEdge value type. Explicitly specified by edge_view.
Parameters
producer_tidThe task identifier of the task to set up the data flow from.
notifierThe notifier that should be invoked locally when the the data flow is triggered.
filterA filter to be applied to the consumed value prior to flowing it to the consuming task.
b_inc_local_usr_cntDenotes whether the local reference count associated with this version (as defined by filter) of the value should incremented.

b_inc_local_usr_cnt is generally true, except for a notifier for the external PARAGRAPH result, which copy the value on notification and then have no further need to reference the copy in the edge_container.

◆ setup_flow_remote()

template<typename T , typename Notifier >
void stapl::edge_container::setup_flow_remote ( index_type  producer_tid,
Notifier  notifier 
)

Target of RMI from child PARAGRAPH consuming a value from a parent PARAGRAPH's input port (i.e., an inter-PARAGRAPH dataflow instance of edge_container). Calls setup_flow with identify filter and without incrementing the local user count. setup_flow receives a type erased boost::function (which can't be serialized), this version receives the fully typed notifier which is type erased prior to calling the former.

Template Parameters
TEdge value type. Explicitly specified by edge_view.
Parameters
producer_tidThe task identifier of the task to set up the data flow from.
notifierThe notifier that should be invoked locally when the data flow is triggered.

◆ setup_promise_flow()

template<typename T >
void stapl::edge_container::setup_promise_flow ( index_type  producer_tid,
promise< typename df_stored_type< T >::type >  pr 
)

Called by out of gang successors to initiate data flow which is handled via a promise.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
producer_tidThe task identifier of the task to set up the data flow from.
prPromise that is fulfilled with the value produced by the predecessor.

◆ setup_signal_flow()

void stapl::edge_container::setup_signal_flow ( index_type  producer_tid,
signal_notifier_t const &  notifier 
)

Called by successors to create an signal edge in the edge_container.

Searches the local value cache for information about this producer_tid before sending a directory forwarded message to the producer.

Parameters
producer_tidThe task identifier of the task to set up the data flow from.
notifierThe notifier that should be invoked locally when the the data flow is triggered.

◆ add_producer()

template<typename T >
detail::edge_entry<T>& stapl::edge_container::add_producer ( index_type  tid,
size_t  consumer_cnt,
bool  b_migrated = false 
)

Mark this location as the execution location for a given task.

Template Parameters
TEdge value type. Explicitly specified by edge_view.
Parameters
tidThe task identifier of the producer task.
consumer_cntThe out degree of the producer task.
b_migratedTrue if this is the insertion of migrated task. If so the migration process updates the producer's execution location and there's no need to reregister.
Returns
A reference to the created edge_entry. Will be passed to the created task.

◆ send_remote_notifier()

template<typename T , typename Filter >
void stapl::edge_container::send_remote_notifier ( const index_type  producer_tid,
detail::edge_entry_wrapper< T >  entry,
Filter const &  filter,
const unsigned int  version_id,
const bool  b_is_upgrade,
const bool  add_local = false 
)

Add remote notifier for value consumption on the location where the producer task is located. Facilitates inter-location data flow which will subsequently trigger all associated local notifications.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
producer_tidTask identifier of the producer task to register notification request with.
filterFilter to be applied on the producer task value prior to consumption by the successor task.
version_idA version identifier created in the edge_entry on the consuming location associated with filter.
b_is_upgradeTrue if a this notifier upgrades a previous request from the same location (i.e., signal –> full).
add_localTrue if this notifier should be added locally and not forwarded to a remote producer through the directory.

The add_local parameter was added with migration support, which inserts a remote notifier even on the location where the producer task is (currently) located. This simplifies the data flow protocol if the task is later migrated, meaning this location becomes a remote consumption location.

◆ migrate_entry()

template<typename T , typename Functor >
void stapl::edge_container::migrate_entry ( const index_type  producer_tid,
const size_t  dest,
Functor const &  f 
)

Called by the PARAGRAPH to migrate all of an edge_entry's metadata about a local producer task (i.e., notifications, unknown consumer counts) to a new location.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
producer_tidTask identifier of producer task to be migrated.
destThe new execution location for the task.
fThe PARAGRAPH method to call on the destination to complete the migration process. (The actual migration is facilitated by the edge container since it maintains the directory).

◆ set_migrated_value()

template<typename T >
tuple<detail::edge_entry_base*, detail::edge_version_storage<typename df_stored_type<T>::type>*> stapl::edge_container::set_migrated_value ( const index_type  producer_tid,
typename df_stored_type< T >::type const &  val 
)

Called during the migration of a producer task to new location for each of its predecessor data flows.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
producer_tidThe task identifier of the task that produced this value.
valThe value to be inserted in the edge_entry.

A copy of all predecessor values in the edge container that a migrated task depends on (flow already set since only runnable tasks are migratable) are copied to the next execution location to be available during the task's execution. Create a new edge_entry, unless one already exists and insert the value.

◆ try_base_eviction()

void stapl::edge_container::try_base_eviction ( edge_entry_t entry) const

Attempt the eviction (deletion) of an element of the value cache through the virtual method of the edge_entry_base.

Parameters
entryReference to an edge_entry_base object to check for evictability.

Note destruction is runtime polymorphic as well.

When the concrete type of the entry is known (i.e., the edge value type is available in the calling context), use try_eviction to avoid virtual function call.

See also
try_eviction.

◆ set_result()

template<typename T , typename Notifier >
tuple<detail::edge_entry_base*, detail::edge_version_storage< typename df_stored_type< typename boost::result_of< detail::df_identity<T>typename df_stored_type<T>::type)>::type >::type>*> stapl::edge_container::set_result ( index_type  tid,
Notifier  notifier 
)

Add notifier that will associate the data flow value on this location of the outgoing edge of the PARAGRAPH with a the specified task's produced value.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
tidThe identifier of the task
notifierThe result notifier to register with the edge_entry for tid.
Returns
Pointers to associated edge entry and version storage so that attempt to steal (move) this entry can be made. This occurs if internal tasks are done with it and only a single location out-flows this value.

Redirects request to edge_container::setup_flow.

◆ add_remote_notifier()

template<typename T , typename Notifier >
void stapl::edge_container::add_remote_notifier ( const index_type  tid,
const size_t  loc,
Notifier const &  notifier,
const bool  b_is_upgrade 
)

Invoked by consumer locations via the directory to add a remote notifier to the edge_entry at this producer location.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
tidTask identifier of local producer to register notifier with.
locLocation where notification request originated from.
notifierCross location notifier that will apply any filter and manage data flow across ARMI.
b_is_upgradeTrue if a this notifier upgrades a previous request from the same location (i.e., signal –> full).

◆ add_remote_signal_notifier()

void stapl::edge_container::add_remote_signal_notifier ( index_type  tid,
size_t  loc 
)

Invoked by consumer locations via the directory to add a remote signal notifier to the edge_entry at this producer location.

Parameters
tidTask identifier of local producer to register notifier with.
locLocation where notification request originated from.

◆ set_element() [1/2]

template<typename T , typename ValueParam >
void stapl::edge_container::set_element ( const index_type  tid,
ValueParam &&  val 
)

Called by task_graph::processed (which is invoked when a task finishes execution) to trigger the initial data flow of producer task.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
tidThe task identifier of the task producing the edge value.
valThe value produced by the task which will passed (possibly after filtering) along its outgoing edge to consumers.

set_value is in turn called on the edge_entry and all notifications for consumer data flow are invoked.

◆ set_element() [2/2]

void stapl::edge_container::set_element ( index_type  tid)

Called by task_graph::processed (which is invoked when a task finishes execution) to trigger the initial data flow of producer task when the task's return value type is void.

Parameters
tidThe task identifier of the task producing the edge value.

◆ setup_signal()

void stapl::edge_container::setup_signal ( index_type  producer_tid,
edge_container::local_notifier_t notifier_ptr 
)

Public method called by the PARAGRAPH to request invocation of the notifier represented by notifier_ptr when the task identified by producer_tid has finished execution.

Wraps the notifier appropriately based on whether persistency is enabled or not and then redirects to edge_container::setup_signal_flow.

◆ receive_signal()

void stapl::edge_container::receive_signal ( const index_type  tid)

Target of RMI invoked by a remote signal notifier to trigger data flow on the remote consumption location.

Parameters
tidThe task identifier this whose signal notification this invocation represents.

Redirect to edge_entry for tid so that it can notify all local signal consumers.

◆ receive_value()

template<typename T , typename Filter >
void stapl::edge_container::receive_value ( const index_type  tid,
detail::edge_entry_wrapper< T >  entry,
typename df_stored_type< typename boost::result_of< Filter(typename df_stored_type< T >::type) >::type >::type const &  val,
const unsigned int  version_id 
)

Target of RMI invoked by a remote notifier to trigger data flow on the remote consumption location.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
tidThe task identifier this whose signal notification this invocation represents.
entryTrivial iterator to the edge_entry for the given value on this location.
valThe value associated with this data flow.
version_idThe version identifier associated with this value. Associates this data flow with the filter that was originally specified when the edge(s) was created.

Redirect to edge_entry for tid so that it can notify all local associated consumers of this version (and any dependent versions).

◆ try_eviction() [1/2]

template<typename T >
void stapl::edge_container::try_eviction ( edge_entry_t entry) const

Attempt the eviction (deletion) of an element of the value cache when the concrete type (i.e., edge value type) is known at the call site.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
entryA reference to a edge_entry_base object to check for evictability.
See also
try_base_eviction.

Right now we have an aggressive eviction policy on locations not producing a given value. Once all currently initialized consumers execute, the value is evicted, regardless of the size of the cache. Being more lazy might allow consumers that later initialize to reuse the value instead of being forced to wait for a refetch.

◆ try_eviction() [2/2]

template<typename T >
void stapl::edge_container::try_eviction ( detail::edge_entry< T > &  entry) const

Attempt the eviction (deletion) of an element of the value cache when the concrete type (i.e., edge value type) is known at the call site.

Template Parameters
TEdge value type. Explicitly specified by caller.
Parameters
entryA reference to a detail::edge_entry object to check for evictability.

This version is used when reference to derived class is already present.

◆ reset_entry_values()

void stapl::edge_container::reset_entry_values ( void  ) const

Resets edge entry data flow triggers and all notifiers to prepare for a reinvocation of a persistent PARAGRAPH.

Called by task_graph::reset.

◆ release()

void stapl::edge_container::release ( void  )

Notify the edge_container that it is no longer needed by the PARAGRAPH. Termination detection (at least on the location) has succeeded.

It is possible that the edge_container made need to stay alive longer if there are pending notifications stil being flushed.

◆ execute()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::execute ( Functor &&  f)
protectedinherited

Internal method, target of RMI called via migrate_impl to invoke functor f at new registration location, post registry update.

Parameters
fNullary functor to apply.
See also
migrate_impl()

◆ invoke_at_manager() [1/2]

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::invoke_at_manager ( std::size_t const &  key,
void(Directory::*)(PMFArgs...)  pmf,
Args &&...  args 
)
protectedinherited

Forwards functor and arguments to location managing key. The location managing the key will invoke the method with the supplied arguments.

Parameters
keyKey value whose managing location (i.e., where registry entry is stored) is where pmf will be invoked.
pmfDirectory member function to be invoked.
argsvariadic list of arguments to be applied.

This is used to internally encapsulate to forward various method invocations from the requester (e.g., registration, invoke_where, etc) to the location where they can be serviced, forwarded, etc.

See also
directory_base::invoke_where

◆ invoke_at_manager() [2/2]

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::invoke_at_manager ( std::size_t const &  key,
void(Directory::*)(PMFArgs...) const  pmf,
Args &&...  args 
) const
protectedinherited

Forwards const functor and arguments to location managing key. The location managing the key will invoke the method with the supplied arguments.

Parameters
keyKey value whose managing location (i.e., where registry entry is stored) is where pmf will be invoked.
pmfDirectory const member function to be invoked.
argsvariadic list of arguments to be applied.

This is used to internally encapsulate to forward various method invocations from the requester (e.g., registration, invoke_where, etc) to the location where they can be serviced, forwarded, etc.

See also
directory_base::invoke_where

◆ invoke_at_manager_impl() [1/2]

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::invoke_at_manager_impl ( std::size_t const &  key,
void(Directory::*)(PMFArgs...)  pmf,
Args &&...  args 
)
protectedinherited

Implementation of.

See also
invoke_at_manager with a given transmitter
Template Parameters
TransThe transmitter type

◆ invoke_at_manager_impl() [2/2]

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::invoke_at_manager_impl ( std::size_t const &  key,
void(Directory::*)(PMFArgs...) const  pmf,
Args &&...  args 
) const
protectedinherited

Implementation of.

See also
invoke_at_manager with a given transmitter
Template Parameters
TransThe given transmitter type

◆ flush_pending()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::flush_pending ( const location_type  loc,
std::size_t const &  key,
queue_t pending 
)
protectedinherited

Forward all buffered requests for key to location loc.

Parameters
locLocation to send buffered requests to.
keyKey value buffered requests are for.
pendingPending queue associated with Key.

This is internal method only called on the directory location managing key.

◆ request_forward()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::request_forward ( std::size_t const &  key,
Functor &&  f 
)
protectedinherited

Internal method used to facilitate invocation of f on location where key is currently registered. Called via RMI on directory location where key is managed.

Parameters
keyKey whose registered location determines where f should be executed.
fFunctor to invoke (unary, key passed as parameter).

Called by invoke_where and execute (the latter when migration enabled).

◆ try_request_forward()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::try_request_forward ( std::size_t const &  key,
Functor &&  f 
)
protectedinherited

Internal method used to facilitate invocation of f on location where key is currently registered. If key is not registered, the request is dropped; otherwise, it is called via RMI on directory location where key is managed. This is directed at situations where it is legal for a key to not exist, i.e. erasing non-existent keys in the unordered set container.

Parameters
keyKey whose registered location determines where f should be executed.
fFunctor to invoke (unary, key passed as parameter).

Called by invoke_where and execute (the latter when migration enabled).

◆ register_key()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::register_key ( std::size_t const &  key)
inherited

Associate key in directory's registry with the location invoking this method.

◆ register_apply() [1/2]

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::register_apply ( std::size_t const &  key,
Functor &&  f 
)
inherited

Associate key in directory's registry with location invoking this method. Registration location is implicitly set to be caller of this method.

Parameters
keyKey to register.
fUnary function object (receives key) as parameter to call after registration.

◆ register_apply() [2/2]

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::register_apply ( std::size_t const &  key,
Functor &&  f,
location_type  location 
)
inherited

Associate key in directory's registry with location invoking this method.

Parameters
keyKey to registered.
fUnary function object (receives key) as parameter to call after registration.
locationLocation this key should be mapped to in the registry.

◆ unregister_apply()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::unregister_apply ( std::size_t const &  key,
Functor &&  f 
)
inherited

Unregister key and apply a function object f at location where directory's registry manages key.

Parameters
keyKey to unregister.
fUnary function object (receives key) as parameter to call after unregistration.

◆ invoke_where()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::invoke_where ( Functor &&  f,
std::size_t const &  key 
)
inherited

Invoke function object at the location where key is currently registered.

Parameters
fFunctor to apply. Unary operator, receives key as parameter.
keyRegistered key

◆ try_invoke_where()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::try_invoke_where ( Functor &&  f,
std::size_t const &  key 
)
inherited

Invoke function object at the location where key is currently registered if the key is registered.

Parameters
fFunctor to apply. Unary operator, receives key as parameter.
keyKey that may not be registered when method is invoked

◆ unordered_invoke_where()

void stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::unordered_invoke_where ( Functor &&  f,
std::size_t const &  key 
)
inherited

Invoke function object at the location where key is currently registered, disregarding RMI causal ordering.

Parameters
fFunctor to apply. Unary operator, receives key as parameter.
keyRegistered key

◆ locality()

locality_info stapl::detail::directory_base< std::size_t , try_transmitter , boost::function< std::pair< location_type, loc_qual >(size_t)> , use_default , EnableMigration >::locality ( std::size_t const &  key)
inherited

Provide locality information about a key managed by the directory.

Parameters
keyregistered key
Note
Used by containers that inherit / customize directory behavior.

◆ get_location_md()

runtime::location_md& stapl::p_object::get_location_md ( void  )
noexceptinherited

Returns the location metadata of the location this object registered in. noexcept

noexcept

◆ advance_epoch()

void stapl::p_object::advance_epoch ( void  )
inherited

Advances the epoch of the object.

Advancing the epoch will flush any pending RMIs. It will also increase the epoch of the current gang if the object is not a named object.

◆ unlock()

void stapl::p_object::unlock ( void  )
inherited

Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs.

Mutates counter in the associated runqueue.

◆ lock()

void stapl::p_object::lock ( void  )
inherited

Used by lock_guard functionality in method of derived classes to request atomicity with respect to incoming RMIs.

Mutates counter in the associated runqueue.

◆ try_lock()

bool stapl::p_object::try_lock ( void  )
inherited

Attempt to maintain atomicity with respect to incoming RMIs.

Mutates counter in the associated runqueue.

Returns
true if the lock was able to be acquired. false if it is already locked.

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