Tutorial: HeFFTe plan_options (FFT backend and communication)¶
Config-driven apps read FFT settings from your JSON/TOML (often under [plan_options] in TOML). The annotated file in the tree is the best reference for key names and comments.
1. Open the reference file¶
Path: examples/fft_backend_selection.toml
It is organized in four blocks you will see in real configs:
Block |
Role |
|---|---|
|
Grid size, spacing, origin — same information as JSON |
|
HeFFTe backend ( |
|
|
|
Placeholder name/params — real apps (e.g. tungsten) use richer |
2. Choose a backend¶
|
When |
|---|---|
|
Default CPU FFT; always available in typical CPU builds. |
|
Requires OpenPFC built with CUDA and a HeFFTe CUDA build; see |
The TOML file contains commented alternative blocks (e.g. CUDA + use_gpu_aware = true) you can copy into your own config.
3. Tune communication (reshape_algorithm, use_pencils)¶
HeFFTe redistributes data between MPI ranks for the FFT. Short guide (details in the TOML comments):
Option |
Meaning |
|---|---|
|
|
|
Pencil vs slab decomposition; can help beyond ~O(1000) ranks at the cost of more steps. |
|
Requires GPU-aware MPI; avoids staging through host when using CUDA backend. |
Start from defaults (fftw, alltoall, use_pencils = false) and change one knob at a time when profiling.
4. Copy into your project¶
Copy
[plan_options]from the example into your TOML, or translate keys to JSON (same logical names; see../app_pipeline.md).Keep one coherent toolchain: the HeFFTe variant (CPU/CUDA/ROCm) must match how OpenPFC was built (
../build_cpu_gpu.md).Validate at run time: wrong backend strings usually fail fast at FFT creation.
See also¶
../configuration.md— mental model for JSON/TOML../app_pipeline.md— whereSpectralCpuStackconsumesplan_options../performance_profiling.md— measuring the effect of changesgpu_app_quickstart.md— GPU binaries and CMake flags