Highly Efficient FFT for Exascale: HeFFTe v2.3
Plan transformation logic
Collaboration diagram for Plan transformation logic:

Classes

struct  heffte::logic_plan3d< index >
 The logic plan incorporates the order and types of operations in a transform. More...
 

Functions

template<typename index >
std::array< bool, 3 > heffte::pencil_directions (box3d< index > const world, std::vector< box3d< index >> const &boxes)
 Returns true for each direction where the boxes form pencils (i.e., where the size matches the world size).
 
template<typename index >
logic_plan3d< index > heffte::plan_operations (ioboxes< index > const &boxes, int r2c_direction, plan_options const options, int const mpi_rank)
 Creates the logic plan with the provided user input. More...
 
template<typename index >
std::vector< std::array< int, 3 > > heffte::compute_grids (logic_plan3d< index > const &plan)
 Assuming the shapes in the plan form grids, reverse engineer the grid dimensions (used in the benchmark).
 
int heffte::get_any_valid (std::array< int, 3 > current)
 Returns either 0, 1, 2, so that it does not match any of the current values.
 
template<typename index >
bool heffte::is_pencils (box3d< index > const world, std::vector< box3d< index >> const &shape, std::vector< int > const directions)
 Checks if using pencils in multiple directions simultaneously.
 
template<typename index >
std::vector< box3d< index > > heffte::apply_r2c (std::vector< box3d< index >> const &shape, int r2c_direction)
 Applies the r2c direction reduction to the set of boxes.
 
template<typename index >
bool heffte::order_is_identical (std::vector< box3d< index >> const &shape)
 Checks whether all boxes in the shape have the same order.
 
std::array< int, 3 > heffte::new_order (std::array< int, 3 > current_order, int dimension)
 Swaps the entries so that the dimension will come first.
 
template<typename index >
std::vector< box3d< index > > heffte::next_pencils_shape (box3d< index > const world, std::array< int, 2 > const proc_grid, int const dimension, std::vector< box3d< index >> const &source, bool const use_reorder, box3d< index > const world_out, std::vector< int > const test_directions, std::vector< box3d< index >> const &boxes_out, rank_remap const &remap)
 Creates the next box geometry that corresponds to pencils in the given dimension. More...
 
template<typename index >
std::vector< box3d< index > > heffte::next_pencils_shape0 (box3d< index > const world, std::array< int, 2 > const proc_grid, int const dimension, int const r2c_direction, std::vector< box3d< index >> const &source, bool const use_reorder, box3d< index > const world_out, std::vector< int > const test_directions, std::vector< box3d< index >> const &boxes_out, rank_remap const &remap)
 Similar to next_pencils_shape() but handles a special case of the r2c transformation.
 
template<typename index >
logic_plan3d< index > heffte::plan_pencil_reshapes (box3d< index > world_in, box3d< index > world_out, ioboxes< index > const &boxes, int r2c_direction, plan_options const opts, rank_remap const &remap)
 Creates a plan of reshape operations using pencil decomposition. More...
 
template<typename index >
std::vector< box3d< index > > heffte::reorder_slabs (std::vector< box3d< index >> const &slabs, int dimension, bool use_reorder)
 If use_reorder is false, then returns a copy of the slabs, otherwise changes the order so that dimension comes first.
 
template<typename index >
logic_plan3d< index > heffte::plan_slab_reshapes (box3d< index > world_in, box3d< index > world_out, ioboxes< index > const &boxes, int r2c_direction, plan_options const opts, rank_remap const &remap)
 Creates a plan of reshape operations using slab decomposition.
 

Detailed Description

Implements the analysis of the input and output distribution of the boxes and creates the corresponding plan for reshape and 1-D FFT operations.

Function Documentation

◆ plan_operations()

template<typename index >
logic_plan3d< index > heffte::plan_operations ( ioboxes< index > const &  boxes,
int  r2c_direction,
plan_options const  options,
int const  mpi_rank 
)

Creates the logic plan with the provided user input.

Parameters
boxesis the current distribution of the data across the MPI comm
r2c_directionis the direction is the direction of shrinking of the data for an r2c transform the c2c case should use -1
optionsis a set of heffte::plan_options to use
Returns
the plan for reshape and 1-D fft transformations

◆ next_pencils_shape()

template<typename index >
std::vector<box3d<index> > heffte::next_pencils_shape ( box3d< index > const  world,
std::array< int, 2 > const  proc_grid,
int const  dimension,
std::vector< box3d< index >> const &  source,
bool const  use_reorder,
box3d< index > const  world_out,
std::vector< int > const  test_directions,
std::vector< box3d< index >> const &  boxes_out,
rank_remap const &  remap 
)
inline

Creates the next box geometry that corresponds to pencils in the given dimension.

Similar to heffte::make_pencils(), splits the world into a two dimensional processor grid defined by proc_grid so that the boxes form pencils in the given third dimension. The source corresponds to the current processor grid and is needed to that the next set of boxes will be arranges in way that will improve the overlap with the old set. If use_reorder is set, the new configuration will be transposed so that the dimension will be the new leading (fast) direction.

The world_out and boxes_out correspond to the output geometry of the FFT transformation. If the final geometry satisfies the pencil and order requirements, and if the geometry also gives pencils in the test_directions, then it is best to directly jump to the final configuration.

◆ plan_pencil_reshapes()

template<typename index >
logic_plan3d<index> heffte::plan_pencil_reshapes ( box3d< index >  world_in,
box3d< index >  world_out,
ioboxes< index > const &  boxes,
int  r2c_direction,
plan_options const  opts,
rank_remap const &  remap 
)

Creates a plan of reshape operations using pencil decomposition.

Note that this algorithm will still recognize and utilize the case when the input or output boxes are in slab configuration, but in the general case this will use multiple pencil reshapes.