Specialization when this is a nested container. More...
Public Member Functions | |
template<typename DistSpecView > | |
std::enable_if<(is_distribution_view< DistSpecView >::value||detail::has_is_composed_dist_spec< DistSpecView >::value) &&is_view_based< partition_type >::value &&is_view_based< mapper_type >::value >::type | redistribute (DistSpecView const &dist_view) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided. More... | |
template<typename DistSpecView > | |
std::enable_if<(is_distribution_view< DistSpecView >::value||detail::has_is_composed_dist_spec< DistSpecView >::value) &&is_view_based< partition_type >::value &&is_view_based< mapper_type >::value >::type | redistribute (DistSpecView const *dist_view) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided. More... | |
void | destroy (void) |
Used as a target method for rmis implementing one-sided destruction, as a pointer to member variable referring to the destructor cannot be initialized, per the standard. Used when container is an element of another container. | |
size_t | get_num_locations (void) const |
location_type | get_location_id (void) const |
boost::shared_ptr< C > | shared_from_this () |
Constructors | |
container (void) | |
container (distribution_type const &distribution) | |
Creates a container with the given distribution. | |
container (partition_type const &ps, mapper_type const &map) | |
container (partition_type const &ps, mapper_type const &map, boost::mpl::false_ const ®) | |
Creates a container with a given size, partition and mapper. More... | |
container (partition_type const &ps, mapper_type const &map, value_type const &default_value) | |
Creates a container with a given size, partition and mapper, constructing all elements with the default value provided. More... | |
container (partition_type const &ps, mapper_type const &map, value_type const &default_value, policy::here) | |
Creates a container with a given size, partition and mapper, constructing all elements with the default value provided. More... | |
template<typename X , typename Y > | |
container (partition_type const &ps, mapper_type const &map, boost::tuples::cons< X, Y > const &dims) | |
Creates composed pContainers with given size-specifications, partition and mapper, Required for pC composition. More... | |
template<typename X , typename Y > | |
container (partition_type const &ps, mapper_type const &map, boost::tuples::cons< X, Y > const &dims, policy::here) | |
Creates composed pContainers with given size-specifications, partition and mapper, Required for pC composition. More... | |
template<typename SizesView > | |
container (partition_type const &ps, mapper_type const &map, SizesView const &sizes_view, typename std::enable_if< !detail::has_is_composed_dist_spec< SizesView >::value >::type *=0) | |
Constructor for composed containers. For a m level composed container, sizes_view is a m-1 level composed view representing the sizes of the nested containers. More... | |
template<typename DistSpecView , typename ComposedSpec > | |
container (std::shared_ptr< DistSpecView > dist_view, ComposedSpec const &comp_spec, typename std::enable_if< is_distribution_view< DistSpecView >::value &&detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *=0) | |
Constructor for composed containers. For a m level composed container, comp_spec is a m-1 level composed specification of the distributions of the nested containers. More... | |
template<typename DistSpecView , typename ComposedSpec > | |
container (std::shared_ptr< DistSpecView > dist_view, ComposedSpec const &comp_spec, boost::mpl::false_ const ®, typename std::enable_if< is_distribution_view< DistSpecView >::value &&detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *=0) | |
Constructor for composed containers. For an m level composed container, comp_spec is a m-1 level composed specification of the distributions of the nested containers. More... | |
~container (void) | |
Element Manipulation | |
void | set_element (index_type const &idx, value_type const &val) |
Sets the element specified by the index to the provided value. More... | |
template<typename View > | |
void | set_elements (index_type const &idx, View &&vals) |
Sets a range of elements starting with a given index to a sequence of provided values. More... | |
value_type | get_element (index_type const &idx) const |
Returns the value of the element specified by the index. More... | |
future< value_type > | get_element_split (index_type const &idx) |
Returns a stapl::future holding the value of the element specified by the index. More... | |
template<typename F > | |
void | apply_set (gid_type const &gid, F const &f) |
Applies a function f to the element specified by the GID. More... | |
template<typename F > | |
F::result_type | apply_get (gid_type const &gid, F const &f) |
Applies a function f to the element specified by the GID, and returns the result. More... | |
template<typename F > | |
F::result_type | apply_get (gid_type const &gid, F const &f) const |
Applies a function f to the element specified by the GID, and returns the result. More... | |
Public Types | |
typedef container_traits< C >::template construct_distribution< C >::type | distribution_type |
typedef index_type | gid_type |
typedef size_t | size_type |
Protected Member Functions | |
template<typename ComposedSpec > | |
void | redistribute_nested_containers (ComposedSpec const &comp_spec, typename std::enable_if< detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *=0) |
Invoke redistribution on nested container instances stored in the container. More... | |
Memory and Domain Management | |
domain_type | domain (void) const |
void | migrate (gid_type const &gid, location_type destination) |
Migrates the element specified by the gid to the destination location. More... | |
size_type | size (void) const |
Return the number of elements in the container. More... | |
bool | empty (void) const |
distribution_type & | distribution (void) |
distribution_type const & | distribution (void) const |
distribution_type * | get_distribution (void) |
locality_info | locality (gid_type gid) |
Return locality information about the element specified by the gid. More... | |
template<typename... Indices> | |
bool | is_local (Indices const &... i) const |
Returns true if the element specified by the GID formed from the index components provided is stored on this location, or false otherwise. | |
rmi_handle::reference | get_rmi_handle_reference (void) |
template<typename DistSpecView > | |
std::shared_ptr< DistSpecView > | get_spec (DistSpecView const &dist_view, typename std::enable_if< !detail::has_is_composed_dist_spec< DistSpecView >::value >::type *=0) |
Return a shared_ptr to the distribution specification for this container instance. More... | |
template<typename ComposedSpec > | |
std::shared_ptr< typename ComposedSpec::distribution_spec > | get_spec (ComposedSpec const &dist_view, typename std::enable_if< detail::has_is_composed_dist_spec< ComposedSpec >::value >::type *=0) |
Return a shared_ptr to the distribution specification for this container instance that is part of a composed container instantiation. More... | |
Specialization when this is a nested container.
stapl::container< C, true >::container | ( | partition_type const & | ps, |
mapper_type const & | map | ||
) |
Creates a container with a given size, partition and mapper, default constructing all values.
stapl::container< C, true >::container | ( | partition_type const & | ps, |
mapper_type const & | map, | ||
boost::mpl::false_ const & | reg | ||
) |
Creates a container with a given size, partition and mapper.
The reg
parameter is used by map constructors to prevent keys from being pre-registered as the container is constructed.
stapl::container< C, true >::container | ( | partition_type const & | ps, |
mapper_type const & | map, | ||
value_type const & | default_value | ||
) |
Creates a container with a given size, partition and mapper, constructing all elements with the default value provided.
stapl::container< C, true >::container | ( | partition_type const & | ps, |
mapper_type const & | map, | ||
value_type const & | default_value, | ||
policy::here | |||
) |
Creates a container with a given size, partition and mapper, constructing all elements with the default value provided.
Distributes the nested containers on this location locally.
stapl::container< C, true >::container | ( | partition_type const & | ps, |
mapper_type const & | map, | ||
boost::tuples::cons< X, Y > const & | dims | ||
) |
Creates composed pContainers with given size-specifications, partition and mapper, Required for pC composition.
ps | The partition for this container. |
map | The mapper for this container. |
dims | dimensions of the internal containers. |
stapl::container< C, true >::container | ( | partition_type const & | ps, |
mapper_type const & | map, | ||
boost::tuples::cons< X, Y > const & | dims, | ||
policy::here | |||
) |
Creates composed pContainers with given size-specifications, partition and mapper, Required for pC composition.
ps | The partition for this container. |
map | The mapper for this container. |
dims | dimensions of the internal containers. |
Distributes the nested containers on this location locally.
stapl::container< C, true >::container | ( | partition_type const & | ps, |
mapper_type const & | map, | ||
SizesView const & | sizes_view, | ||
typename std::enable_if< !detail::has_is_composed_dist_spec< SizesView >::value >::type * | = 0 |
||
) |
Constructor for composed containers. For a m level composed container, sizes_view
is a m-1 level composed view representing the sizes of the nested containers.
ps | The partition for this container. |
map | The mapper for this container. |
sizes_view | Sizes for nested containers stored in the container. |
stapl::container< C, true >::container | ( | std::shared_ptr< DistSpecView > | dist_view, |
ComposedSpec const & | comp_spec, | ||
typename std::enable_if< is_distribution_view< DistSpecView >::value &&detail::has_is_composed_dist_spec< ComposedSpec >::value >::type * | = 0 |
||
) |
Constructor for composed containers. For a m level composed container, comp_spec
is a m-1 level composed specification of the distributions of the nested containers.
dist_view | The distribution specification for this container. |
comp_spec | Distribution specification of the nested containers to initialize. |
stapl::container< C, true >::container | ( | std::shared_ptr< DistSpecView > | dist_view, |
ComposedSpec const & | comp_spec, | ||
boost::mpl::false_ const & | reg, | ||
typename std::enable_if< is_distribution_view< DistSpecView >::value &&detail::has_is_composed_dist_spec< ComposedSpec >::value >::type * | = 0 |
||
) |
Constructor for composed containers. For an m level composed container, comp_spec
is a m-1 level composed specification of the distributions of the nested containers.
dist_view | The distribution specification for this container. |
comp_spec | Distribution specification of the nested containers to initialize. |
reg | Flag to indicate that the GIDs of the container are not to be registered. This is used for associative containers such as map. |
|
protected |
Invoke redistribution on nested container instances stored in the container.
This function is called by redistribute of the derived container. It forwards the composed distribution specification to each of the containers that will be redistributed in the map_func execution.
comp_spec | Composed specification of target distributions |
std::enable_if< (is_distribution_view<DistSpecView>::value || detail::has_is_composed_dist_spec<DistSpecView>::value) && is_view_based<partition_type>::value && is_view_based<mapper_type>::value>::type stapl::container< C, true >::redistribute | ( | DistSpecView const & | dist_view | ) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided.
dist_view | View-based specification of the desired distribution. |
std::enable_if< (is_distribution_view<DistSpecView>::value || detail::has_is_composed_dist_spec<DistSpecView>::value) && is_view_based<partition_type>::value && is_view_based<mapper_type>::value>::type stapl::container< C, true >::redistribute | ( | DistSpecView const * | dist_view | ) |
Redistribute the data stored in the container to match the distribution specified by the distribution view provided.
dist_view | View-based specification of the desired distribution. |
This function is invoked from the proxy when nested containers are being redistributed.
|
inherited |
Sets the element specified by the index to the provided value.
idx | GID of the element to be set. |
val | The new value of the element. |
|
inherited |
Sets a range of elements starting with a given index to a sequence of provided values.
idx | GID of start of element range to be set. |
vals | The new values to be assigned to the element range. |
|
inherited |
Returns the value of the element specified by the index.
idx | GID of the element to be retrieved. |
|
inherited |
Returns a stapl::future holding the value of the element specified by the index.
idx | GID of the element to be set. |
|
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 a function f to the element specified by the GID, and returns the result.
gid | The GID of the element. |
f | The Functor to apply on the element. |
|
inherited |
Applies a function f to the element specified by the GID, and returns the result.
gid | The GID of the element. |
f | The Functor to apply on the element. |
|
inherited |
|
inherited |
Migrates the element specified by the gid to the destination location.
gid | GID of the element to be migrated. |
destination | Id of the location where the element is to be migrated. |
|
inherited |
Return the number of elements in the container.
This method is one-sided, If other locations may be concurrently performing operations that change their local size and the effects are desired to be observed in a deterministic way, then appropriate synchronization, e.g. a fence, may be required before or after the call to size, to enforce appropriate ordering.
|
inherited |
Return locality information about the element specified by the gid.
|
protectedinherited |
Return a shared_ptr to the distribution specification for this container instance.
This function is called by redistribute when the distribution specification provided is for a single container instance instead of a collection of composed container instance.
dist_view | Instantiation of distribution_spec that describes the target distribution for redistribute |
|
protectedinherited |
Return a shared_ptr to the distribution specification for this container instance that is part of a composed container instantiation.
This function is called by redistribute when the distribution specification provided is for all container instances of a composed container.
dist_view | Instantiation of composed_dist_spec that describes the target distributions for redistribute for all container instances in a composed container |