Partition which takes the functor mapping pContainer GIDs to partition ids from the distribution_view provided to the pContainer constructor.
More...
|
| view_based_partition (value_type const &, unsigned int) |
|
| view_based_partition (view_based_partition const &other) |
|
| view_based_partition (std::shared_ptr< DistributionView > dist_view, PartitionInfoContainer const *const arb_part_info=nullptr) |
| Construct the partitioner instance for an arbitrary distribution specified by a container of instances. More...
|
|
view_based_partition & | operator= (view_based_partition const &other) |
| Assignment operator used during container redistribution to replace the mapping functions of the views implementing the distribution specification. More...
|
|
std::shared_ptr< DistributionView > const | get_dist_view (void) const |
| Return the pointer to the underlying distribution specification. More...
|
|
domain_type | domain () const |
| Get the partition's domain [0, .., p-1].
|
|
size_type | size () const |
| Return the number of partitions generated.
|
|
value_type const & | global_domain () const |
| Return the original domain that was used to create subdomains.
|
|
PartitionInfoContainer const * | get_arb_part_info (void) const |
| Return the pointer to the container with arbitrary distribution information.
|
|
std::tuple< index_type, location_type, loc_qual > | find (gid_type g) const |
| Returns the index of the partition that contains the gid g . More...
|
|
boost::optional< value_type > | try_get_domain (index_type pid) const |
| Returns the domain of gids that map to the specified partition if the mapping from GID to partition id is recognized. More...
|
|
template<typename ODom , typename MFG > |
std::vector< std::pair< typename detail::strip_deferred_domain< value_type >::type, bool > > | contained_in (ODom const &dom, MFG const &mfg) |
| Determine which partition has the elements referenced for the given domain. More...
|
|
template<typename Info > |
void | update (Info const &info) |
| Update the domain of GIDs and the mapping function from GID to partition id with mapping information on elements to be inserted in the container. More...
|
|
|
typedef DistributionView::view_container_type::domain_type | domain_type |
| The domain of the partitioner itself (i.e., the domain [0, ..., p-1])
|
|
typedef domain_type::index_type | index_type |
| Type used to describe the i'th subdomain.
|
|
typedef DistributionView::domain_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 size_t | size_type |
| Type used to report the number of partitions.
|
|
typedef DistributionView | distribution_view_type |
|
template<typename DistributionView, typename PartitionInfoContainer = int>
struct stapl::view_based_partition< DistributionView, PartitionInfoContainer >
Partition which takes the functor mapping pContainer GIDs to partition ids from the distribution_view provided to the pContainer constructor.
The functor is user-defined and as such no assumptions other than it implementing a many-to-one mapping can be made.
This struct is used in tandem with view_based_mapper to allow users to describe the data distribution of a pContainer using a pView.
- Template Parameters
-
DistributionView | Type of the view describing a distribution. |
PartitionInfoContainer | Type of the container holding arbitrary distribution information |
template<typename DistributionView , typename PartitionInfoContainer = int>
Construct the partitioner instance for an arbitrary distribution specified by a container of instances.
The pointer to the container holding the arbitrary partition information is ignored as it is not needed. It is passed to the constructor to allow the initialized_deferred call to be invoked with the flag to avoid attempting to initialize the mapping functions in dist_view
because they're not deferred_map instances.
- Parameters
-
dist_view | View-based specification of the distribution that will be used to map GIDs to partition ids |
template<typename DistributionView , typename PartitionInfoContainer = int>
template<typename ODom , typename MFG >
std::vector< std::pair<typename detail::strip_deferred_domain<value_type>::type, bool> > stapl::view_based_partition< DistributionView, PartitionInfoContainer >::contained_in |
( |
ODom const & |
dom, |
|
|
MFG const & |
mfg |
|
) |
| |
Determine which partition has the elements referenced for the given domain.
The returned information is a collection (possibly empty) of pairs. Each pair contains information about which partitions are included in the given domain and how they are included (True: if is fully contained, False: if is partially included). The returned collection only has elements if there is at least one partition that contains elements on the given domain.
- Example:
- Partition: [0..3],[4..6],[7..9],[10..13]
Given domain: [2..9]
Returns: {([0..0],False),([1..2],True)}
- Parameters
-
dom | Domain to compare |
mfg | Mapping function generator used to get the associated mapping function to each partition. The generated mapping function is used to project generated partitioned domains into the given domain. |
- Returns
- a vector of pairs.