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

Partition a one-dimensional domain cyclically into subdomains with a fixed block size. More...

Public Member Functions

 blk_cyclic_part (Dom dom, size_t blksz=1, size_t cyclicity=1)
 Create block-cyclic domain with a given domain, block size and cyclicity. More...
 
size_t size () const
 Return the number of partitions generated.
 
value_type operator[] (index_type idx) const
 Return the subdomain at a given index. This is the inverse of find. More...
 
index_type find (gid_type const &g) const
 Returns the index of the partition that contains the gid g. More...
 
Dom const & global_domain () const
 Return the original domain that was used to create subdomains.
 

Public Types

typedef Dom view_domain_type
 The original domain to partition.
 
typedef indexed_domain< size_t > domain_type
 The domain of the partitioner itself (i.e., the domain [0, ..., p-1])
 
typedef dom1Dbc< typename Dom::index_type > value_type
 Type of the subdomains produced by the partition.
 
typedef value_type::index_type gid_type
 Type of the GIDs in the subdomains.
 
typedef domain_type::index_type index_type
 Type used to describe the i'th subdomain.
 

Detailed Description

template<typename Dom>
class stapl::blk_cyclic_part< Dom >

Partition a one-dimensional domain cyclically into subdomains with a fixed block size.

Example: Consider an original domain of [0...15], block size = 2 and cyclicity = 4. This means that there will be 4 total partitions, each partition containing 4 elements in runs of 2:

D = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15] P0 P0 P1 P1 P2 P2 P3 P3 P0 P0 P1 P1 P2 P2 P3 P3

Note that the elements in a subdomain are not necessarily contiguous.

Template Parameters
DomType of the domain to be partitioned

Constructor & Destructor Documentation

◆ blk_cyclic_part()

template<typename Dom>
stapl::blk_cyclic_part< Dom >::blk_cyclic_part ( Dom  dom,
size_t  blksz = 1,
size_t  cyclicity = 1 
)

Create block-cyclic domain with a given domain, block size and cyclicity.

Parameters
domThe domain to partition
blkszThe size of contiguous chunks
cyclicityThe number of blocks to skip over until the next block for a partition. This is equivalent to the total number of partitions generated.

Member Function Documentation

◆ operator[]()

template<typename Dom>
value_type stapl::blk_cyclic_part< Dom >::operator[] ( index_type  idx) const

Return the subdomain at a given index. This is the inverse of find.

Parameters
idxThe index of the subdomain, which should be from 0 to size() - 1.
Returns
The subdomain at idx

◆ find()

template<typename Dom>
index_type stapl::blk_cyclic_part< Dom >::find ( gid_type const &  g) const

Returns the index of the partition that contains the gid g.

Parameters
ggid to find
Returns
The index of the subdomain that contains g

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