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

A container's mapper is responsible for mapping base container IDs (essentially subdomains) to locations. More...

Public Member Functions

 mapper (domain_type const &dom)
 Instantiate the mapper with the domain of base container IDs and optionally, the set of locations that we are mapping to. More...
 
cid_view_type components (size_t loc) const
 Create a view that contains all of the base container IDs that a particular location is responsible for. This is the inverse of mapper::map. More...
 
location_type map (cid_type const &cid) const
 Map a base container ID to a location. More...
 
size_t get_num_locations (void) const
 
cid_type next (cid_type const &cid) const
 
bool valid (cid_type const &cid) const
 

Public Types

typedef CID cid_type
 
typedef indexed_domain< size_t > domain_type
 
typedef array_ro_view< identity_container< cid_type >, domain_typecid_view_type
 A view used to return the CIDs a location is responsible for.
 
typedef location_type value_type
 

Detailed Description

template<typename CID>
struct stapl::mapper< CID >

A container's mapper is responsible for mapping base container IDs (essentially subdomains) to locations.

This particular mapper maps subdomains to locations in a blocked and balanced manner. That is, given the subdomains (p0, p1, ..., pk) and l locations, each location will be mapped contiguous blocks of k/l subdomains.

Template Parameters
CIDThe base container ID type

Constructor & Destructor Documentation

◆ mapper()

template<typename CID>
stapl::mapper< CID >::mapper ( domain_type const &  dom)

Instantiate the mapper with the domain of base container IDs and optionally, the set of locations that we are mapping to.

Parameters
domDomain of base container IDs (CIDs)

Explicitly calling freestanding get_num_locations(), as member is not initialized yet in this constructor.

Member Function Documentation

◆ components()

template<typename CID>
cid_view_type stapl::mapper< CID >::components ( size_t  loc) const

Create a view that contains all of the base container IDs that a particular location is responsible for. This is the inverse of mapper::map.

Parameters
locThe location to query
Returns
A view of base container IDs

◆ map()

template<typename CID>
location_type stapl::mapper< CID >::map ( cid_type const &  cid) const

Map a base container ID to a location.

Parameters
cidThe base container ID
Returns
The location that the base container ID is mapped to

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