SpFFT Documentation

SpFFT - A 3D FFT library for sparse frequency domain data written in C++ with support for MPI, OpenMP, CUDA and ROCm.
Inspired by the need of some computational material science applications with spherical cutoff data in frequency domain, SpFFT provides Fast Fourier Transformations of sparse frequency domain data. For distributed computations with MPI, slab decomposition in space domain and pencil decomposition in frequency domain (sparse data within a pencil / column must be on one rank) is used.

Illustration of a transform, where data on each MPI rank is identified by color.

Design Goals

  • Sparse frequency domain input

  • Reuse of pre-allocated memory

  • Support of negative indexing for frequency domain data

  • Parallelization and acceleration are optional

  • Unified interface for calculations on CPUs and GPUs

  • Support of Complex-To-Real and Real-To-Complex transforms, where the full hermitian symmetry property is utilized

  • C++, C and Fortran interfaces

Interface Design

To allow for pre-allocation and reuse of memory, the design is based on two classes:

  • Grid: Allocates memory for transforms up to a given size in each dimension.

  • Transform: Is associated with a Grid and can have any size up to the Grid dimensions. A Transform holds a counted reference to the underlying Grid. Therefore, Transforms created with the same Grid share memory, which is only freed, once the Grid and all associated Transforms are destroyed.

A transform can be computed in-place and out-of-place. Addtionally, an internally allocated work buffer can optionally be used for input / output of space domain data.


The creation of Grids and Transforms, as well as the forward and backward execution may entail MPI calls and must be synchronized between all ranks.