ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
Functions | |
int | calc_local_mesh (const int *n_pos, const int *n_grid, const int *mesh, const double *mesh_off, int *loc_mesh, int *start) |
Calculate the local fft mesh. | |
int | calc_send_block (const int *pos1, const int *grid1, const int *pos2, const int *grid2, const int *mesh, const double *mesh_off, int *block) |
Calculate a send (or recv.) block for grid communication during a decomposition change. | |
template<typename FloatType > | |
void | pack_block_permute1 (FloatType const *const in, FloatType *const out, const int *start, const int *size, const int *dim, int element) |
Pack a block with dimensions size[0] * size[1] * size[2] starting at start of an input 3D-grid with dimension dim into an output 3D-grid with dimensions size[2] * size[0] * size[1] with a simultaneous one-fold permutation of the indices. | |
template<typename FloatType > | |
void | pack_block_permute2 (FloatType const *const in, FloatType *const out, const int *start, const int *size, const int *dim, int element) |
Pack a block with dimensions size[0] * size[1] * size[2] starting at start of an input 3D-grid with dimension dim into an output 3D-grid with dimensions size[2] * size[0] * size[1] with a simultaneous two-fold permutation of the indices. | |
int fft::anonymous_namespace{fft.cpp}::calc_local_mesh | ( | const int * | n_pos, |
const int * | n_grid, | ||
const int * | mesh, | ||
const double * | mesh_off, | ||
int * | loc_mesh, | ||
int * | start | ||
) |
Calculate the local fft mesh.
Calculate the local mesh (loc_mesh
) of a node at position (n_pos
) in a node grid (n_grid
) for a global mesh of size (mesh
) and a mesh offset (mesh_off
(in mesh units)) and store also the first point (start
) of the local mesh.
[in] | n_pos | Position of the node in n_grid . |
[in] | n_grid | node grid. |
[in] | mesh | global mesh dimensions. |
[in] | mesh_off | global mesh offset. |
[out] | loc_mesh | local mesh dimension. |
[out] | start | first point of local mesh in global mesh. |
Definition at line 222 of file fft.cpp.
References calc_local_mesh().
Referenced by calc_local_mesh(), and calc_send_block().
int fft::anonymous_namespace{fft.cpp}::calc_send_block | ( | const int * | pos1, |
const int * | grid1, | ||
const int * | pos2, | ||
const int * | grid2, | ||
const int * | mesh, | ||
const double * | mesh_off, | ||
int * | block | ||
) |
Calculate a send (or recv.) block for grid communication during a decomposition change.
Calculate the send block specification (block = lower left corner and upper right corner) which a node at position (pos1
) in the actual node grid (grid1
) has to send to another node at position (pos2
) in the desired node grid (grid2
). The global mesh, subject to communication, is specified via its size (mesh
) and its mesh offset (mesh_off
(in mesh units)).
For the calculation of a receive block you have to change the arguments in the following way:
pos1:
position of receiving node in the desired node grid.grid1:
desired node grid.pos2:
position of the node you intend to receive the data from in the actual node grid.grid2:
actual node grid.[in] | pos1 | Position of send node in grid1 . |
[in] | grid1 | node grid 1. |
[in] | pos2 | Position of recv node in grid2 . |
[in] | grid2 | node grid 2. |
[in] | mesh | global mesh dimensions. |
[in] | mesh_off | global mesh offset. |
[out] | block | send block specification. |
Definition at line 266 of file fft.cpp.
References block(), calc_local_mesh(), and calc_send_block().
Referenced by calc_send_block().
void fft::anonymous_namespace{fft.cpp}::pack_block_permute1 | ( | FloatType const *const | in, |
FloatType *const | out, | ||
const int * | start, | ||
const int * | size, | ||
const int * | dim, | ||
int | element | ||
) |
Pack a block with dimensions size[0] * size[1] * size[2]
starting at start
of an input 3D-grid with dimension dim
into an output 3D-grid with dimensions size[2] * size[0] * size[1]
with a simultaneous one-fold permutation of the indices.
The permutation is defined as: slow_in -> fast_out, mid_in ->slow_out, fast_in -> mid_out.
An element (i0_in, i1_in, i2_in)
is then (i0_out = i1_in-start[1], i1_out = i2_in-start[2], i2_out = i0_in-start[0])
and for the linear indices we have:
li_in = i2_in + size[2] * (i1_in + (size[1]*i0_in))
li_out = i2_out + size[0] * (i1_out + (size[2]*i0_out))
For index definition see fft_pack_block.
[in] | in | input 3D-grid. |
[out] | out | output 3D-grid (block). |
[in] | start | start index of the block in the in-grid. |
[in] | size | size of the block (=dimension of the out-grid). |
[in] | dim | size of the in-grid. |
[in] | element | size of a grid element (e.g. 1 for Real, 2 for Complex). |
Definition at line 308 of file fft.cpp.
References pack_block_permute1().
Referenced by pack_block_permute1().
void fft::anonymous_namespace{fft.cpp}::pack_block_permute2 | ( | FloatType const *const | in, |
FloatType *const | out, | ||
const int * | start, | ||
const int * | size, | ||
const int * | dim, | ||
int | element | ||
) |
Pack a block with dimensions size[0] * size[1] * size[2]
starting at start
of an input 3D-grid with dimension dim
into an output 3D-grid with dimensions size[2] * size[0] * size[1]
with a simultaneous two-fold permutation of the indices.
The permutation is defined as: slow_in -> mid_out, mid_in ->fast_out, fast_in -> slow_out.
An element (i0_in, i1_in, i2_in)
is then (i0_out = i2_in-start[2], i1_out = i0_in-start[0], i2_out = i1_in-start[1])
and for the linear indices we have:
li_in = i2_in + size[2] * (i1_in + (size[1]*i0_in))
li_out = i2_out + size[0] * (i1_out + (size[2]*i0_out))
For index definition see fft_pack_block.
[in] | in | input 3D-grid. |
[out] | out | output 3D-grid (block). |
[in] | start | start index of the block in the in-grid. |
[in] | size | size of the block (=dimension of the out-grid). |
[in] | dim | size of the in-grid. |
[in] | element | size of a grid element (e.g. 1 for Real, 2 for Complex). |
Definition at line 357 of file fft.cpp.
References pack_block_permute2().
Referenced by pack_block_permute2().