Skip to main content

Efficient and easy Fast Fourier Transform (FFT) for Python.

Project description

FluidFFT

Efficient and easy Fast Fourier Transform for Python

Latest version Supported Python versions Documentation status Code coverage Heptapod CI Github Actions Linux Github Actions Pixi

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

pfft, p3dfft and mpi4py-fft are specialized in computing FFT efficiently on several cores of big clusters. The data can be split in pencils and can be distributed on several processes.

Documentation: https://fluidfft.readthedocs.io

Getting started

To try fluidfft without installation: Binder notebook

For a basic installation which relies only on a pyFFTW interface; or provided you have the optional FFT libaries, that you need, installed and discoverable in your path (see environment variables LIBRARY_PATH, LD_LIBRARY_PATH, CPATH) it should be sufficient to run:

pip install fluidfft [--user]

Add --user flag if you are installing without setting up a virtual environment.

Installation

To take full advantage of fluidfft, consider installing the following (optional) dependencies and configurations before installing fluidfft. Click on the links to know more:

  1. OpenMPI or equivalent
  2. FFT libraries such as MPI-enabled FFTW (for 2D and 3D solvers) and P3DFFT, PFFT (for 3D solvers) either using a package manager or from source
  3. Python packages fluiddyn cython pyfftw pythran mpi4py
  4. A C++11 compiler and BLAS libraries and configure ~/.pythranrc to customize compilation of Pythran extensions
  5. Configure ~/.fluidfft-site.cfg to detect the FFT libraries and install fluidfft

Note: Detailed instructions to install the above dependencies using Anaconda / Miniconda or in a specific operating system such as Ubuntu, macOS etc. can be found here.

C++ API

See a working minimal example with Makefile which illustrates how to use the C++ API.

Tests

From the root directory:

make tests
make tests_mpi

Or, from the root directory or any of the "test" directories:

pytest -s
mpirun -np 2 pytest -s

How does it work?

Fluidfft provides classes to use in a transparent way all these libraries with an unified API. These classes are not limited to just performing Fourier transforms. They are also an elegant solution to efficiently perform operations on data in real and spectral spaces (gradient, divergence, rotational, sum over wavenumbers, computation of spectra, etc.) and easily deal with the data distribution (gather the data on one process, scatter the data to many processes) without having to know the internal organization of every FFT library.

Fluidfft hides the internal complication of (distributed) FFT libraries and allows the user to find (by benchmarking) and to choose the most efficient solution for a particular case. Fluidfft is therefore a very useful tool to write HPC applications using FFT, as for example pseudo-spectral simulation codes. In particular, fluidfft is used in the Computational Fluid Dynamics (CFD) framework fluidsim.

License

Fluidfft is distributed under the CeCILL License, a GPL compatible french license.

Metapapers and citations

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluidfft-0.4.0.post1.tar.gz (426.6 kB view hashes)

Uploaded Source

Built Distributions

fluidfft-0.4.0.post1-cp312-cp312-win_amd64.whl (235.1 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

fluidfft-0.4.0.post1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (212.8 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

fluidfft-0.4.0.post1-cp312-cp312-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (231.9 kB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

fluidfft-0.4.0.post1-cp312-cp312-macosx_11_0_arm64.whl (284.1 kB view hashes)

Uploaded CPython 3.12 macOS 11.0+ ARM64

fluidfft-0.4.0.post1-cp312-cp312-macosx_10_9_x86_64.whl (311.9 kB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

fluidfft-0.4.0.post1-cp311-cp311-win_amd64.whl (234.9 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

fluidfft-0.4.0.post1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (209.6 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

fluidfft-0.4.0.post1-cp311-cp311-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (232.9 kB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

fluidfft-0.4.0.post1-cp311-cp311-macosx_11_0_arm64.whl (281.5 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ ARM64

fluidfft-0.4.0.post1-cp311-cp311-macosx_10_9_x86_64.whl (308.8 kB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

fluidfft-0.4.0.post1-cp310-cp310-win_amd64.whl (234.9 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

fluidfft-0.4.0.post1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (209.5 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

fluidfft-0.4.0.post1-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (231.6 kB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

fluidfft-0.4.0.post1-cp310-cp310-macosx_11_0_arm64.whl (281.5 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ ARM64

fluidfft-0.4.0.post1-cp310-cp310-macosx_10_9_x86_64.whl (308.8 kB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

fluidfft-0.4.0.post1-cp39-cp39-win_amd64.whl (234.8 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

fluidfft-0.4.0.post1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (209.3 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

fluidfft-0.4.0.post1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (233.7 kB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64 manylinux: glibc 2.17+ x86-64

fluidfft-0.4.0.post1-cp39-cp39-macosx_11_0_arm64.whl (281.5 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

fluidfft-0.4.0.post1-cp39-cp39-macosx_10_9_x86_64.whl (308.8 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page