STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Public Attributes | Protected Member Functions
stapl::base_container_ordering Struct Reference

Defines an object that keeps track of the ordering of base containers in a pContainer. More...

Public Member Functions

void clear (void)
 Remove all information related to the current ordering. More...
 
ptr_bcontainer_type prev (bc_base *bc) const
 Returns the ordering pointer to the previous base container of the given base container bc.
 
ptr_bcontainer_type next (bc_base *bc) const
 Returns the ordering pointer to the next base container of the given base container bc.
 
bc_basefirst () const
 Returns the pointer to the first local base container based on the local order.
 
bc_baselast () const
 Returns the pointer to the last local base container based on the local order.
 
void set_prev (bcontainer_id_type id, ptr_bcontainer_type const &new_prev)
 Updates the previous link information for the local base container referenced for id, with the given ordering pointer new_prev.
 
void set_next (bcontainer_id_type id, ptr_bcontainer_type const &new_next)
 Updates the next link information for the local base container referenced for id, with the given ordering pointer new_next.
 
bcontainer_id_type find_id (bc_base *bc)
 Returns the associated local identifier from the given base container pointer.
 
bc_baseoperator[] (bcontainer_id_type id) const
 
void insert (bc_base *pos, bc_base *bc, size_t rank=0)
 Inserts the given base container bc, before the base container pos, assigning it the specified rank.
 
void insert_after (bc_base *pos, bc_base *bc, size_t rank=0)
 Inserts the given base container bc, after the base container pos, assigning it the specified rank.
 
void insert (bc_base *bc, size_t rank, location_type next_loc, size_t next_rank)
 Inserts the given base container bc locally and sets the previous base container information for the next base container specified, as well as the next base container information of the base container being inserted. More...
 
template<typename Functor >
void traverse_fw_helper (Functor func, bcontainer_id_type id) const
 Helper function to invoke the forward traversal visitor with the given functor func over the local base container identified with id.
 
template<typename Functor >
void traverse_bw_helper (Functor func, bcontainer_id_type id) const
 Helper function to invoke the backward traversal visitor with the given functor func over the local base container identified with id.
 
template<typename Functor >
void traverse_forward (Functor func, bc_base *bc, bool is_end=false) const
 Visitor that applies the specified functor over the given base container bc and continues its forward traversal until the stop condition is reached.
 
template<typename Functor >
void traverse_backward (Functor func, bc_base *bc, bool is_end=false) const
 Visitor that applies the specified functor over the given base container bc and continues its backward traversal until the stop condition is reached.
 
template<typename Functor >
void find_first (Functor &func) const
 Find the first base container in the ordering based on the ordering information, and then iterate forward through the ordering to skip over empty base containers. More...
 
template<typename Functor >
void find_last (Functor &func) const
 Find the last base container in the ordering based on the ordering information, and then iterate backward through the ordering to skip over empty base containers. More...
 
void remove (bc_base *pos)
 Removes the specified base container bc from the ordering object.
 
void migrate (bc_base *mbc, follow_bcontainers_type conn)
 Inserts the given migrated base container mbc and updates the links based on the given connection information conn.
 
void move (bc_base *bc, location_type loc)
 Moves the specified base container bc to the given location loc.
 
void replace (bc_base *old_bc, bc_base *new_bc)
 Replaces the given base container old_bc with the given new base container new_bc in the base container ordering.
 
void set_rank (size_t id, size_t rank)
 Set the rank for the base container associated with the local identifier id.
 
size_t get_rank (size_t id)
 Returns the rank of the base container associated with the local identifier id.
 
size_t get_rank (bc_base *bc)
 Returns the rank of the base container bc.
 
size_t total_number_base_containers () const
 
std::vector< aux_infoget_init_rank (size_t steps)
 Helper function to initialize the auxiliary information needed to compute the base container ranking. 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...
 
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

typedef size_t bcontainer_id_type
 
typedef bc_base base_container_type
 
typedef ordering_impl::ptr_bcontainer ptr_bcontainer_type
 
typedef ordering_impl::node node_type
 
typedef node_type follow_bcontainers_type
 
typedef std::map< bc_base *, follow_bcontainers_typebcontainer_dir_type
 
typedef boost::bimaps::bimap< size_t, bc_base * > local_indexing_type
 
typedef local_indexing_type::value_type local_idx_entry_type
 
using size_type = rmi_handle::size_type
 

Public Attributes

location_type m_first_loc
 Location on which the first base container is stored.
 
location_type m_last_loc
 Location on which the last base container is stored.
 
bcontainer_dir_type m_follows
 Keeps track of the links between base containers.
 
local_indexing_type m_local_indexing
 local mapping of base containers.
 
bcontainer_id_type m_first
 Local Id of the first local base container.
 
bcontainer_id_type m_last
 Local Id of the last valid local base container.
 
size_t m_key
 Keeps track of the next valid local id.
 
bool m_is_ordered
 Flag to determine if the base containers are in order.
 
size_t m_total_num_bc
 Total number of base containers in the pContainer.
 
std::map< size_t, ptr_bcontainer_typem_prev_info
 Buffer of base container predecessor information.
 

Protected Member Functions

void set_first_loc (location_type loc)
 Records the id of the location that reports itself as storing the first base container in the ordering. More...
 
void set_last_loc (location_type loc)
 Records the id of the location that reports itself as storing the last base container in the ordering. More...
 
size_t local_indexing_size (void) const
 Returns the number of locally mapped base containers.
 

Detailed Description

Defines an object that keeps track of the ordering of base containers in a pContainer.

Member Function Documentation

◆ clear()

void stapl::base_container_ordering::clear ( void  )

Remove all information related to the current ordering.

◆ set_first_loc()

void stapl::base_container_ordering::set_first_loc ( location_type  loc)
protected

Records the id of the location that reports itself as storing the first base container in the ordering.

Parameters
locLocation reporting that it is storing the first base container

The reporting of the first and last locations in the ordering is an optimization that allows the linear traversal of base containers in the ordering to find the first or last element in the container.

◆ set_last_loc()

void stapl::base_container_ordering::set_last_loc ( location_type  loc)
protected

Records the id of the location that reports itself as storing the last base container in the ordering.

Parameters
locLocation reporting that it is storing the last base container

The reporting of the first and last locations in the ordering is an optimization that allows the linear traversal of base containers in the ordering to find the first or last element in the container.

◆ insert()

void stapl::base_container_ordering::insert ( bc_base bc,
size_t  rank,
location_type  next_loc,
size_t  next_rank 
)

Inserts the given base container bc locally and sets the previous base container information for the next base container specified, as well as the next base container information of the base container being inserted.

Parameters
bcBase container to insert in the ordering
rankRank of the base container being inserted
next_locLocation of the next base container after bc.
next_rankRank of the next base container after bc.
Note
If this method is used to construct a pContainer it must be used exclusively, as it uses the base container rank as the key while the other insert methods use a local key.

◆ find_first()

template<typename Functor >
void stapl::base_container_ordering::find_first ( Functor &  func) const

Find the first base container in the ordering based on the ordering information, and then iterate forward through the ordering to skip over empty base containers.

This method is used in the implementation of distribution begin() methods.

Parameters
funcFunctor storing the promise that will be set to notify the original calling location of the result.

◆ find_last()

template<typename Functor >
void stapl::base_container_ordering::find_last ( Functor &  func) const

Find the last base container in the ordering based on the ordering information, and then iterate backward through the ordering to skip over empty base containers.

This method is used in the implementation of distribution end() methods.

Parameters
funcFunctor storing the promise that will be set to notify the original calling location of the result.

◆ total_number_base_containers()

size_t stapl::base_container_ordering::total_number_base_containers ( ) const

◆ get_init_rank()

std::vector<aux_info> stapl::base_container_ordering::get_init_rank ( size_t  steps)

Helper function to initialize the auxiliary information needed to compute the base container ranking.

Parameters
stepsNumber of elements needed to be initialized based on log(number of locations). Base container ranking uses a pointer jumping approach to compute the ranks.
Returns
A vector of size steps with the initialized values for each step.

◆ 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 struct was generated from the following file: