Gromacs
2020.4

Contents of the Intel MKL FFT fft datatype.
Note that this is one of several possible implementations of gmx_fft_t.
The MKL API supports 1D,2D, and 3D transforms, including realtocomplex. Unfortunately the actual library implementation does not support 3D real transforms as of version 7.2, and versions before 7.0 don't support 2D real either. In addition, the multidimensional storage format for real data is not compatible with our padding.
To work around this we roll our own 2D and 3D realtocomplex transforms, using separate X/Y/Z handles defined to perform (ny*nz), (nx*nz), and (nx*ny) transforms at once when necessary. To perform strided multiple transforms outofplace (i.e., without padding in the last dimension) on the fly we also need to separate the forward and backward handles for realtocomplex/complextoreal data permutation.
This makes it necessary to define 3 handles for inplace FFTs, and 4 for the outofplace transforms. Still, whenever possible we try to use a single 3Dtransform handle instead.
So, the handles are enumerated as follows:
1D FFT (real too): Index 0 is the handle for the entire FFT 2D complex FFT: Index 0 is the handle for the entire FFT 3D complex FFT: Index 0 is the handle for the entire FFT 2D, inplace real FFT: 0=FFTx, 1=FFTy handle 2D, ooplace real FFT: 0=FFTx, 1=realtocomplex FFTy, 2=complextoreal FFTy 3D, inplace real FFT: 0=FFTx, 1=FFTy, 2=FFTz handle 3D, ooplace real FFT: 0=FFTx, 1=FFTy, 2=r2c FFTz, 3=c2r FFTz
Intel people reading this: Learn from FFTW what a good interface looks like :)
Public Attributes  
int  ndim 
Number of dimensions in FFT.  
int  nx 
Length of X transform.  
int  ny 
Length of Y transform.  
int  nz 
Length of Z transform.  
int  real_fft 
1 if real FFT, otherwise 0  
DFTI_DESCRIPTOR *  inplace [3] 
inplace FFT  
DFTI_DESCRIPTOR *  ooplace [4] 
outofplace FFT  
t_complex *  work 
Enable outofplace c2r FFT.  