Base distribution class for the graph containers. More...
Public Member Functions | |
template<typename... Args> | |
graph_distribution_base (Args &&... args) | |
future< bool > | has_edge (vertex_descriptor const &source, vertex_descriptor const &target) |
Determines whether there exists an edge between two vertices. More... | |
template<typename Cont , typename F > | |
void | aggregate_apply_async (Cont &&cont, F &&f) |
Applies a functor on this location. More... | |
template<typename Cont , typename F > | |
void | aggregate_apply_async (size_t loc, Cont const &cont, F const &f) |
template<typename Cont , typename F > | |
void | guarded_aggregate_apply_async (size_t loc, Cont const &cont, F const &f) |
template<typename F > | |
void | guarded_apply_set (vertex_descriptor const &gid, F &&f) |
Apply a functor to the element at a given GID in a non-concurrent manner. That is, if the graph is already in an apply_set, then this apply_set will be deferred until the one in progress has ended. More... | |
template<typename F > | |
void | guarded_unordered_apply (vertex_descriptor const &gid, F &&f) |
Apply a functor to the element at a given GID in a non-concurrent manner. That is, if the graph is already in an unordered_apply, then this unordered_apply will be deferred until the one in progress has ended. More... | |
size_t | size (void) const |
domain_type const & | domain (void) const |
partition_type & | partition () |
partition_type const & | partition () const |
mapper_type & | mapper () |
directory_type & | directory (void) |
directory_type const & | directory (void) const |
container_manager_type & | container_manager (void) |
container_manager_type const & | container_manager (void) const |
container_type * | container (void) |
container_type const * | container (void) const |
local_return_type | metadata (void) |
Returns the metadata information for the base-containers on this location. More... | |
size_t | num_base_containers (void) |
Returns the global number of base-containers in this distribution. | |
bool | is_local (Indices const &... i) const |
void | defer_metadata_at (gid_type const &gid, promise< dom_info_type > p) |
Returns the metadata associated with the given gid by setting the value of the promise. More... | |
future< dom_info_type > | metadata_at (gid_type const &gid) |
Returns the metadata associated with the given index . | |
dom_info_type | metadata_of (cid_type const &cid) |
Return the metadata associated with the specified component. More... | |
void | redistribute (std::shared_ptr< DistSpecView > dist_view, typename std::enable_if< is_distribution_view< DistSpecView >::value >::type *=0) |
Redistribute data to match the distribution specification provided. More... | |
void | update (std::vector< std::tuple< std::pair< gid_type, gid_type >, cid_type, location_type >> const &updates) |
Add information on the distribution of elements not yet in the container. Use in dynamic containers with view-based distributions to allow element distribution to be based on computation. More... | |
void | set_element (gid_type const &gid, value_type const &val) |
Update the element at a GID by replacing it with a given value. More... | |
template<typename SourceView , typename std::enable_if< use_bc_set_elements< typename std::decay< SourceView >::type >::value, int >::type = 0> | |
void | set_elements (gid_type gid, SourceView &&source_view) |
Update a range of contiguous elements in the container, starting at gid . A total of view.size() elements will be updated with the values in view . More... | |
template<typename View , typename std::enable_if< !use_bc_set_elements< typename std::decay< View >::type >::value, int >::type = 0> | |
void | set_elements (gid_type gid, View &&view) |
Signature of set_elements used when underlying base container is not supported. Fall back to iterative use of set_element. | |
value_type | get_element (gid_type const &gid) const |
Return a copy of the element at a specific GID. Note that this is a blocking operation. More... | |
future< value_type > | get_element_split (gid_type const &gid) |
Return a future of the element at a specific GID. This is a non-blocking operation. More... | |
template<typename Functor > | |
void | apply_set (gid_type const &gid, Functor const &f) |
Apply a function object to the element with the given GID. More... | |
template<typename Functor > | |
void | unordered_apply_set (gid_type const &gid, Functor &&f) |
Apply a function object to the element with the given GID, disregarding RMI causal ordering. More... | |
template<typename Functor > | |
void | unordered_apply (gid_type const &gid, Functor &&f) |
Apply a function object to the element with the given GID, passing along the distribution pointer and disregarding RMI causal ordering. More... | |
template<typename Functor > | |
boost::result_of< Functor(value_type &)>::type | apply_get (gid_type const &gid, Functor const &f) |
Apply a function object to the element with the given GID and return the result. More... | |
template<typename Functor > | |
boost::result_of< Functor(value_type &)>::type | apply_get (gid_type const &gid, Functor const &f) const |
Apply a function object to the element with the given GID and return the result. More... | |
Public Types | |
using | vertex_descriptor = typename distribution_traits< derived_type >::gid_type |
using | base_container_type = typename distribution_traits< derived_type >::base_container_type |
typedef directory_type::key_type | gid_type |
typedef partition_type::value_type | domain_type |
typedef gid_type | index_type |
typedef mapper_type::domain_type | map_dom_t |
typedef metadata_entry< domain_type, base_container_type *> | dom_info_type |
The type of the coarsened domain. | |
typedef std::vector< dom_info_type > | local_return_type |
Type for returning collected metadata from all local base-containers. | |
Protected Member Functions | |
void | update_impl (std::vector< std::tuple< std::pair< gid_type, gid_type >, cid_type, location_type >> const &updates) |
Protected Attributes | |
void * | m_current_frontier |
container_manager_type | m_container_manager |
Manages and owns the base-containers on this location. Base-containers store the actual data. Container manager also handles the mapping from gid to base-container. | |
Base distribution class for the graph containers.
Container | Type of the container that is managing this distribution. |
Derived | The most derived distribution class |
future<bool> stapl::detail::graph_distribution_base< Container, Derived >::has_edge | ( | vertex_descriptor const & | source, |
vertex_descriptor const & | target | ||
) |
Determines whether there exists an edge between two vertices.
void stapl::detail::graph_distribution_base< Container, Derived >::aggregate_apply_async | ( | Cont && | cont, |
F && | f | ||
) |
Applies a functor on this location.
All elements must be local. For internal use by Aggregators.
v | Container of elements to be passed-in to f. |
f | Functor to be applied to each element of v on the desired location. f is passed an element of v. |
void stapl::detail::graph_distribution_base< Container, Derived >::aggregate_apply_async | ( | size_t | loc, |
Cont const & | cont, | ||
F const & | f | ||
) |
void stapl::detail::graph_distribution_base< Container, Derived >::guarded_aggregate_apply_async | ( | size_t | loc, |
Cont const & | cont, | ||
F const & | f | ||
) |
void stapl::detail::graph_distribution_base< Container, Derived >::guarded_apply_set | ( | vertex_descriptor const & | gid, |
F && | f | ||
) |
Apply a functor to the element at a given GID in a non-concurrent manner. That is, if the graph is already in an apply_set, then this apply_set will be deferred until the one in progress has ended.
gid | The GID of the vertex |
f | The functor to apply |
void stapl::detail::graph_distribution_base< Container, Derived >::guarded_unordered_apply | ( | vertex_descriptor const & | gid, |
F && | f | ||
) |
Apply a functor to the element at a given GID in a non-concurrent manner. That is, if the graph is already in an unordered_apply, then this unordered_apply will be deferred until the one in progress has ended.
gid | The GID of the vertex |
f | The functor to apply |
|
inherited |
Returns the metadata information for the base-containers on this location.
|
inherited |
Returns if the element with the specified gid is stored on this location.
i | components of a gid if it is multidimensional, otherwise i is the gid. |
|
inherited |
Returns the metadata associated with the given gid
by setting the value of the promise.
gid | Id of the element of interest |
p | Promise that will return the locality information to the location that invoked the method. |
|
inherited |
Return the metadata associated with the specified component.
cid | id of the base container for which metadata is requested. |
|
inherited |
Redistribute data to match the distribution specification provided.
dist_view | View-based specification of the distribution that the container elements will match after method completion. |
|
inherited |
Add information on the distribution of elements not yet in the container. Use in dynamic containers with view-based distributions to allow element distribution to be based on computation.
updates | Explicit mapping information of sets of contiguous GIDs to partition ids and location ids. |
|
inherited |
Update the element at a GID by replacing it with a given value.
gid | GID of the element to replace |
val | The new value for the element |
|
inherited |
Update a range of contiguous elements in the container, starting at gid
. A total of view.size()
elements will be updated with the values in view
.
|
inherited |
Return a copy of the element at a specific GID. Note that this is a blocking operation.
gid | GID of the element to retrieve |
|
inherited |
Return a future of the element at a specific GID. This is a non-blocking operation.
gid | GID of the element to retrieve |
|
inherited |
Apply a function object to the element with the given GID.
gid | GID of the element for which we want to apply the function object. |
f | Function object to apply to the element. |
f
has to be const
qualified.
|
inherited |
Apply a function object to the element with the given GID, disregarding RMI causal ordering.
gid | GID of the element for which we want to apply the function object. |
f | Function object to apply to the element. |
f
has to be const
qualified.
|
inherited |
Apply a function object to the element with the given GID, passing along the distribution pointer and disregarding RMI causal ordering.
gid | GID of the element for which we want to apply the function object. |
f | Function object to apply to the element. |
f
has to be const
qualified.
|
inherited |
Apply a function object to the element with the given GID and return the result.
gid | GID of the element for which we want to apply the function object and return the result. |
f | Function object to apply to the element. |
f
to the element.Functor
reflects a public type result_type
and that the invocation of its function operator returns a value that is convertible to result_type. The function operator of f
has to be const
qualified.
|
inherited |
Apply a function object to the element with the given GID and return the result.
gid | GID of the element for which we want to apply the function object and return the result. |
f | Function object to apply to the element. |
f
to the element.Functor
reflects a public type result_type
and that the invocation of its function operator returns a value that is convertible to result_type. The function operator of f
has to be const
qualified.