Parallel non-migratable array container.This container provides fast access, but is limited in numerous ways: this container cannot be migrated; the distribution is fixed to a balanced partition with one base container per location. More...
Public Member Functions | |
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... | |
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< static_array< T, OptionalNoInitParam... > > | shared_from_this () |
Constructors | |
static_array (size_type n) | |
Create an array with a given size and default constructs all elements. More... | |
static_array (size_type n, value_type const &default_value) | |
Create an array with a given size and constructs all elements with a default value. More... | |
template<typename DP > | |
static_array (size_type n, value_type const &default_value, DP const &dis_policy) | |
Create an array with a given size and default value where the value type of the container is itself a parallel container. More... | |
template<typename X , typename Y > | |
static_array (boost::tuples::cons< X, Y > dims) | |
Create an array of arrays with given n-dimensional size. More... | |
template<typename X , typename Y , typename DP > | |
static_array (boost::tuples::cons< X, Y > dims, DP const &dis_policy) | |
Create an array of arrays with given n-dimensional size. More... | |
Element Manipulation | |
reference | operator[] (gid_type const &gid) |
Construct a reference to a specific index of the array. More... | |
const_reference | operator[] (gid_type const &gid) const |
Construct a const_reference to a specific index of the array. More... | |
reference | front () |
Construct a reference to the first element of the array. More... | |
const_reference | front () const |
Construct a const_reference to the first element of the array. More... | |
reference | back () |
Construct a reference to the last element of the array. More... | |
const_reference | back () const |
Construct a const_reference to the last element of the array. More... | |
reference | make_reference (gid_type const &gid) |
Construct a reference to a specific index of the array. More... | |
const_reference | make_reference (gid_type const &gid) const |
Construct a const_reference to a specific index of the array. More... | |
iterator | begin (void) |
Construct an iterator to the beginning of the array. More... | |
const_iterator | begin (void) const |
Construct an const_iterator to the beginning of the array. More... | |
const_iterator | cbegin (void) const |
Construct an const_iterator to the beginning of the array. More... | |
iterator | end (void) |
Construct an iterator to one past the end of the array. More... | |
const_iterator | end (void) const |
Construct an const_iterator to one past the end of the array. More... | |
const_iterator | cend (void) const |
Construct an const_iterator to one past the end of the array. More... | |
iterator | make_iterator (index_type const &index) |
Construct an iterator to a specific index of the array. More... | |
const_iterator | make_iterator (index_type const &index) const |
Construct an iterator to a specific index of the array. More... | |
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... | |
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... | |
void | apply_set (gid_type const &gid, F const &f) |
Applies a function f to the element specified by the GID. More... | |
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... | |
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 static_array_traits< T, OptionalNoInitParam... > | traits_type |
typedef base_type::distribution_type | distribution_type |
typedef T | value_type |
typedef traits_type::gid_type | gid_type |
typedef gid_type | index_type |
typedef traits_type::domain_type | domain_type |
typedef domain_type::size_type | size_type |
typedef distribution_type::reference | reference |
typedef distribution_type::const_reference | const_reference |
typedef distribution_type::iterator | iterator |
typedef distribution_type::const_iterator | const_iterator |
typedef static_array_metadata< distribution_type > | loc_dist_metadata |
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... | |
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) |
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... | |
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... | |
Parallel non-migratable array container.
This container provides fast access, but is limited in numerous ways: this container cannot be migrated; the distribution is fixed to a balanced partition with one base container per location.
T | Type of the stored elements in the container. T must be default assignable, copyable and assignable. |
OptionalNoInitParam | Optionally, the type tag no_initialization can be passed so that the base will attempt to elide default initialization of the container's elements. |
stapl::static_array< T, OptionalNoInitParam >::static_array | ( | size_type | n | ) |
Create an array with a given size and default constructs all elements.
n | The size of the array |
stapl::static_array< T, OptionalNoInitParam >::static_array | ( | size_type | n, |
value_type const & | default_value | ||
) |
Create an array with a given size and constructs all elements with a default value.
n | The size of the array |
default_value | The initial value of the elements in the container |
stapl::static_array< T, OptionalNoInitParam >::static_array | ( | size_type | n, |
value_type const & | default_value, | ||
DP const & | dis_policy | ||
) |
Create an array with a given size and default value where the value type of the container is itself a parallel container.
n | The size of the array |
default_value | The initial value of the elements in the container |
dis_policy | A distribution policy that specifies how to distribute the nested containers, in the context of containers of containers. |
stapl::static_array< T, OptionalNoInitParam >::static_array | ( | boost::tuples::cons< X, Y > | dims | ) |
Create an array of arrays with given n-dimensional size.
dims | A cons list specifying the dimensions of the containers. |
stapl::static_array< T, OptionalNoInitParam >::static_array | ( | boost::tuples::cons< X, Y > | dims, |
DP const & | dis_policy | ||
) |
Create an array of arrays with given n-dimensional size.
dims | A cons list specifying the dimensions of the containers. |
dis_policy | A distribution policy that specifies how to distribute the nested containers. |
reference stapl::static_array< T, OptionalNoInitParam >::operator[] | ( | gid_type const & | gid | ) |
Construct a reference to a specific index of the array.
gid | The index for which to create the reference |
const_reference stapl::static_array< T, OptionalNoInitParam >::operator[] | ( | gid_type const & | gid | ) | const |
Construct a const_reference to a specific index of the array.
gid | The index for which to create the reference |
reference stapl::static_array< T, OptionalNoInitParam >::front | ( | ) |
Construct a reference to the first element of the array.
const_reference stapl::static_array< T, OptionalNoInitParam >::front | ( | ) | const |
Construct a const_reference to the first element of the array.
reference stapl::static_array< T, OptionalNoInitParam >::back | ( | ) |
Construct a reference to the last element of the array.
const_reference stapl::static_array< T, OptionalNoInitParam >::back | ( | ) | const |
Construct a const_reference to the last element of the array.
reference stapl::static_array< T, OptionalNoInitParam >::make_reference | ( | gid_type const & | gid | ) |
Construct a reference to a specific index of the array.
gid | The index for which to create the reference |
const_reference stapl::static_array< T, OptionalNoInitParam >::make_reference | ( | gid_type const & | gid | ) | const |
Construct a const_reference to a specific index of the array.
gid | The index for which to create the reference |
iterator stapl::static_array< T, OptionalNoInitParam >::begin | ( | void | ) |
Construct an iterator to the beginning of the array.
const_iterator stapl::static_array< T, OptionalNoInitParam >::begin | ( | void | ) | const |
Construct an const_iterator to the beginning of the array.
const_iterator stapl::static_array< T, OptionalNoInitParam >::cbegin | ( | void | ) | const |
Construct an const_iterator to the beginning of the array.
iterator stapl::static_array< T, OptionalNoInitParam >::end | ( | void | ) |
Construct an iterator to one past the end of the array.
const_iterator stapl::static_array< T, OptionalNoInitParam >::end | ( | void | ) | const |
Construct an const_iterator to one past the end of the array.
const_iterator stapl::static_array< T, OptionalNoInitParam >::cend | ( | void | ) | const |
Construct an const_iterator to one past the end of the array.
iterator stapl::static_array< T, OptionalNoInitParam >::make_iterator | ( | index_type const & | index | ) |
Construct an iterator to a specific index of the array.
index | The index for which to create the iterator |
const_iterator stapl::static_array< T, OptionalNoInitParam >::make_iterator | ( | index_type const & | index | ) | const |
Construct an iterator to a specific index of the array.
index | The index for which to create the iterator |
|
inherited |
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. |
|
inherited |
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 |