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. | |
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.
Dom | Type of the domain to be partitioned |
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.
dom | The domain to partition |
blksz | The size of contiguous chunks |
cyclicity | The number of blocks to skip over until the next block for a partition. This is equivalent to the total number of partitions generated. |
value_type stapl::blk_cyclic_part< Dom >::operator[] | ( | index_type | idx | ) | const |
index_type stapl::blk_cyclic_part< Dom >::find | ( | gid_type const & | g | ) | const |
Returns the index of the partition that contains the gid g
.
g | gid to find |
g