Python: FFT parallel computing
Question: I have a cluster of few PC's with Ubuntu and MPICH server - I use them to
parallel computing with C++ and MPI. Now I want to do similar with Python. My
question is - is there any easy method to make Fast Fourier Transform on many
CPU cores (on many computers)? Example of usage would be nice. Here is method
I use on single thread:

    
    
    import numpy as np
    N=1024
    tab=np.random.rand(N,N,N) #declare some matrix in 3d
    a=np.random.rand(N,N,N) #declare other matrix
    tab=np.fft.ifftn(a*np.fft.fftn(tab))
    

It's nice to have multithreaded solution when we have 2^30 numbers...


Answer: [MPI4py](http://pythonhosted.org/mpi4py/) in connection with
[pyFFTW](https://pypi.python.org/pypi/pyFFTW). FFTW is highly optimized and
works well on multiple threads but the interface is a little different than
your average FFT as it requires creating 'plans' outright. However, this was
just done to optimize out processing of any static twiddle factors and such.
Additionally, there are lots of options - forward/reverse, in/out-of-place,
int, double, float, etc... See
[benchmarks](http://www.fftw.org/speed/Pentium4-3.60GHz-icc/) for more info.

