ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
fft Namespace Reference

Namespaces

namespace  anonymous_namespace{fft.cpp}
 

Classes

struct  allocator
 Aligned allocator for FFT data. More...
 
struct  fft_back_plan
 Plan for a backward 1D FFT of a flattened 3D array. More...
 
struct  fft_data_struct
 Information about the three one dimensional FFTs and how the nodes have to communicate inbetween. More...
 
struct  fft_forw_plan
 Plan for a forward 1D FFT of a flattened 3D array. More...
 
struct  fft_plan
 
struct  fftw
 
struct  fftw< float >
 

Typedefs

template<class T >
using vector = std::vector< T, allocator< T > >
 

Functions

std::optional< std::vector< int > > find_comm_groups (Utils::Vector3i const &grid1, Utils::Vector3i const &grid2, std::span< int const > node_list1, std::span< int > node_list2, std::span< int > pos, std::span< int > my_pos, int rank)
 This ugly function does the bookkeeping: which nodes have to communicate to each other, when you change the node grid.
 
int map_3don2d_grid (int const g3d[3], int g2d[3])
 Calculate 'best' mapping between a 2D and 3D grid.
 
void calc_2d_grid (int n, int grid[3])
 Calculate most square 2D grid.
 

Typedef Documentation

◆ vector

template<class T >
using fft::vector = typedef std::vector<T, allocator<T> >

Definition at line 52 of file vector.hpp.

Function Documentation

◆ calc_2d_grid()

void fft::calc_2d_grid ( int  n,
int  grid[3] 
)
inline

Calculate most square 2D grid.

Definition at line 501 of file fft.cpp.

Referenced by fft::fft_data_struct< FloatType >::initialize_fft().

◆ find_comm_groups()

std::optional< std::vector< int > > fft::find_comm_groups ( Utils::Vector3i const &  grid1,
Utils::Vector3i const &  grid2,
std::span< int const >  node_list1,
std::span< int >  node_list2,
std::span< int >  pos,
std::span< int >  my_pos,
int  rank 
)

This ugly function does the bookkeeping: which nodes have to communicate to each other, when you change the node grid.

Changing the regular decomposition requires communication. This function finds (hopefully) the best way to do this. As input it needs the two grids (grid1, grid2) and a linear list (node_list1) with the node identities for grid1. The linear list (node_list2) for the second grid is calculated. For the communication group of the calling node it calculates a list (group) with the node identities and the positions (my_pos, pos) of that nodes in grid1 and grid2. The return value is the size of the communication group. It gives -1 if the two grids do not fit to each other (grid1 and grid2 have to be component-wise multiples of each other, see e.g. calc_2d_grid for how to do this).

Parameters
[in]grid1The node grid you start with.
[in]grid2The node grid you want to have.
[in]node_list1Linear node index list for grid1.
[out]node_list2Linear node index list for grid2.
[out]posPositions of the nodes in grid2
[out]my_posPosition of comm.rank() in grid2.
[in]rankMPI rank.
Returns
Size of the communication group.

Definition at line 117 of file fft.cpp.

References Utils::get_linear_index(), and Utils::product().

Referenced by fft::fft_data_struct< FloatType >::initialize_fft().

◆ map_3don2d_grid()

int fft::map_3don2d_grid ( int const  g3d[3],
int  g2d[3] 
)

Calculate 'best' mapping between a 2D and 3D grid.

Required for the communication from 3D regular domain decomposition to 2D regular row decomposition. The dimensions of the 2D grid are resorted, if necessary, in a way that they are multiples of the 3D grid dimensions.

Parameters
g3d3D grid.
g2d2D grid.
Returns
index of the row direction [0,1,2].

Definition at line 459 of file fft.cpp.

Referenced by fft::fft_data_struct< FloatType >::initialize_fft().