STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::interval_registry< Home, Compare > Class Template Reference

This class is used to store directory entries in the container_directory class and subsequently, its base class directory. It models the map concept. For most pContainers, it is a safe assumption to expect that most GIDs will be mapped to the home location and that there will be only a small amount of GIDs that differ from this closed-form solution (through migration, etc.) More...

Public Member Functions

 interval_registry (void)
 Construct a registry with a stateless home functor.
 
 interval_registry (Home const &home)
 Construct a registry with a given home function. More...
 
template<typename Partition , typename Mapper >
void reset_home (Partition const &partition, Mapper const &mapper)
 Resets the partition and mapper stored in m_home. More...
 
void clear (void)
 Clear all of the currently mapped GIDs in the registry.
 
bool empty (void) const
 Return whether or not this registry has any entries.
 
value_type operator[] (key_type const &key) const
 Lookup in the registry on which location a GID resides. More...
 
void insert (std::pair< key_type, value_type > const &val)
 Register the locality of a single GID. More...
 
template<typename Keys >
void insert (std::pair< Keys, value_type > const &val)
 Register the locality of a range of GIDs. More...
 
const_iterator find (key_type const &key) const
 Lookup in the registry on which location a GID resides. More...
 
void erase (key_type const &key)
 Erase a mapping of a GID from a location. More...
 
const_iterator end (void) const
 Returns a value representing the end of the registry.
 
bool contains (key_type const &key) const
 Returns whether or not a given key is mapped in the registry. More...
 
std::pair< key_type, location_type > shift_right (key_type const &key)
 Return the first element in the interval to right of that containing key as well as the location key is mapped to. More...
 
std::pair< key_type, location_type > shift_left (key_type const &key, key_type const &target_key)
 Remove the last key in the interval containing key. Return the last key in the adjacent interval to the left together with the location this interval maps to, so that last gid can be updated. More...
 

Public Types

typedef Home::gid_type key_type
 GID type.
 
typedef Home::value_type value_type
 Location type.
 
typedef storage_type::const_iterator const_iterator
 

Detailed Description

template<typename Home, typename Compare = std::less<typename Home::gid_type>>
class stapl::interval_registry< Home, Compare >

This class is used to store directory entries in the container_directory class and subsequently, its base class directory. It models the map concept. For most pContainers, it is a safe assumption to expect that most GIDs will be mapped to the home location and that there will be only a small amount of GIDs that differ from this closed-form solution (through migration, etc.)

For this registry, GIDs are explicitly stored in aggregates through the use of an interval_map from the Boost ICL library. That is, if the registry logically stores the GIDs {0, 1, 2, 5, 6, 7}, they will be aggregated into the ranges {[0..2], [5..7]}. This requires that the GIDs can be properly aggregated into intervals.

Template Parameters
HomeThe manager function object
Theless than comparator used internally in the ICL map.

Constructor & Destructor Documentation

◆ interval_registry()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
stapl::interval_registry< Home, Compare >::interval_registry ( Home const &  home)
explicit

Construct a registry with a given home function.

Parameters
homeThe manager function object

Member Function Documentation

◆ reset_home()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
template<typename Partition , typename Mapper >
void stapl::interval_registry< Home, Compare >::reset_home ( Partition const &  partition,
Mapper const &  mapper 
)

Resets the partition and mapper stored in m_home.

Parameters
partitionview-based partition of a data distribution.
mapperview-based mapper of a data distribution.

◆ operator[]()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
value_type stapl::interval_registry< Home, Compare >::operator[] ( key_type const &  key) const

Lookup in the registry on which location a GID resides.

Parameters
keyKey to look up in the registry
Returns
An iterator that when dereferenced returns a std::pair with the key and the location of the key.

◆ insert() [1/2]

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
void stapl::interval_registry< Home, Compare >::insert ( std::pair< key_type, value_type > const &  val)

Register the locality of a single GID.

Parameters
valKey-value pair to insert into the registry

◆ insert() [2/2]

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
template<typename Keys >
void stapl::interval_registry< Home, Compare >::insert ( std::pair< Keys, value_type > const &  val)

Register the locality of a range of GIDs.

Parameters
valKey-value pair where the first is an interval of GIDs and the second is the location

◆ find()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
const_iterator stapl::interval_registry< Home, Compare >::find ( key_type const &  key) const

Lookup in the registry on which location a GID resides.

Parameters
keyKey to look up in the registry
Returns
An iterator that when dereferenced returns a std::pair with the key and the location of the key.

◆ erase()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
void stapl::interval_registry< Home, Compare >::erase ( key_type const &  key)

Erase a mapping of a GID from a location.

Parameters
keyKey to remove from the directory

◆ contains()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
bool stapl::interval_registry< Home, Compare >::contains ( key_type const &  key) const

Returns whether or not a given key is mapped in the registry.

Parameters
keyThe key to query
Returns
True if any mapping of this key is in the directory

◆ shift_right()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
std::pair<key_type, location_type> stapl::interval_registry< Home, Compare >::shift_right ( key_type const &  key)

Return the first element in the interval to right of that containing key as well as the location key is mapped to.

Used for insertion in dynamic containers.

◆ shift_left()

template<typename Home , typename Compare = std::less<typename Home::gid_type>>
std::pair<key_type, location_type> stapl::interval_registry< Home, Compare >::shift_left ( key_type const &  key,
key_type const &  target_key 
)

Remove the last key in the interval containing key. Return the last key in the adjacent interval to the left together with the location this interval maps to, so that last gid can be updated.

Used for erasure in dynamic containers.


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