From equations to parallel simulation

OpenPFC

From equations
to parallel simulation.

OpenPFC is a structured-grid framework for computational physics. Compose a PDE from shared numerical components, then run it from one rank toward GPUs and a cluster.

Phase-field crystal models began the project. Flow, phase fields, elasticity, films, and kinetics now use the same path.

Grids
Structured PDEs
Methods
Spectral and finite difference
Devices
CPU, CUDA, HIP
Parallel
Distributed MPI
Language
C++20

01 — Applications

One framework, many equations.

What you can build on the same grid. The plates are browser drawings. Hover a tile for one extra fact.

Spectral · 3D · div u = 0

Incompressible flow

Periodic Navier-Stokes on the Fourier velocity.

Taylor-Green, decaying turbulence, and constant-power low-mode forcing. The rotational step has a device path.

Spectral · 3D · density

Phase-field crystal

Tungsten is the main application.

JSON or TOML in. CPU, CUDA, and HIP binaries when the build enables them.

Spectral ETD · conserved

Cahn-Hilliard

Spinodal dynamics for an Fe-Cr-like solution.

A recorded concentration field from this application is in the next section.

Finite difference · 2D

Allen-Cahn

A small non-conserved phase field.

Optional PNG frames. CUDA or HIP when you compile them.

FD or spectral · 3D

Heat

Even difference orders from 2 to 20, or one spectral step.

The same heat equation, two discretizations, one application.

Spectral · Helmholtz-Navier

Elasticity

Size-dependent elasticity on a periodic cell.

Inverse design of a target stiffness is a separate application, shown below as solver output.

Phase field · alloy

Dendrites

Quantitative solidification with solute and microelasticity.

Kobayashi growth with temperature is its own application.

Spectral ETD · surface

Films

Lubrication dewetting on a periodic film.

Mullins surface diffusion and a sixth-order electrohydrodynamic gap are separate applications.

1D2V · kinetics

Vlasov-Maxwell

Electromagnetic kinetics on a reduced phase space.

Landau damping, two-stream, and Weibel.

Spectral · first order

Waves

A coupled acoustic wave, displacement plus velocity.

Kawahara is the dispersive sibling. It does not smooth.

Also in the tree: higher-order phase-field crystal and aluminumNew, the FCC phase-field crystal application. The 2D vorticity prototype stays in examples, not in the flow application.

See each application

02 — Solver output

Computed with OpenPFC.

Recorded runs, not sketches. The Taylor-Green film is the 512 cubed trajectory. Flat fields use a presentation color scale.

Provenance, commands, and the render script are in the figure provenance. The atlas above is still a drawing.

03 — Scale

And it scales.

Measured heat runs on LUMI-G. One MI250X GCD is one rank, and a node is eight GCDs. Finite difference and distributed FFT do not share one efficiency.

Line chart of FD2, FD4, FD8, FD12, and FD20 weak-scaling efficiency from 16 to 8192 MI250X GCDs. Each curve divides that order's 16-GCD step time by its later step time. FD2 ends at 87.7 percent and FD20 at 53.1 percent. The vertical axis starts at zero. Constant 256 cubed interior cells per GCD.
Finite difference, weak scaling. Constant 256 cubed interior cells per GCD. Each curve uses that order's own 16-GCD step as 100%.
Line chart of the fastest HeFFTe protocol at each width, from 16 to 4096 MI250X GCDs, for a 768 cubed box per GCD. Efficiency falls to 41.9 percent of the 16-GCD minimum. The vertical axis starts at zero.
Spectral, separate envelope. Fastest measured HeFFTe protocol at each width, on a 768 cubed box per GCD, divided by the 16-GCD minimum.
8,192 GCDs 1,024 LUMI-G nodes. FD2, FD4, FD8, FD12, and FD20 all reach this rung.
87.7% FD2 at 8,192 GCDs, against its 16-GCD step. Against its one-node step the same wall is 86.9%.
41.9% Fastest HeFFTe protocol at 4,096 GCDs, 512 nodes, against its 16-GCD minimum. No 1,024-node FFT row was admitted.
171.3× Fixed 4096 cubed FD2, from 115.6485 ms/step at 4 nodes to 0.6752 ms/step at 1,024 nodes. 66.9% of ideal from that 4-node step.

Local finite-difference work scales strongly, and the stencil changes the result. At 8,192 GCDs the 16-GCD baseline reads FD4 66.3%, FD8 57.3%, FD12 55.7%, FD20 53.1%. The same walls against each order's one-node step are 68.4%, 59.0%, 57.5%, and 54.2%. A distributed FFT pays a different communication cost, so it is not a second copy of the FD2 curve. The fastest protocol is not the same one at every width, and that ranking did not change a production selector. These are recorded LUMI-G campaigns, not a re-run of today's master.

04 — Path

Mathematics, then the machine.

The path a problem takes. CUDA and HIP are part of that path, not a later wrapper around the CPU code.

  1. Physics

    Equations, materials, forcing

  2. Numerics

    FFT, finite difference, Chebyshev, projections, time

  3. Grid

    Fields, domains, decomposition, halos

  4. Runtime

    CPU, CUDA, HIP

  5. HPC

    MPI, distributed FFT, the job you launch

One contract, three builds

  • CPUFFTW on the host
  • CUDAwhen that toolchain is built
  • HIPthe same device source

MPI is on for every supported build. Distributed FFTs go through HeFFTe. Turning HeFFTe off skips the spectral applications and leaves the finite-difference work.

In the repository the dependency runs the other way: runtime depends on the kernel, and the kernel includes no backend. The architecture note is the precise picture, including which owner holds mechanics, constitutive laws, and the incompressible step.

05 — Numerics

Shared mathematics, thin applications.

Start with a derivative, follow it into a heat equation, then change the numerical choices yourself. Explore the equations and interactive experiments before opening the detailed reference.

The nonlinear Fourier course

Follow Fourier modes through nonlinear products, ETD2 and a verified C++ model. Compare actual serial and MPI results.

The diffusion course

Start with samples, compare finite differences with Fourier derivatives, and measure spatial and temporal errors before running C++.

Boundaries

Chebyshev operators, and Poisson and Helmholtz solves.

Solvers and mechanics

Finite-strain FFT, periodic microelasticity, and constitutive laws: Saint Venant-Kirchhoff, J2, crystal plasticity.

06 — First run

Run it. Change it. Understand it.

Start with an installed SDK and native CLI. The installation guide helps you choose an environment; the run and bundle guide takes you from editable source to saved results and a CPU image.

  1. Check the compiler and SDK with openpfc doctor.
  2. Create an editable diffusion model and run one rank.
  3. Inspect the saved mean and L2 diagnostics, then change an input.

With an installed SDK and native CLI

openpfc doctor
openpfc init my-model --model=diffusion
cd my-model
openpfc run model.cpp input.json --launcher=none

Next: inspect the printed attempt directory

results/summary.json
results/diagnostics.csv
results/field_rank_0.csv

07 — Boundaries

Built for research, explicit about the edges.

OpenPFC is a research framework. That is a scope, not a warning stuck to the front door. The limits are these.

  • Structured grids, on purpose. Not an unstructured mesh, a finite-element code, or adaptive refinement.
  • MPI is required. There is no supported build without it, and no GUI or production-support contract.
  • A single switch from spectral to finite difference, for every application, is still in progress. Shipped spectral applications, including tungsten, stay on the FFT.

OpenPFC: an open-source framework for high performance 3D phase field crystal simulations.

T. Pinomaa, J. Aho, J. Suviranta, P. Jreidini, N. Provatas, and A. Laukkanen, Modelling and Simulation in Materials Science and Engineering, 2024. DOI 10.1088/1361-651X/ad269e. The paper’s title names the original family.
  • License: AGPL-3.0-or-later. Copyright in the OpenPFC sources is held by VTT Technical Research Centre of Finland Ltd.
  • Archive: Zenodo 10.5281/zenodo.10799935.
  • An exercise record, not a benchmark: domains up to 8192 x 8192 x 4096, 25,600 CPU cores, about 25 TB. Read the profiling guide and the scalability plan before quoting it.
  • Release line 0.3 is a source-level break from 0.2. ABI compatibility is not claimed. The 0.1 Model / Simulator / App / World path is gone.

08 — Begin

Make the next result understandable.

Run a small model, explore a numerical choice, and check the answer. Then take the parts you understand to a larger problem.