Chris@10: Chris@10:
Chris@10:Chris@10: Next: MPI Wisdom Communication, Chris@10: Previous: MPI Data Distribution Functions, Chris@10: Up: FFTW MPI Reference Chris@10:
Plans for complex-data DFTs (see 2d MPI example) are created by: Chris@10: Chris@10:
fftw_plan fftw_mpi_plan_dft_1d(ptrdiff_t n0, fftw_complex *in, fftw_complex *out, Chris@10: MPI_Comm comm, int sign, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_2d(ptrdiff_t n0, ptrdiff_t n1, Chris@10: fftw_complex *in, fftw_complex *out, Chris@10: MPI_Comm comm, int sign, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, Chris@10: fftw_complex *in, fftw_complex *out, Chris@10: MPI_Comm comm, int sign, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft(int rnk, const ptrdiff_t *n, Chris@10: fftw_complex *in, fftw_complex *out, Chris@10: MPI_Comm comm, int sign, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_many_dft(int rnk, const ptrdiff_t *n, Chris@10: ptrdiff_t howmany, ptrdiff_t block, ptrdiff_t tblock, Chris@10: fftw_complex *in, fftw_complex *out, Chris@10: MPI_Comm comm, int sign, unsigned flags); Chris@10:Chris@10:
These are similar to their serial counterparts (see Complex DFTs)
Chris@10: in specifying the dimensions, sign, and flags of the transform. The
Chris@10: comm
argument gives an MPI communicator that specifies the set
Chris@10: of processes to participate in the transform; plan creation is a
Chris@10: collective function that must be called for all processes in the
Chris@10: communicator. The in
and out
pointers refer only to a
Chris@10: portion of the overall transform data (see MPI Data Distribution)
Chris@10: as specified by the ‘local_size’ functions in the previous
Chris@10: section. Unless flags
contains FFTW_ESTIMATE
, these
Chris@10: arrays are overwritten during plan creation as for the serial
Chris@10: interface. For multi-dimensional transforms, any dimensions >
Chris@10: 1
are supported; for one-dimensional transforms, only composite
Chris@10: (non-prime) n0
are currently supported (unlike the serial
Chris@10: FFTW). Requesting an unsupported transform size will yield a
Chris@10: NULL
plan. (As in the serial interface, highly composite sizes
Chris@10: generally yield the best performance.)
Chris@10:
Chris@10:
The advanced-interface fftw_mpi_plan_many_dft
additionally
Chris@10: allows you to specify the block sizes for the first dimension
Chris@10: (block
) of the n0 × n1 × n2 × … × nd-1 input data and the first dimension
Chris@10: (tblock
) of the n1 × n0 × n2 ×…× nd-1 transposed data (at intermediate
Chris@10: steps of the transform, and for the output if
Chris@10: FFTW_TRANSPOSED_OUT
is specified in flags
). These must
Chris@10: be the same block sizes as were passed to the corresponding
Chris@10: ‘local_size’ function; you can pass FFTW_MPI_DEFAULT_BLOCK
Chris@10: to use FFTW's default block size as in the basic interface. Also, the
Chris@10: howmany
parameter specifies that the transform is of contiguous
Chris@10: howmany
-tuples rather than individual complex numbers; this
Chris@10: corresponds to the same parameter in the serial advanced interface
Chris@10: (see Advanced Complex DFTs) with stride = howmany
and
Chris@10: dist = 1
.
Chris@10:
Chris@10:
The flags
can be any of those for the serial FFTW
Chris@10: (see Planner Flags), and in addition may include one or more of
Chris@10: the following MPI-specific flags, which improve performance at the
Chris@10: cost of changing the output or input data formats.
Chris@10:
Chris@10:
FFTW_MPI_SCRAMBLED_OUT
, FFTW_MPI_SCRAMBLED_IN
: valid for
Chris@10: 1d transforms only, these flags indicate that the output/input of the
Chris@10: transform are in an undocumented “scrambled” order. A forward
Chris@10: FFTW_MPI_SCRAMBLED_OUT
transform can be inverted by a backward
Chris@10: FFTW_MPI_SCRAMBLED_IN
(times the usual 1/N normalization).
Chris@10: See One-dimensional distributions.
Chris@10:
Chris@10: FFTW_MPI_TRANSPOSED_OUT
, FFTW_MPI_TRANSPOSED_IN
: valid
Chris@10: for multidimensional (rnk > 1
) transforms only, these flags
Chris@10: specify that the output or input of an n0 × n1 × n2 × … × nd-1 transform is
Chris@10: transposed to n1 × n0 × n2 ×…× nd-1. See Transposed distributions.
Chris@10:
Chris@10: Plans for real-input/output (r2c/c2r) DFTs (see Multi-dimensional MPI DFTs of Real Data) are created by: Chris@10: Chris@10:
fftw_plan fftw_mpi_plan_dft_r2c_2d(ptrdiff_t n0, ptrdiff_t n1, Chris@10: double *in, fftw_complex *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_r2c_2d(ptrdiff_t n0, ptrdiff_t n1, Chris@10: double *in, fftw_complex *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_r2c_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, Chris@10: double *in, fftw_complex *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_r2c(int rnk, const ptrdiff_t *n, Chris@10: double *in, fftw_complex *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_c2r_2d(ptrdiff_t n0, ptrdiff_t n1, Chris@10: fftw_complex *in, double *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_c2r_2d(ptrdiff_t n0, ptrdiff_t n1, Chris@10: fftw_complex *in, double *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_c2r_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, Chris@10: fftw_complex *in, double *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_dft_c2r(int rnk, const ptrdiff_t *n, Chris@10: fftw_complex *in, double *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10:Chris@10:
Similar to the serial interface (see Real-data DFTs), these Chris@10: transform logically n0 × n1 × n2 × … × nd-1 real data to/from n0 × n1 × n2 × … × (nd-1/2 + 1) complex Chris@10: data, representing the non-redundant half of the conjugate-symmetry Chris@10: output of a real-input DFT (see Multi-dimensional Transforms). Chris@10: However, the real array must be stored within a padded n0 × n1 × n2 × … × [2 (nd-1/2 + 1)] Chris@10: Chris@10:
array (much like the in-place serial r2c transforms, but here for
Chris@10: out-of-place transforms as well). Currently, only multi-dimensional
Chris@10: (rnk > 1
) r2c/c2r transforms are supported (requesting a plan
Chris@10: for rnk = 1
will yield NULL
). As explained above
Chris@10: (see Multi-dimensional MPI DFTs of Real Data), the data
Chris@10: distribution of both the real and complex arrays is given by the
Chris@10: ‘local_size’ function called for the dimensions of the
Chris@10: complex array. Similar to the other planning functions, the
Chris@10: input and output arrays are overwritten when the plan is created
Chris@10: except in FFTW_ESTIMATE
mode.
Chris@10:
Chris@10:
As for the complex DFTs above, there is an advance interface that
Chris@10: allows you to manually specify block sizes and to transform contiguous
Chris@10: howmany
-tuples of real/complex numbers:
Chris@10:
Chris@10:
fftw_plan fftw_mpi_plan_many_dft_r2c Chris@10: (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, Chris@10: ptrdiff_t iblock, ptrdiff_t oblock, Chris@10: double *in, fftw_complex *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_many_dft_c2r Chris@10: (int rnk, const ptrdiff_t *n, ptrdiff_t howmany, Chris@10: ptrdiff_t iblock, ptrdiff_t oblock, Chris@10: fftw_complex *in, double *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10:Chris@10:
There are corresponding plan-creation routines for r2r
Chris@10: transforms (see More DFTs of Real Data), currently supporting
Chris@10: multidimensional (rnk > 1
) transforms only (rnk = 1
will
Chris@10: yield a NULL
plan):
Chris@10:
Chris@10:
fftw_plan fftw_mpi_plan_r2r_2d(ptrdiff_t n0, ptrdiff_t n1, Chris@10: double *in, double *out, Chris@10: MPI_Comm comm, Chris@10: fftw_r2r_kind kind0, fftw_r2r_kind kind1, Chris@10: unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_r2r_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2, Chris@10: double *in, double *out, Chris@10: MPI_Comm comm, Chris@10: fftw_r2r_kind kind0, fftw_r2r_kind kind1, fftw_r2r_kind kind2, Chris@10: unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_r2r(int rnk, const ptrdiff_t *n, Chris@10: double *in, double *out, Chris@10: MPI_Comm comm, const fftw_r2r_kind *kind, Chris@10: unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_many_r2r(int rnk, const ptrdiff_t *n, Chris@10: ptrdiff_t iblock, ptrdiff_t oblock, Chris@10: double *in, double *out, Chris@10: MPI_Comm comm, const fftw_r2r_kind *kind, Chris@10: unsigned flags); Chris@10:Chris@10:
The parameters are much the same as for the complex DFTs above, except
Chris@10: that the arrays are of real numbers (and hence the outputs of the
Chris@10: ‘local_size’ data-distribution functions should be interpreted as
Chris@10: counts of real rather than complex numbers). Also, the kind
Chris@10: parameters specify the r2r kinds along each dimension as for the
Chris@10: serial interface (see Real-to-Real Transform Kinds). See Other Multi-dimensional Real-data MPI Transforms.
Chris@10:
Chris@10:
Chris@10: FFTW also provides routines to plan a transpose of a distributed
Chris@10: n0
by n1
array of real numbers, or an array of
Chris@10: howmany
-tuples of real numbers with specified block sizes
Chris@10: (see FFTW MPI Transposes):
Chris@10:
Chris@10:
fftw_plan fftw_mpi_plan_transpose(ptrdiff_t n0, ptrdiff_t n1, Chris@10: double *in, double *out, Chris@10: MPI_Comm comm, unsigned flags); Chris@10: fftw_plan fftw_mpi_plan_many_transpose Chris@10: (ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t howmany, Chris@10: ptrdiff_t block0, ptrdiff_t block1, Chris@10: double *in, double *out, MPI_Comm comm, unsigned flags); Chris@10:Chris@10:
These plans are used with the fftw_mpi_execute_r2r
new-array
Chris@10: execute function (see Using MPI Plans), since they count as (rank
Chris@10: zero) r2r plans from FFTW's perspective.
Chris@10:
Chris@10:
Chris@10: