STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Member Functions | Protected Attributes
stapl::detail::graph_distribution_base< Container, Derived > Class Template Reference

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_typemetadata_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_typeget_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_typelocal_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.
 

Detailed Description

template<typename Container, typename Derived>
class stapl::detail::graph_distribution_base< Container, Derived >

Base distribution class for the graph containers.

Template Parameters
ContainerType of the container that is managing this distribution.
DerivedThe most derived distribution class

Member Function Documentation

◆ has_edge()

template<typename Container, typename Derived>
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.

Returns
A future representing the answer to this query

◆ aggregate_apply_async() [1/2]

template<typename Container, typename Derived>
template<typename Cont , typename F >
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.

Parameters
vContainer of elements to be passed-in to f.
fFunctor to be applied to each element of v on the desired location. f is passed an element of v.

◆ aggregate_apply_async() [2/2]

template<typename Container, typename Derived>
template<typename Cont , typename F >
void stapl::detail::graph_distribution_base< Container, Derived >::aggregate_apply_async ( size_t  loc,
Cont const &  cont,
F const &  f 
)

◆ guarded_aggregate_apply_async()

template<typename Container, typename Derived>
template<typename Cont , typename F >
void stapl::detail::graph_distribution_base< Container, Derived >::guarded_aggregate_apply_async ( size_t  loc,
Cont const &  cont,
F const &  f 
)

◆ guarded_apply_set()

template<typename Container, typename Derived>
template<typename 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.

Parameters
gidThe GID of the vertex
fThe functor to apply

◆ guarded_unordered_apply()

template<typename Container, typename Derived>
template<typename F >
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.

Parameters
gidThe GID of the vertex
fThe functor to apply

◆ metadata()

local_return_type stapl::distribution< Container, detail::nat1 , detail::nat2 , detail::nat3 , detail::nat4 >::metadata ( void  )
inherited

Returns the metadata information for the base-containers on this location.

See also
metadata_entry.

◆ is_local()

bool stapl::distribution< Container, detail::nat1 , detail::nat2 , detail::nat3 , detail::nat4 >::is_local ( Indices const &...  i) const
inherited

Returns if the element with the specified gid is stored on this location.

Parameters
icomponents of a gid if it is multidimensional, otherwise i is the gid.

◆ defer_metadata_at()

void stapl::distribution< Container, detail::nat1 , detail::nat2 , detail::nat3 , detail::nat4 >::defer_metadata_at ( gid_type const &  gid,
promise< dom_info_type p 
)
inherited

Returns the metadata associated with the given gid by setting the value of the promise.

Parameters
gidId of the element of interest
pPromise that will return the locality information to the location that invoked the method.

◆ metadata_of()

dom_info_type stapl::distribution< Container, detail::nat1 , detail::nat2 , detail::nat3 , detail::nat4 >::metadata_of ( cid_type const &  cid)
inherited

Return the metadata associated with the specified component.

Parameters
cidid of the base container for which metadata is requested.
Returns
Metadata of the base container if it is stored on this location.

◆ redistribute()

void stapl::distribution< Container, detail::nat1 , detail::nat2 , detail::nat3 , detail::nat4 >::redistribute ( std::shared_ptr< DistSpecView >  dist_view,
typename std::enable_if< is_distribution_view< DistSpecView >::value >::type *  = 0 
)
inherited

Redistribute data to match the distribution specification provided.

Parameters
dist_viewView-based specification of the distribution that the container elements will match after method completion.

◆ update()

void stapl::distribution< Container, detail::nat1 , detail::nat2 , detail::nat3 , detail::nat4 >::update ( std::vector< std::tuple< std::pair< gid_type, gid_type >, cid_type, location_type >> const &  updates)
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.

Parameters
updatesExplicit mapping information of sets of contiguous GIDs to partition ids and location ids.

◆ set_element()

template<typename Derived>
void stapl::operations::settable< Derived >::set_element ( gid_type const &  gid,
value_type const &  val 
)
inherited

Update the element at a GID by replacing it with a given value.

Parameters
gidGID of the element to replace
valThe new value for the element

◆ set_elements()

template<typename Derived>
template<typename SourceView , typename std::enable_if< use_bc_set_elements< typename std::decay< SourceView >::type >::value, int >::type = 0>
void stapl::operations::settable< Derived >::set_elements ( gid_type  gid,
SourceView &&  source_view 
)
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.

Note
Implementation assumes partition::try_get_domain will not fail if partition::contained_in succeeds.

◆ get_element()

template<typename Derived>
value_type stapl::operations::gettable< Derived >::get_element ( gid_type const &  gid) const
inherited

Return a copy of the element at a specific GID. Note that this is a blocking operation.

Parameters
gidGID of the element to retrieve
Returns
Copy of the element at gid

◆ get_element_split()

template<typename Derived>
future<value_type> stapl::operations::gettable< Derived >::get_element_split ( gid_type const &  gid)
inherited

Return a future of the element at a specific GID. This is a non-blocking operation.

Parameters
gidGID of the element to retrieve
Returns
Future of the element at gid

◆ apply_set()

template<typename Derived>
template<typename Functor >
void stapl::operations::applyable< Derived >::apply_set ( gid_type const &  gid,
Functor const &  f 
)
inherited

Apply a function object to the element with the given GID.

Parameters
gidGID of the element for which we want to apply the function object.
fFunction object to apply to the element.
Warning
The function operator of f has to be const qualified.

◆ unordered_apply_set()

template<typename Derived>
template<typename Functor >
void stapl::operations::applyable< Derived >::unordered_apply_set ( gid_type const &  gid,
Functor &&  f 
)
inherited

Apply a function object to the element with the given GID, disregarding RMI causal ordering.

Parameters
gidGID of the element for which we want to apply the function object.
fFunction object to apply to the element.
Warning
The function operator of f has to be const qualified.

◆ unordered_apply()

template<typename Derived>
template<typename Functor >
void stapl::operations::applyable< Derived >::unordered_apply ( gid_type const &  gid,
Functor &&  f 
)
inherited

Apply a function object to the element with the given GID, passing along the distribution pointer and disregarding RMI causal ordering.

Parameters
gidGID of the element for which we want to apply the function object.
fFunction object to apply to the element.
Warning
The function operator of f has to be const qualified.

◆ apply_get() [1/2]

template<typename Derived>
template<typename Functor >
boost::result_of<Functor(value_type&)>::type stapl::operations::applyable< Derived >::apply_get ( gid_type const &  gid,
Functor const &  f 
)
inherited

Apply a function object to the element with the given GID and return the result.

Parameters
gidGID of the element for which we want to apply the function object and return the result.
fFunction object to apply to the element.
Returns
The result of applying f to the element.
Warning
This function assumes that the 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.

◆ apply_get() [2/2]

template<typename Derived>
template<typename Functor >
boost::result_of<Functor(value_type&)>::type stapl::operations::applyable< Derived >::apply_get ( gid_type const &  gid,
Functor const &  f 
) const
inherited

Apply a function object to the element with the given GID and return the result.

Parameters
gidGID of the element for which we want to apply the function object and return the result.
fFunction object to apply to the element.
Returns
The result of applying f to the element.
Warning
This function assumes that the 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.

The documentation for this class was generated from the following file: