# FluidFFT documentation¶

This package provides C++ classes and their Python wrapper classes useful to perform Fast Fourier Transform (FFT) with different libraries, in particular

pfft and p3dfft are specialized in computing FFT efficiently on several cores of big clusters. The data is split in pencils and the computations can be distributed on several processes.

FluidFFT provides an unified API to use all these libraries. FluidFFT is not limited to just performing Fourier transforms. It is a complete development framework for codes using (distributed) FFT. A simple API allows the developers to easily perform operations on data in real and spectral spaces (gradient, divergence, rotational, sum over wavenumbers, computation of spectra, etc.) and deal with the data distribution (gather the data on one process and scatter the data to many processes) without having to consider the internal organization of every FFT library.

FluidFFT has been created to be:

• Easy to install (see Installation and advice).

• Easy to use, both for simple users and for developers (see Tutorials). FluidFFT hides the internal complication of (distributed) FFT libraries.

• Robust (unittest coverage larger than 90 %).

• Highly efficient.

The architecture of the code and the tools used (C++ classes, Cython wrapper and Pythran / Transonic computational functions) leads to very good performances.

Moreover, Python developers can easily measure the performance cost of using Python compared to coding in pure C++. This cost has to be compared to the cost of the FFT in pure C++, which of course strongly varies with the size of the arrays. From our experience with real cases, the “Python cost” goes from very small (for small cases) to completely negligible (for medium and large cases).

A great advantage of FluidFFT is that it allows the user to find (see Benchmarking) and to choose the most efficient solution for a particular case. Since the fastest library depends on the case and on the hardware, it is really a useful feature for performance!

FluidFFT is therefore a very useful tool to write HPC applications using FFT, as for example pseudo-spectral simulation codes. For an example of how FluidFFT can be used in a real application, see the code of the Computational Fluid Dynamics (CFD) framework FluidSim.

Metapapers and citations

If you use FluidFFT to produce scientific articles, please cite our metapapers presenting the FluidDyn project and Fluidfft:

@article{fluiddyn,
doi = {10.5334/jors.237},
year = {2019},
publisher = {Ubiquity Press,  Ltd.},
volume = {7},
author = {Pierre Augier and Ashwin Vishnu Mohanan and Cyrille Bonamy},
title = {{FluidDyn}: A Python Open-Source Framework for Research and Teaching in Fluid Dynamics
by Simulations,  Experiments and Data Processing},
journal = {Journal of Open Research Software}
}

@article{fluidfft,
doi = {10.5334/jors.238},
year = {2019},
publisher = {Ubiquity Press,  Ltd.},
volume = {7},
author = {Ashwin Vishnu Mohanan and Cyrille Bonamy and Pierre Augier},
title = {{FluidFFT}: Common {API} (C$\mathplus\mathplus$ and Python)
for Fast Fourier Transform {HPC} Libraries},
journal = {Journal of Open Research Software}
}


## Modules Reference¶

 fluidfft Efficient and easy Fast Fourier Transform for Python