Partition a one-dimensional domain into subdomains with a fixed block size. More...
Public Member Functions | |
block_partitioner (view_domain_type const &domain, size_t block_size, bool ignore=false) | |
Create a partition of a domain with a certain block size. More... | |
block_partitioner (view_domain_type const &domain, block_partitioner const &other) | |
Copy constructor using instead the given domain . | |
block_partitioner (size_t block_size, bool ignore=false) | |
Create a partition without a domain with a certain block size. More... | |
void | set_domain (view_domain_type const &domain) |
Set the global domain to partition. More... | |
value_type | operator[] (index_type idx) const |
Return the subdomain at a given index. This is the inverse of find. More... | |
size_t | size () const |
Return the number of partitions generated. | |
domain_type | domain () const |
Get the partition's domain [0, .., p-1]. | |
value_type const & | global_domain () const |
Return the original domain that was used to create subdomains. | |
index_type | find (gid_type const &g) const |
Returns the index of the partition that contains the gid g . More... | |
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 Dom | 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 into subdomains with a fixed block size.
If the given domain contains the GIDs [0, 1, ..., n-1] and the block size is b, then the number of subdomains generated is n/b. In the case that the number of elements does not evenly divide the block size, the remaining elements will be placed in the last partition or ignored completely, based on a policy specified at construction.
Dom | Type of the domain to be partitioned |
stapl::block_partitioner< Dom >::block_partitioner | ( | view_domain_type const & | domain, |
size_t | block_size, | ||
bool | ignore = false |
||
) |
Create a partition of a domain with a certain block size.
domain | The original domain to partition. |
block_size | The size of each subdomain (except possibly the last subdomain) |
ignore | Flag indicating whether the leftover elements should be included in the partition, or stored in the last subdomain. If ignore is false, all subdomains will have the same size. |
stapl::block_partitioner< Dom >::block_partitioner | ( | size_t | block_size, |
bool | ignore = false |
||
) |
Create a partition without a domain with a certain block size.
The partition created will be unusable until a domain is provided via set_domain.
block_size | The size of each subdomain (except possibly the last subdomain) |
ignore | Flag indicating whether the leftover elements should be included in the partition, or stored in the last subdomain. If ignore is false, all subdomains will have the same size. |
void stapl::block_partitioner< Dom >::set_domain | ( | view_domain_type const & | domain | ) |
Set the global domain to partition.
domain | The domain to partition |
value_type stapl::block_partitioner< Dom >::operator[] | ( | index_type | idx | ) | const |
index_type stapl::block_partitioner< Dom >::find | ( | gid_type const & | g | ) | const |
Returns the index of the partition that contains the gid g
.
g | gid to find |
g