Specialization with migration support. More...
Public Member Functions | |
template<typename Function , typename MapperParam > | |
directory (Function &&f, MapperParam &&mapper_param, bool b_migration_enabled, bool b_enable_buffering) | |
Constructor used by PARAGRAPH. More... | |
template<typename Functor > | |
void | migrate (Key const &key, const location_type loc, Functor &&f) |
Change location a key is registered / associated with. After registry is updated, apply f is applied a new associated location. More... | |
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 (Key const &key) |
Attempt registration from the managing location. Return true if successful (i.e., not already registered). | |
void | register_key (Key const &key) |
Associate key in directory's registry with the location invoking this method. More... | |
void | register_keys (std::pair< Key, Key > const &keys) |
void | register_apply (Key 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 (Key const &key, Functor &&f, location_type location) |
Associate key in directory's registry with location invoking this method. More... | |
void | unregister_key (Key const &key) |
Unregister key in directory's registry. | |
void | unregister_apply (Key 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, Key const &key) |
Invoke function object at the location where key is currently registered. More... | |
void | try_invoke_where (Functor &&f, Key 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, Key const &key) |
Invoke function object at the location where key is currently registered, disregarding RMI causal ordering. More... | |
locality_info | locality (Key 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_md & | get_location_md (void) noexcept |
Returns the location metadata of the location this object registered in. noexcept More... | |
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 | base_directory_type = base_t |
using | manager_type = mapper_t |
using | registry_type = registry_t |
using | key_type = Key |
using | size_type = rmi_handle::size_type |
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 (Key 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 (Key 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 (Key const &key, void(Directory::*const pmf)(PMFArgs...), Args &&... args) |
Implementation of. More... | |
void | invoke_at_manager_impl (Key const &key, void(Directory::*const pmf)(PMFArgs...) const, Args &&... args) const |
Implementation of. More... | |
void | flush_pending (const location_type loc, Key const &key, queue_t &pending) |
Forward all buffered requests for key to location More... | |
void | request_forward (Key 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 (Key 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... | |
Protected Types | |
using | mapper_t = typename select_parameter< Mapper, detail::default_key_mapper< Key > >::type |
using | registry_t = typename select_parameter< Registry, boost::unordered_map< Key, location_type, boost::hash< Key >, std::equal_to< Key >, pool_allocator< std::pair< Key const, location_type > > > >::type |
using | transmitter_type = typename select_parameter< Transmitter, async_transmitter >::type |
using | queue_t = request_queue< request_t > |
using | queues_t = boost::unordered_map< Key, queue_t, stapl::hash< Key >, std::equal_to< Key >, pool_allocator< std::pair< Key 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 |
Specialization with migration support.
stapl::directory< Key, Transmitter, Mapper, Registry, true >::directory | ( | Function && | f, |
MapperParam && | mapper_param, | ||
bool | b_migration_enabled, | ||
bool | b_enable_buffering | ||
) |
Constructor used by PARAGRAPH.
f | Unary functor passed key and return true iff current location has key registered here (in this context, a wrapper around an edge_container method). |
b_migration_enabled | Specifies whether object allows key migration. |
b_enable_buffering | Specifies whether directory requests using ARMI are buffered. |
void stapl::directory< Key, Transmitter, Mapper, Registry, true >::migrate | ( | Key const & | key, |
const location_type | loc, | ||
Functor && | f | ||
) |
Change location a key is registered / associated with. After registry is updated, apply f is applied a new associated location.
key | Key whose registered location is to be updated. |
loc | Location which key should now be associated with. |
f | Nullary function object applied at loc after the registry is updated. |
|
protectedinherited |
Internal method, target of RMI called via migrate_impl to invoke functor f
at new registration location, post registry update.
f | Nullary functor to apply. |
|
protectedinherited |
Forwards functor and arguments to location managing key
. The location managing the key will invoke the method with the supplied arguments.
key | Key value whose managing location (i.e., where registry entry is stored) is where pmf will be invoked. |
pmf | Directory member function to be invoked. |
args | variadic 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.
|
protectedinherited |
Forwards const functor and arguments to location managing key
. The location managing the key will invoke the method with the supplied arguments.
key | Key value whose managing location (i.e., where registry entry is stored) is where pmf will be invoked. |
pmf | Directory const member function to be invoked. |
args | variadic 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.
|
protectedinherited |
Implementation of.
Trans | The transmitter type |
|
protectedinherited |
Implementation of.
Trans | The given transmitter type |
|
protectedinherited |
Forward all buffered requests for key
to location loc
.
loc | Location to send buffered requests to. |
key | Key value buffered requests are for. |
pending | Pending queue associated with Key . |
This is internal method only called on the directory location managing key
.
|
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.
key | Key whose registered location determines where f should be executed. |
f | Functor to invoke (unary, key passed as parameter). |
Called by invoke_where and execute (the latter when migration enabled).
|
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.
key | Key whose registered location determines where f should be executed. |
f | Functor to invoke (unary, key passed as parameter). |
Called by invoke_where and execute (the latter when migration enabled).
|
inherited |
Associate key
in directory's registry with the location invoking this method.
|
inherited |
Associate key
in directory's registry with location invoking this method. Registration location is implicitly set to be caller of this method.
key | Key to register. |
f | Unary function object (receives key ) as parameter to call after registration. |
|
inherited |
Associate key
in directory's registry with location invoking this method.
key | Key to registered. |
f | Unary function object (receives key ) as parameter to call after registration. |
location | Location this key should be mapped to in the registry. |
|
inherited |
Unregister key
and apply a function object f
at location where directory's registry manages key
.
key | Key to unregister. |
f | Unary function object (receives key ) as parameter to call after unregistration. |
|
inherited |
Invoke function object at the location where key is currently registered.
f | Functor to apply. Unary operator, receives key as parameter. |
key | Registered key |
|
inherited |
Invoke function object at the location where key is currently registered if the key is registered.
f | Functor to apply. Unary operator, receives key as parameter. |
key | Key that may not be registered when method is invoked |
|
inherited |
Invoke function object at the location where key is currently registered, disregarding RMI causal ordering.
f | Functor to apply. Unary operator, receives key as parameter. |
key | Registered key |
|
inherited |
Provide locality information about a key managed by the directory.
key | registered key |
|
noexceptinherited |
Returns the location metadata of the location this object registered in. noexcept
noexcept
|
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.
|
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.
|
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.
|
inherited |
Attempt to maintain atomicity with respect to incoming RMIs.
Mutates counter in the associated runqueue.
true
if the lock was able to be acquired. false
if it is already locked.