cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: FFTW 3.3.5: MPI Plan Creation cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127:
cannam@127:

cannam@127: Next: , Previous: , Up: FFTW MPI Reference   [Contents][Index]

cannam@127:
cannam@127:
cannam@127: cannam@127:

6.12.5 MPI Plan Creation

cannam@127: cannam@127: cannam@127:

Complex-data MPI DFTs

cannam@127: cannam@127:

Plans for complex-data DFTs (see 2d MPI example) are created by: cannam@127:

cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127:
cannam@127:
fftw_plan fftw_mpi_plan_dft_1d(ptrdiff_t n0, fftw_complex *in, fftw_complex *out,
cannam@127:                                MPI_Comm comm, int sign, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_2d(ptrdiff_t n0, ptrdiff_t n1,
cannam@127:                                fftw_complex *in, fftw_complex *out,
cannam@127:                                MPI_Comm comm, int sign, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2,
cannam@127:                                fftw_complex *in, fftw_complex *out,
cannam@127:                                MPI_Comm comm, int sign, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft(int rnk, const ptrdiff_t *n, 
cannam@127:                             fftw_complex *in, fftw_complex *out,
cannam@127:                             MPI_Comm comm, int sign, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_many_dft(int rnk, const ptrdiff_t *n,
cannam@127:                                  ptrdiff_t howmany, ptrdiff_t block, ptrdiff_t tblock,
cannam@127:                                  fftw_complex *in, fftw_complex *out,
cannam@127:                                  MPI_Comm comm, int sign, unsigned flags);
cannam@127: 
cannam@127: cannam@127: cannam@127: cannam@127:

These are similar to their serial counterparts (see Complex DFTs) cannam@127: in specifying the dimensions, sign, and flags of the transform. The cannam@127: comm argument gives an MPI communicator that specifies the set cannam@127: of processes to participate in the transform; plan creation is a cannam@127: collective function that must be called for all processes in the cannam@127: communicator. The in and out pointers refer only to a cannam@127: portion of the overall transform data (see MPI Data Distribution) cannam@127: as specified by the ‘local_size’ functions in the previous cannam@127: section. Unless flags contains FFTW_ESTIMATE, these cannam@127: arrays are overwritten during plan creation as for the serial cannam@127: interface. For multi-dimensional transforms, any dimensions > cannam@127: 1 are supported; for one-dimensional transforms, only composite cannam@127: (non-prime) n0 are currently supported (unlike the serial cannam@127: FFTW). Requesting an unsupported transform size will yield a cannam@127: NULL plan. (As in the serial interface, highly composite sizes cannam@127: generally yield the best performance.) cannam@127:

cannam@127: cannam@127: cannam@127: cannam@127:

The advanced-interface fftw_mpi_plan_many_dft additionally cannam@127: allows you to specify the block sizes for the first dimension cannam@127: (block) of the n0 × n1 × n2 × … × nd-1 input data and the first dimension cannam@127: (tblock) of the n1 × n0 × n2 ×…× nd-1 transposed data (at intermediate cannam@127: steps of the transform, and for the output if cannam@127: FFTW_TRANSPOSED_OUT is specified in flags). These must cannam@127: be the same block sizes as were passed to the corresponding cannam@127: ‘local_size’ function; you can pass FFTW_MPI_DEFAULT_BLOCK cannam@127: to use FFTW’s default block size as in the basic interface. Also, the cannam@127: howmany parameter specifies that the transform is of contiguous cannam@127: howmany-tuples rather than individual complex numbers; this cannam@127: corresponds to the same parameter in the serial advanced interface cannam@127: (see Advanced Complex DFTs) with stride = howmany and cannam@127: dist = 1. cannam@127:

cannam@127: cannam@127:

MPI flags

cannam@127: cannam@127:

The flags can be any of those for the serial FFTW cannam@127: (see Planner Flags), and in addition may include one or more of cannam@127: the following MPI-specific flags, which improve performance at the cannam@127: cost of changing the output or input data formats. cannam@127:

cannam@127: cannam@127: cannam@127: cannam@127:

Real-data MPI DFTs

cannam@127: cannam@127: cannam@127:

Plans for real-input/output (r2c/c2r) DFTs (see Multi-dimensional MPI DFTs of Real Data) are created by: cannam@127:

cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: cannam@127:
cannam@127:
fftw_plan fftw_mpi_plan_dft_r2c_2d(ptrdiff_t n0, ptrdiff_t n1, 
cannam@127:                                    double *in, fftw_complex *out,
cannam@127:                                    MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_r2c_2d(ptrdiff_t n0, ptrdiff_t n1, 
cannam@127:                                    double *in, fftw_complex *out,
cannam@127:                                    MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_r2c_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2,
cannam@127:                                    double *in, fftw_complex *out,
cannam@127:                                    MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_r2c(int rnk, const ptrdiff_t *n,
cannam@127:                                 double *in, fftw_complex *out,
cannam@127:                                 MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_c2r_2d(ptrdiff_t n0, ptrdiff_t n1, 
cannam@127:                                    fftw_complex *in, double *out,
cannam@127:                                    MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_c2r_2d(ptrdiff_t n0, ptrdiff_t n1, 
cannam@127:                                    fftw_complex *in, double *out,
cannam@127:                                    MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_c2r_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2,
cannam@127:                                    fftw_complex *in, double *out,
cannam@127:                                    MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_dft_c2r(int rnk, const ptrdiff_t *n,
cannam@127:                                 fftw_complex *in, double *out,
cannam@127:                                 MPI_Comm comm, unsigned flags);
cannam@127: 
cannam@127: cannam@127:

Similar to the serial interface (see Real-data DFTs), these cannam@127: transform logically n0 × n1 × n2 × … × nd-1 real data to/from n0 × n1 × n2 × … × (nd-1/2 + 1) complex cannam@127: data, representing the non-redundant half of the conjugate-symmetry cannam@127: output of a real-input DFT (see Multi-dimensional Transforms). cannam@127: However, the real array must be stored within a padded n0 × n1 × n2 × … × [2 (nd-1/2 + 1)] cannam@127: array (much like the in-place serial r2c transforms, but here for cannam@127: out-of-place transforms as well). Currently, only multi-dimensional cannam@127: (rnk > 1) r2c/c2r transforms are supported (requesting a plan cannam@127: for rnk = 1 will yield NULL). As explained above cannam@127: (see Multi-dimensional MPI DFTs of Real Data), the data cannam@127: distribution of both the real and complex arrays is given by the cannam@127: ‘local_size’ function called for the dimensions of the cannam@127: complex array. Similar to the other planning functions, the cannam@127: input and output arrays are overwritten when the plan is created cannam@127: except in FFTW_ESTIMATE mode. cannam@127:

cannam@127:

As for the complex DFTs above, there is an advance interface that cannam@127: allows you to manually specify block sizes and to transform contiguous cannam@127: howmany-tuples of real/complex numbers: cannam@127:

cannam@127: cannam@127: cannam@127:
cannam@127:
fftw_plan fftw_mpi_plan_many_dft_r2c
cannam@127:               (int rnk, const ptrdiff_t *n, ptrdiff_t howmany,
cannam@127:                ptrdiff_t iblock, ptrdiff_t oblock,
cannam@127:                double *in, fftw_complex *out,
cannam@127:                MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_many_dft_c2r
cannam@127:               (int rnk, const ptrdiff_t *n, ptrdiff_t howmany,
cannam@127:                ptrdiff_t iblock, ptrdiff_t oblock,
cannam@127:                fftw_complex *in, double *out,
cannam@127:                MPI_Comm comm, unsigned flags);               
cannam@127: 
cannam@127: cannam@127: cannam@127:

MPI r2r transforms

cannam@127: cannam@127: cannam@127:

There are corresponding plan-creation routines for r2r cannam@127: transforms (see More DFTs of Real Data), currently supporting cannam@127: multidimensional (rnk > 1) transforms only (rnk = 1 will cannam@127: yield a NULL plan): cannam@127:

cannam@127:
cannam@127:
fftw_plan fftw_mpi_plan_r2r_2d(ptrdiff_t n0, ptrdiff_t n1,
cannam@127:                                double *in, double *out,
cannam@127:                                MPI_Comm comm,
cannam@127:                                fftw_r2r_kind kind0, fftw_r2r_kind kind1,
cannam@127:                                unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_r2r_3d(ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t n2,
cannam@127:                                double *in, double *out,
cannam@127:                                MPI_Comm comm,
cannam@127:                                fftw_r2r_kind kind0, fftw_r2r_kind kind1, fftw_r2r_kind kind2,
cannam@127:                                unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_r2r(int rnk, const ptrdiff_t *n,
cannam@127:                             double *in, double *out,
cannam@127:                             MPI_Comm comm, const fftw_r2r_kind *kind, 
cannam@127:                             unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_many_r2r(int rnk, const ptrdiff_t *n,
cannam@127:                                  ptrdiff_t iblock, ptrdiff_t oblock,
cannam@127:                                  double *in, double *out,
cannam@127:                                  MPI_Comm comm, const fftw_r2r_kind *kind, 
cannam@127:                                  unsigned flags);
cannam@127: 
cannam@127: cannam@127:

The parameters are much the same as for the complex DFTs above, except cannam@127: that the arrays are of real numbers (and hence the outputs of the cannam@127: ‘local_size’ data-distribution functions should be interpreted as cannam@127: counts of real rather than complex numbers). Also, the kind cannam@127: parameters specify the r2r kinds along each dimension as for the cannam@127: serial interface (see Real-to-Real Transform Kinds). See Other Multi-dimensional Real-data MPI Transforms. cannam@127:

cannam@127: cannam@127:

MPI transposition

cannam@127: cannam@127: cannam@127:

FFTW also provides routines to plan a transpose of a distributed cannam@127: n0 by n1 array of real numbers, or an array of cannam@127: howmany-tuples of real numbers with specified block sizes cannam@127: (see FFTW MPI Transposes): cannam@127:

cannam@127: cannam@127: cannam@127:
cannam@127:
fftw_plan fftw_mpi_plan_transpose(ptrdiff_t n0, ptrdiff_t n1,
cannam@127:                                   double *in, double *out,
cannam@127:                                   MPI_Comm comm, unsigned flags);
cannam@127: fftw_plan fftw_mpi_plan_many_transpose
cannam@127:                 (ptrdiff_t n0, ptrdiff_t n1, ptrdiff_t howmany,
cannam@127:                  ptrdiff_t block0, ptrdiff_t block1,
cannam@127:                  double *in, double *out, MPI_Comm comm, unsigned flags);
cannam@127: 
cannam@127: cannam@127: cannam@127: cannam@127:

These plans are used with the fftw_mpi_execute_r2r new-array cannam@127: execute function (see Using MPI Plans), since they count as (rank cannam@127: zero) r2r plans from FFTW’s perspective. cannam@127:

cannam@127:
cannam@127:
cannam@127:

cannam@127: Next: , Previous: , Up: FFTW MPI Reference   [Contents][Index]

cannam@127:
cannam@127: cannam@127: cannam@127: cannam@127: cannam@127: