Skip to content

Partitionings

bulk::index

Defined in header <bulk/util/indices.hpp>.

Array-like type for D > 1, and wrapper around size_t for D == 1.

template <int D>
struct index;

For backward compatibility, we have an alias index_type (deprecated).

template <int D>
using index_type = index<D>;

Note

In Bulk, int is the type used for processor counts ands indices, and size_t is used for sizes and indices in containers. Partitionings therefore return int when computing ranks and owners, and size_t in all other cases. The only exception is multi_index which is represented as bulk::index and thus unsigned.

bulk::partitioning

Defined in header <bulk/partitionings/partitioning.hpp>.

template <int D>
class partitioning;

Base class for partitionings over a 1D processor grid.

Template parameters

  • D - the dimension of the data space

Member functions

(constructor) constructs the partitioning
(deconstructor) deconstructs the partitioning
global_size returns the global data shape
local_size returns the local data shape
local_count returns the number of local elements
owner returns the owner of a global index
local convert a global index to a local one
global convert a local index to a global one

bulk::multi_partitioning

Defined in header <bulk/partitionings/partitioning.hpp>.

template <int D, int G>
class multi_partitioning : public partitioning<D>;

Base class for partitionings over a processor grid of dimension G.

Template parameters

  • D - the dimension of the data space
  • G - the dimension of the processor grid

Member functions

(constructor) constructs the partitioning
(deconstructor) deconstructs the partitioning
local_size returns the local data shape
global convert a local index to a global one
multi_rank convert a 1D processor rank to its grid rank
grid returns the processor grid shape
rank convert a grid rank to a 1D processor rank
multi_owner get the multi rank of a global index

bulk::rectangular_partitioning

Defined in header <bulk/partitionings/partitioning.hpp>.

template <int D, int G>
class rectangular_partitioning : public multi_partitioning<D, G>;

Base class for partitionings over a processor grid of dimension G, where the local data of each processor is a (hyper)rectangular subregion of the global data space.

Template parameters

  • D - the dimension of the data space
  • G - the dimension of the processor grid

Member functions

(constructor) constructs the partitioning
(deconstructor) deconstructs the partitioning
origin returns the origin of the local subregion

bulk::cartesian_partitioning

Defined in header <bulk/partitionings/partitioning.hpp>.

template <int D, int G = D>
class cartesian_partitioning : public multi_partitioning<D, G>;

Base class for partitionings over a processor grid of dimension G, where the each axis is partitioned independently.

Template parameters

  • D - the dimension of the data space
  • G - the dimension of the processor grid

Member functions

(constructor) constructs the partitioning
(deconstructor) deconstructs the partitioning
owner returns the owner of a global index
local convert a global index to a local one
global convert a local index to a global one
local_size returns the local data shape

bulk::cyclic_partitioning

Defined in header <bulk/partitionings/cyclic.hpp>.

template <int D, int G = D>
class cyclic_partitioning : public cartesian_partitioning<D, G>;

A cyclic partitioning distributes the indices of a D-dimension space over the first G axes, where G is the dimensionality of the processor grid.

bulk::block_partitioning

Defined in header <bulk/partitionings/block.hpp>.

template <int D, int G = D>
class block_partitioning : public rectangular_partitioning<D, G>;

A block distribution. This equally block-distributes the first G axes. Optionally, a third argument axes, an array of size G that indicates the axes over which to partition, can be supplied to the constructor.

bulk::tree_partitioning

Defined in header <bulk/partitionings/tree.hpp>.

template <int D>
class tree_partitioning : public rectangular_partitioning<D, 1>

A binary-space partitioning (abbreviated BSP).

             (a_0, d_0)
             /        \
      (a_10, d_10) (a_11, d_11)
      /      \       /     \
     ...     ...    ...    ...
      |       |      |      |
(a_n0, d_n0) ...    ...  (a_n(p/2), d_n(p/2))

represented as binary tree of splits.

(constructor)

tree_partitioning(index_type<D> data_size, int procs,
                  util::binary_tree<util::split>&& splits)

Parameters

  • data_size - the shape of the data
  • procs - the number of processors to distribute over
  • splits - a binary tree, each node has associated a pair (a, d) with the location a, and axis d, among which is recursively split.