STAPL API Reference          
Overview   Containers   Algorithms   Views   Skeletons   Run-Time System
Modules     Classes    
List of all members | Public Member Functions | Public Types
stapl::map_manager< Partition, Mapper, true, false > Class Template Reference

Responsible for determining the home location for elements of the map container, specifically for discrete GID types. More...

Public Member Functions

 map_manager (size_t block_size)
 Create a manager with a given block size, which will be used to map GIDs to location in a blocked manner. More...
 
 map_manager (Partition const &ps, Mapper const &m)
 Create a manager with a given partition and mapper. The block size will be determined by the size of the first partition. More...
 
template<typename PartitionContainer >
 map_manager (PartitionContainer const *const part_cont, Partition const &partition, Mapper const &mapper)
 Create a manager for an arbitrary distribution specified by the elements of part_cont and represented by the partition and mapper parameters. The block size will be determined by the size of the first partition. More...
 
std::pair< location_type, loc_qualoperator() (gid_type const &index) const
 Compute the home / manager location of a given GID. More...
 
map_result_type operator() (std::pair< gid_type, gid_type > const &interval) const
 Compute the home / manager location of a range of GIDs. More...
 
std::tuple< boost::icl::interval_set< index_type >, cid_typerange_of (gid_type const &index)
 For a given key, returns in which interval it is in.
 
Partition const & partition (void) const
 
Partition & partition (void)
 
void partition (Partition const &p)
 
Mapper const & mapper (void) const
 
Mapper & mapper (void)
 
void mapper (Mapper const &m)
 

Public Types

typedef Partition::value_type::index_type gid_type
 GID of the container.
 
typedef std::pair< gid_type, gid_typeinterval_t
 Simple intervals of GIDs.
 
typedef std::map< interval_t, location_type > map_result_type
 Result type of a multiple mapping.
 
typedef location_type value_type
 The result of invoking the function operator.
 
typedef size_t cid_type
 Partition ID type.
 
typedef Partition partition_type
 
typedef Mapper mapper_type
 

Detailed Description

template<typename Partition, typename Mapper>
class stapl::map_manager< Partition, Mapper, true, false >

Responsible for determining the home location for elements of the map container, specifically for discrete GID types.

This specialization operates on discrete key types, and supports a wider range of partition classes. The non-discrete implementation requires a partition class to provide the inverse mapping operation from a GID to the partition that contains it.

Template Parameters
PartitionerUsed to specify how to partition the elements.
MapperMaps the different partitions to the available locations.

Constructor & Destructor Documentation

◆ map_manager() [1/3]

template<typename Partition , typename Mapper >
stapl::map_manager< Partition, Mapper, true, false >::map_manager ( size_t  block_size)

Create a manager with a given block size, which will be used to map GIDs to location in a blocked manner.

Parameters
block_sizeThe number of elements in a block

◆ map_manager() [2/3]

template<typename Partition , typename Mapper >
stapl::map_manager< Partition, Mapper, true, false >::map_manager ( Partition const &  ps,
Mapper const &  m 
)

Create a manager with a given partition and mapper. The block size will be determined by the size of the first partition.

Parameters
pThe partition of the container
mThe mapper of the container

◆ map_manager() [3/3]

template<typename Partition , typename Mapper >
template<typename PartitionContainer >
stapl::map_manager< Partition, Mapper, true, false >::map_manager ( PartitionContainer const *const  part_cont,
Partition const &  partition,
Mapper const &  mapper 
)

Create a manager for an arbitrary distribution specified by the elements of part_cont and represented by the partition and mapper parameters. The block size will be determined by the size of the first partition.

This constructor allows more efficient extraction of the partition information from the container specifying an arbitrary distribution than the element-wise extraction of the information that is performed by the detail::compute_local_domains() function when a view-based distribution that utilizes closed-form mapping functions is provided.

Parameters
pThe partition of the container
mThe mapper of the container

Member Function Documentation

◆ operator()() [1/2]

template<typename Partition , typename Mapper >
std::pair<location_type, loc_qual> stapl::map_manager< Partition, Mapper, true, false >::operator() ( gid_type const &  index) const

Compute the home / manager location of a given GID.

Parameters
indexThe GID to map
Returns
The home location

◆ operator()() [2/2]

template<typename Partition , typename Mapper >
map_result_type stapl::map_manager< Partition, Mapper, true, false >::operator() ( std::pair< gid_type, gid_type > const &  interval) const

Compute the home / manager location of a range of GIDs.

Parameters
intervalA collection of GIDS to map, represented as a pair of GIDs defining the lower and upper boundary of a contiguous range.

The range of GID provided in interval may not all be in the same bContainers, and as such may map into different cids. The cid information is used only to compute the home location, and shouldn't be mistaken as the attribute that determines when a new interval is needed. Only a change in the home location signifies the need of a new interval in the output map.

Returns
Return the computed home location as a map from intervals to locations

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