The container manager is responsible for local metadata for GIDs. It knows in which local base containers GIDs reside. It also provides methods to invoke base container methods on specific GIDs, abstracting out the need for external classes to know exactly in which base container a GID is. More...
Public Member Functions | |
template<typename Partition , typename Mapper > | |
container_manager (Partition const &partition, Mapper const &mapper) | |
Constructor that initializes the initial metadata for base containers. More... | |
template<typename Partition , typename Mapper > | |
container_manager (Partition const &partition, Mapper const &mapper, boost::mpl::false_) | |
template<typename Partition , typename Mapper > | |
container_manager (Partition const &partition, Mapper const &mapper, value_type const &default_value) | |
Constructor that initializes the initial metadata for base containers and populates containers with a default value. More... | |
template<typename PartitionContainer , typename Partition , typename Mapper > | |
container_manager (PartitionContainer const *const part_cont, Partition const &partition, Mapper const &mapper, typename std::enable_if< std::is_same< typename PartitionContainer::value_type, arbitrary_partition_info >::value >::type *=0) | |
Constructs the set of base containers required by the arbitrary distribution specified by the elements of part_cont . More... | |
template<typename PartitionContainer , typename Partition , typename Mapper > | |
container_manager (PartitionContainer const *const part_cont, Partition const &partition, Mapper const &mapper, value_type const &default_value, typename std::enable_if< std::is_same< typename PartitionContainer::value_type, arbitrary_partition_info >::value >::type *=0) | |
Constructs the set of base containers required by the arbitrary distribution specified by the elements of part_cont . All elements constructed in the base containers will be initialized to default_value . More... | |
template<typename PartitionContainer , typename Partition , typename Mapper > | |
container_manager (PartitionContainer const *const part_cont, Partition const &partition, Mapper const &mapper, boost::mpl::false_) | |
Constructor used by associative containers to avoid creation of base containers until elements are inserted into the container. More... | |
container_manager (container_manager const &other) | |
container_manager & | operator= (container_manager const &other) |
template<typename Partition , typename Mapper > | |
void | redistribute (Partition const &partition, Mapper const &mapper, typename std::enable_if< is_view_based< Partition >::value &&is_view_based< Mapper >::value >::type *=0) |
Performs redistribution of the container elements into a new set of bContainers on possibly different locations to match the distribution specified by the partition and mapper provided. More... | |
size_t | rank (base_container_type *bc) |
Return the global rank of this base container in the pContainer. More... | |
cid_type | within (gid_type const &gid) |
Return which base container a specified GID is in. More... | |
void | add_element (gid_type const &gid, value_type const &val) |
Adds an element (container element) to this base container manager. Updates metadata accordingly. More... | |
void | remove_element (gid_type const &gid) |
Removes an element from this base container manager. Updates metadata accordingly. More... | |
void | clear (void) |
bool | contains (gid_type const &gid) const |
Returns whether or not this base container manager is responsible for an element. More... | |
size_t | num_elements (void) const |
Returns number of elements in all base containers owned by this base container manager. | |
template<typename Functor > | |
void | apply_set (gid_type const &gid, Functor const &f) |
Applies an arbitrary functor to the element with specified GID. More... | |
template<typename Functor , typename Container > | |
void | apply (gid_type const &gid, Functor const &f, Container *container) |
Applies a function f to the element specified by the GID. More... | |
template<typename Functor > | |
bool | contains_apply_set (gid_type const &gid, Functor const &f) |
Applies an arbitrary functor to the element at position GID if the element exists at this location. More... | |
template<typename Functor > | |
boost::result_of< Functor(value_type &)>::type | apply_get (gid_type const &gid, Functor const &f) |
Applies an arbitrary functor to the element with specified GID and returns the result. More... | |
template<typename Functor > | |
Functor::result_type | apply_get (gid_type const &gid, Functor const &f) const |
Applies an arbitrary functor to the element with specified GID and returns the result. More... | |
template<typename Functor > | |
boost::optional< typename Functor::result_type > | contains_apply_get (gid_type const &gid, Functor const &f) |
Applies an arbitrary functor to the element at position GID if the element exists at this location. More... | |
template<typename Functor > | |
boost::optional< typename boost::result_of< Functor(value_type &)>::type > | contains_apply_get (gid_type const &gid, Functor const &f) const |
Applies an arbitrary functor to the element at position GID if the element exists at this location. More... | |
template<typename Class , typename... PMFArgs, typename... Args> | |
bool | contains_invoke (gid_type const &gid, void(Class::*pmf)(PMFArgs...), Args &&... args) |
Invokes a base container method on the given gid if it is present on this location. More... | |
template<typename Class , typename Rtn , typename... PMFArgs, typename... Args> | |
boost::optional< Rtn > | contains_invoke (gid_type const &gid, Rtn(Class::*pmf)(PMFArgs...), Args &&... args) |
Invokes a base container method on the given gid if it is present on this location. More... | |
template<typename Class , typename... PMFArgs, typename... Args> | |
void | invoke (gid_type const &gid, void(Class::*const pmf)(PMFArgs...), Args &&... args) |
Invoke a base container method on an element at a certain GID. The element must exist in the current base container manager. More... | |
template<typename Class , typename Rtn , typename... PMFArgs, typename... Args> | |
Rtn | invoke (gid_type const &gid, Rtn(Class::*pmf)(PMFArgs...), Args &&... args) |
Invoke a base container method on an element at a certain GID. The the result. The element must exist in the current base container manager. More... | |
template<typename Class , typename Rtn , typename... PMFArgs, typename... Args> | |
Rtn | const_invoke (gid_type const &gid, Rtn(Class::*const pmf)(PMFArgs...), Args &&... args) const |
Invoke a base container method on an element at a certain GID. The the result. The element must exist in the current base container manager. More... | |
template<typename Comparator , typename Class , typename... PMFArgs, typename... Args> | |
void | min_invoke (Comparator const &comp, void(Class::*pmf)(PMFArgs...), Args &&... args) |
Invoke a base container method returning void on the base container that minimizes a user-defined comparator over the base containers. More... | |
template<typename Comparator , typename Class , typename Rtn , typename... PMFArgs, typename... Args> | |
Rtn | min_invoke (Comparator const &comp, Rtn(Class::*pmf)(PMFArgs...), Args &&... args) |
Invoke a base container method returning void on the base container that minimizes a user-defined comparator over the base containers. More... | |
Public Types | |
typedef BContainer | base_container_type |
typedef Registry | storage_type |
typedef base_container_ordering | ordering_type |
Type of base container ordering that will be enforced. | |
typedef ordering_type::ptr_bcontainer_type | ptr_bcontainer_type |
Public Attributes | |
ordering_type | m_ordering |
Handle ordering amongst base containers across all locations. | |
The container manager is responsible for local metadata for GIDs. It knows in which local base containers GIDs reside. It also provides methods to invoke base container methods on specific GIDs, abstracting out the need for external classes to know exactly in which base container a GID is.
The container manager can be seen as the local equivalent of container_directory.
BContainer | The base container class. |
stapl::container_manager< BContainer, Registry >::container_manager | ( | Partition const & | partition, |
Mapper const & | mapper | ||
) |
Constructor that initializes the initial metadata for base containers.
partition | Partition object that translates GIDs to CIDs |
mapper | Mapper object that translates CIDs to locations. |
stapl::container_manager< BContainer, Registry >::container_manager | ( | Partition const & | partition, |
Mapper const & | mapper, | ||
value_type const & | default_value | ||
) |
Constructor that initializes the initial metadata for base containers and populates containers with a default value.
partition | Partition object that translates GIDs to CIDs |
mapper | Mapper object that translates CIDs to locations. |
default_value | The initial value to populate the containers |
stapl::container_manager< BContainer, Registry >::container_manager | ( | PartitionContainer const *const | part_cont, |
Partition const & | partition, | ||
Mapper const & | mapper, | ||
typename std::enable_if< std::is_same< typename PartitionContainer::value_type, arbitrary_partition_info >::value >::type * | = 0 |
||
) |
Constructs the set of base containers required by the arbitrary distribution specified by the elements of part_cont
.
The container is provided along with the partition and mapper classes to allow construction of base containers by reading directly from the container. The partition and mapper parameters are still required by the base class and manager to allow for later retrieval of elements.
part_cont | Container of arb_partition_info elements that specifies an arbitrary distribution |
partition | Partition object that captures the GID to partition id mapping of the part_cont elements. |
mapper | Mapper object that captures the partition id to location id mapping of the part_cont elements. |
stapl::container_manager< BContainer, Registry >::container_manager | ( | PartitionContainer const *const | part_cont, |
Partition const & | partition, | ||
Mapper const & | mapper, | ||
value_type const & | default_value, | ||
typename std::enable_if< std::is_same< typename PartitionContainer::value_type, arbitrary_partition_info >::value >::type * | = 0 |
||
) |
Constructs the set of base containers required by the arbitrary distribution specified by the elements of part_cont
. All elements constructed in the base containers will be initialized to default_value
.
The container is provided along with the partition and mapper classes to allow construction of base containers by reading directly from the container. The partition and mapper parameters are still required by the base class and manager to allow for later retrieval of elements.
part_cont | Container of arb_partition_info elements that specifies an arbitrary distribution |
partition | Partition object that captures the GID to partition id mapping of the part_cont elements |
mapper | Mapper object that captures the partition id to location id mapping of the part_cont elements |
default_value | Value assigned to each element stored in a base container |
stapl::container_manager< BContainer, Registry >::container_manager | ( | PartitionContainer const *const | part_cont, |
Partition const & | partition, | ||
Mapper const & | mapper, | ||
boost::mpl::false_ | |||
) |
Constructor used by associative containers to avoid creation of base containers until elements are inserted into the container.
Associative containers work by distributing the domain of the possible GIDs of elements that might be stored in the container. In order to avoid creating a large number of empty base containers that will not be used the constructor here does nothing.
part_cont | Container of arb_partition_info elements that specifies an arbitrary distribution |
partition | Partition object that captures the GID to partition id mapping of the part_cont elements |
mapper | Mapper object that captures the partition id to location id mapping of the part_cont elements |
void stapl::container_manager< BContainer, Registry >::redistribute | ( | Partition const & | partition, |
Mapper const & | mapper, | ||
typename std::enable_if< is_view_based< Partition >::value &&is_view_based< Mapper >::value >::type * | = 0 |
||
) |
Performs redistribution of the container elements into a new set of bContainers on possibly different locations to match the distribution specified by the partition and mapper provided.
partition | provides methods necessary to map element GIDs to the ids of the partitions (bContainers) that will store them. |
mapper | provides the methods necessary to map partition ids to the ids of the locations that will store the partitions. |
The method is only available when view-based partition and mapper instances are used. The distributor instance is given the partition and mapper information in the constructor. The distributor function operator is given the current set of bContainers and their ordering in order to perform the redistribution.
size_t stapl::container_manager< BContainer, Registry >::rank | ( | base_container_type * | bc | ) |
Return the global rank of this base container in the pContainer.
cid_type stapl::container_manager< BContainer, Registry >::within | ( | gid_type const & | gid | ) |
Return which base container a specified GID is in.
void stapl::container_manager< BContainer, Registry >::add_element | ( | gid_type const & | gid, |
value_type const & | val | ||
) |
Adds an element (container element) to this base container manager. Updates metadata accordingly.
gid | GID of the element to be added. |
val | Value of the element to be added. |
void stapl::container_manager< BContainer, Registry >::remove_element | ( | gid_type const & | gid | ) |
Removes an element from this base container manager. Updates metadata accordingly.
gid | GID of the element to be removed. |
|
inherited |
Returns whether or not this base container manager is responsible for an element.
gid | GID for the element in question. |
|
inherited |
Applies an arbitrary functor to the element with specified GID.
gid | GID of the element on which to apply the functor |
f | Functor to apply |
|
inherited |
Applies a function f to the element specified by the GID.
gid | The GID of the element. |
f | The Functor to apply on the element. |
|
inherited |
Applies an arbitrary functor to the element at position GID if the element exists at this location.
gid | GID of the element on which to apply the functor. |
f | Functor to apply. |
|
inherited |
Applies an arbitrary functor to the element with specified GID and returns the result.
gid | GID of the element on which to apply the functor |
f | Functor to apply |
|
inherited |
Applies an arbitrary functor to the element with specified GID and returns the result.
gid | GID of the element on which to apply the functor |
f | Functor to apply |
|
inherited |
Applies an arbitrary functor to the element at position GID if the element exists at this location.
gid | GID of the element on which to apply the functor. |
f | Functor to apply. |
|
inherited |
Applies an arbitrary functor to the element at position GID if the element exists at this location.
gid | GID of the element on which to apply the functor. |
f | Functor to apply. |
|
inherited |
Invokes a base container method on the given gid
if it is present on this location.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |
|
inherited |
Invokes a base container method on the given gid
if it is present on this location.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |
|
inherited |
Invoke a base container method on an element at a certain GID. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |
|
inherited |
Invoke a base container method on an element at a certain GID. The the result. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |
|
inherited |
Invoke a base container method on an element at a certain GID. The the result. The element must exist in the current base container manager.
gid | The GID of the element to invoke the method on. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |
|
inherited |
Invoke a base container method returning void on the base container that minimizes a user-defined comparator over the base containers.
comp | Comparator that receives two base containers and returns the more optimal of the two. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |
|
inherited |
Invoke a base container method returning void on the base container that minimizes a user-defined comparator over the base containers.
comp | Comparator that receives two base containers and returns the more optimal of the two. |
pmf | A pointer to a base container's member method. |
args | Arguments to pmf . |