Skip to main content

python binding of PFFT, a massively parallel FFT library

Project description


Python binding of PFFT. (

PFFT is a massively parallel Fast Fourier Transform library. For its
performance, see:

This is the python binding of PFFT.

PFFT is a FFT library with excellent scaling at large number of processors.
We have been routinely running 10,000 ** 3 transforms on 22K MPI ranks as
a component of the BlueTides simulation at National Center for Supercomputing
Applications. This is beyond our knowledge of the limits of FFTW.

This Python binding of course cannot yet operate at such a large scale. Due
to the limitations of Python packaging and moduling system.
We nevertheless feel it is important to develop a python binding of PFFT to
allow early exploration of a migration into scripting languages in super computing.

pfft-python requires mpi4py for installation.

To install from PyPI:
easy_install --user pfft-python

To install from git source

python install --user

PFFT, patched FFTW, and the binding are linked into one giant (6MB) shared
object files. We use `-fvisibility=hidden` to hide the PFFT/FFTW symbols.

To use:

also see tests/

The documentation is sparse and in the source code (pfft/,
hopefully the guide here can get you started:

1) create a ProcMesh object for the communication geometry
2) create a Partition object for the data partition of the FFT mesh,
in real and fourier space, both
3) allocate LocalBuffer objects for input and output. A LocalBuffer can be
reused for inplace transforms.
4) create Plan objects for the transforms, with the LocalBuffer objects as
5) optionally, free the scratch buffers, and create new LocalBuffer objects.
6) view the LocalBuffer objects via view_input / view_output
6) fill the LocalBuffer objects, making use of
Partition.local_i_start, local_o_start which marks the offset of the local
A useful function is numpy.indices. numpy.meshgrid and numpy.ogrid are also useful.
7) Apply the plans via Plan.execute with LocalBuffer objects as arguments.

- Yu Feng

Project details

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page