STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types | Protected Attributes
stapl::view_based_mapper< DistributionView > Struct Template Reference

Mapper which takes the functor mapping partition ids to locations from the distribution_view provided to the pContainer constructor. More...

Public Member Functions

 view_based_mapper (domain_type const &)
 
 view_based_mapper (std::shared_ptr< DistributionView > dist_view)
 Construct the mapper instance for a distribution specified by a set of chained views. More...
 
template<typename PartitionInfoContainer >
 view_based_mapper (std::shared_ptr< DistributionView > dist_view, PartitionInfoContainer *)
 Construct the mapper instance for an arbitrary distribution specified by a container of instances. More...
 
value_type map (std::tuple< cid_type, location_type, loc_qual > const &cid) const
 
value_type map (cid_type const &cid) const
 
cid_type next (cid_type cid) const
 
bool valid (cid_type cid) const
 
size_t get_num_locations (void) const
 
template<typename Info >
void update (Info const &info)
 Update the domain of partition ids and the mapping function from partition id to location id with mapping information on elements to be inserted in the container. More...
 

Public Types

typedef DistributionView::view_container_type::domain_type domain_type
 The domain of the partitions to be mapped (i.e., the domain [0, ..., p-1])
 
typedef domain_type::gid_type cid_type
 The id of a partition.
 
typedef DistributionView::view_container_type::map_func_type map_func_type
 The functor that will map the partition CIDs to locations.
 
typedef location_type value_type
 

Protected Attributes

std::shared_ptr< DistributionView > m_dist_view
 
std::shared_ptr< map_func_typem_map_func
 The function used to map a partition id (CID) to a location.
 

Detailed Description

template<typename DistributionView>
struct stapl::view_based_mapper< DistributionView >

Mapper which takes the functor mapping partition ids to locations from the distribution_view provided to the pContainer constructor.

The functor is user-defined, and as such no assumptions other than it implementing a many-to-one mapping can be made.

This struct is used in tandem with view_based_partition to allow users to describe the data distribution of a pContainer using a pView.

Template Parameters
DistributionViewType of the view describing a distribution.

Constructor & Destructor Documentation

◆ view_based_mapper() [1/2]

template<typename DistributionView >
stapl::view_based_mapper< DistributionView >::view_based_mapper ( std::shared_ptr< DistributionView >  dist_view)

Construct the mapper instance for a distribution specified by a set of chained views.

Parameters
dist_viewView-based specification of the distribution that will be used to map partition ids to location ids by this class

◆ view_based_mapper() [2/2]

template<typename DistributionView >
template<typename PartitionInfoContainer >
stapl::view_based_mapper< DistributionView >::view_based_mapper ( std::shared_ptr< DistributionView >  dist_view,
PartitionInfoContainer *   
)

Construct the mapper instance for an arbitrary distribution specified by a container of instances.

The pointer to the container holding the arbitrary partition information is ignored as it is not needed. It is passed to the constructor to allow the initialized_deferred call to be invoked with the flag to avoid attempting to initialize the mapping functions in dist_view because they're not deferred_map instances.

Parameters
dist_viewView-based specification of the distribution that will be used to map partition ids to location ids by this class

Member Function Documentation

◆ update()

template<typename DistributionView >
template<typename Info >
void stapl::view_based_mapper< DistributionView >::update ( Info const &  info)

Update the domain of partition ids and the mapping function from partition id to location id with mapping information on elements to be inserted in the container.

Parameters
infovector of tuples, each of which specifies a contiguous set of GIDs, the partition id they map to, and the location id to which the partition id maps.

The documentation for this struct was generated from the following files: