DIY  3.0
data-parallel out-of-core C++ library
 All Classes Namespaces Functions Typedefs Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
diy::RegularDecomposer< Bounds_ > Struct Template Reference

Decomposes a regular (discrete or continuous) domain into even blocks; creates Links with Bounds along the way. More...

#include <diy/decomposition.hpp>

Public Types

typedef Bounds_ Bounds
 
typedef BoundsValue< Bounds >::type Coordinate
 
typedef RegularLinkSelector
< Bounds >::type 
Link
 
using Creator = std::function< void(int, Bounds, Bounds, Bounds, Link)>
 
using Updater = std::function< void(int, int, Bounds, Bounds, Bounds, Link)>
 
typedef std::vector< bool > BoolVector
 
typedef std::vector< Coordinate > CoordinateVector
 
typedef std::vector< int > DivisionsVector
 

Public Member Functions

 RegularDecomposer (int dim_, const Bounds &domain_, int nblocks_, BoolVector share_face_=BoolVector(), BoolVector wrap_=BoolVector(), CoordinateVector ghosts_=CoordinateVector(), DivisionsVector divisions_=DivisionsVector())
 
void decompose (int rank, const Assigner &assigner, const Creator &create)
 
void decompose (int rank, const Assigner &assigner, Master &master, const Updater &update)
 
void decompose (int rank, const Assigner &assigner, Master &master)
 
template<class Point >
int lowest_gid (const Point &p) const
 
void gid_to_coords (int gid, DivisionsVector &coords) const
 
int coords_to_gid (const DivisionsVector &coords) const
 
void fill_divisions (std::vector< int > &divisions) const
 
void fill_bounds (Bounds &bounds, const DivisionsVector &coords, bool add_ghosts=false) const
 Gets the bounds, with or without ghosts, for a block specified by its block coordinates. More...
 
void fill_bounds (Bounds &bounds, int gid, bool add_ghosts=false) const
 Gets the bounds, with or without ghosts, for a block specified by its gid. More...
 
template<class Point >
void point_to_gids (std::vector< int > &gids, const Point &p) const
 
template<class Point >
int point_to_gid (const Point &p) const
 returns gid of a block that contains the point; ignores ghosts
 
template<class Point >
int num_gids (const Point &p) const
 
template<class Point >
void top_bottom (int &top, int &bottom, const Point &p, int axis) const
 

Static Public Member Functions

static bool all (const std::vector< int > &v, int x)
 
static void gid_to_coords (int gid, DivisionsVector &coords, const DivisionsVector &divisions)
 
static int coords_to_gid (const DivisionsVector &coords, const DivisionsVector &divisions)
 
static void factor (std::vector< unsigned > &factors, int n)
 

Public Attributes

int dim
 
Bounds domain
 
int nblocks
 
BoolVector share_face
 
BoolVector wrap
 
CoordinateVector ghosts
 
DivisionsVector divisions
 

Detailed Description

template<class Bounds_>
struct diy::RegularDecomposer< Bounds_ >

Decomposes a regular (discrete or continuous) domain into even blocks; creates Links with Bounds along the way.

Examples:
decomposition/regular-decomposer-long.cpp, decomposition/regular-decomposer-short.cpp, reduce/all-to-all.cpp, reduce/merge-reduce.cpp, reduce/sort.cpp, and reduce/swap-reduce.cpp.

Constructor & Destructor Documentation

template<class Bounds_>
diy::RegularDecomposer< Bounds_ >::RegularDecomposer ( int  dim_,
const Bounds &  domain_,
int  nblocks_,
BoolVector  share_face_ = BoolVector(),
BoolVector  wrap_ = BoolVector(),
CoordinateVector  ghosts_ = CoordinateVector(),
DivisionsVector  divisions_ = DivisionsVector() 
)
inline
Parameters
dimdimensionality of the decomposition
domainbounds of global domain
nblockstotal number of global blocks
share_faceindicates dimensions on which to share block faces
wrapindicates dimensions on which to wrap the boundary
ghostsindicates how many ghosts to use in each dimension
divisionsindicates how many cuts to make along each dimension (0 means "no constraint," i.e., leave it up to the algorithm)

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