mpi4py/mpi4py-fft

How to apply to already distributed array?

DrTodd13 opened this issue · 3 comments

In the Ramba distributed array package (https://github.com/Python-for-HPC/ramba), the arrays are already distributed and Ramba has a mode where inter-node communication is handled by MPI. Ramba tries to provide the NumPy API so would it be possible for Ramba's version of ramba.fft.fft to use mpi4py-fft internally to implement that function?

Hi Todd,
mpi4py-fft is first and foremost an implementation of the distribution algorithm described in this paper. It takes a large multidimensional array and distributes it such that at least one dimension remains non-distributed. This non-distributed dimension is a requirement of the FFT. We use serial FFT along the non-distributed direction, then redistribute to align in a different direction and do the FFT there. So the parallel distribution is an integrated part of mpi4py-fft and I don't think it will be possible to use it internally. Note that one single distribution will not work for a multidimensional FFT. You need to align and re-align the datasets with alltoall calls for it to work.

Thanks Mikael. From a practical perspective, for multi-dimensional arrays, do most applications perform a fft in just one dimension or do they typically do a fft across each of the dimensions of the array (what you call multidimensional FFT)?

In my experience I've seen both, but it's probably most common with a multidimensional FFT on multidimensional arrays.