Table of Contents
Fetching ...

Parallel and GPU accelerated code for phase-field and reaction-diffusion simulations

Steven A. Silber, Mikko Karttunen

TL;DR

SymPhas 2.0 addresses the need for high-performance, flexible phase-field and reaction-diffusion simulations by combining compile-time symbolic algebra with MPI CPU parallelization and a CUDA GPU backend. It extends the symbolic framework with directional derivatives, symbolic summation, tensor-valued expressions, and free-energy–based model definitions, while enabling compile-time generation of finite-difference stencils and semi-implicit Fourier spectral schemes. A major contribution is the automatic derivation of equations from free-energy functionals via symbolic differentiation, together with end-to-end GPU execution that preserves host-side modeling flexibility. Empirically, the approach delivers substantial speedups (up to around 1000×) for large-scale systems on GPU hardware, making large, complex multicomponent phase-field and reaction-diffusion simulations practical on modern HPC platforms; the code is open source for community use.

Abstract

We present SymPhas 2.0, a major update of the compile-time symbolic algebra simulation framework SymPhas for phase-field and reaction-diffusion models. This release introduces significant expansions and enhancements that enable the definition of a phase-field model directly from the free-energy functional via compile-time evaluated functional differentiation. It also introduces directional derivatives, symbolic summation, tensor-valued expressions, and compile-time derived finite difference stencils of arbitrary order and accuracy. Furthermore, the code has been parallelized for CPUs with MPI, and GPU computing has been added using CUDA (Compute Unified Device Architecture). For the latter, symbolic expressions are compiled into optimized CUDA kernels, allowing large-scale simulations to execute entirely on the GPU. For large systems ($32,768^2$ in 2D and $1,024^3$ in 3D with double precision), speedups up to $\sim \!\!1,000 \times$ were obtained compared to the first version of SymPhas using multi-threaded CPU execution on a single system. These developments establish SymPhas 2.0 as a flexible and scalable framework for efficient implementation of phase-field and reaction-diffusion models on GPU-based high-performance computing platforms.

Parallel and GPU accelerated code for phase-field and reaction-diffusion simulations

TL;DR

SymPhas 2.0 addresses the need for high-performance, flexible phase-field and reaction-diffusion simulations by combining compile-time symbolic algebra with MPI CPU parallelization and a CUDA GPU backend. It extends the symbolic framework with directional derivatives, symbolic summation, tensor-valued expressions, and free-energy–based model definitions, while enabling compile-time generation of finite-difference stencils and semi-implicit Fourier spectral schemes. A major contribution is the automatic derivation of equations from free-energy functionals via symbolic differentiation, together with end-to-end GPU execution that preserves host-side modeling flexibility. Empirically, the approach delivers substantial speedups (up to around 1000×) for large-scale systems on GPU hardware, making large, complex multicomponent phase-field and reaction-diffusion simulations practical on modern HPC platforms; the code is open source for community use.

Abstract

We present SymPhas 2.0, a major update of the compile-time symbolic algebra simulation framework SymPhas for phase-field and reaction-diffusion models. This release introduces significant expansions and enhancements that enable the definition of a phase-field model directly from the free-energy functional via compile-time evaluated functional differentiation. It also introduces directional derivatives, symbolic summation, tensor-valued expressions, and compile-time derived finite difference stencils of arbitrary order and accuracy. Furthermore, the code has been parallelized for CPUs with MPI, and GPU computing has been added using CUDA (Compute Unified Device Architecture). For the latter, symbolic expressions are compiled into optimized CUDA kernels, allowing large-scale simulations to execute entirely on the GPU. For large systems ( in 2D and in 3D with double precision), speedups up to were obtained compared to the first version of SymPhas using multi-threaded CPU execution on a single system. These developments establish SymPhas 2.0 as a flexible and scalable framework for efficient implementation of phase-field and reaction-diffusion models on GPU-based high-performance computing platforms.

Paper Structure

This paper contains 21 sections, 7 equations, 6 figures, 7 tables.

Figures (6)

  • Figure 1: Two-dimensional simulation results for Models A, B, C, and H on grids of $128 \times 128$ with periodic boundaries. Models C and H involve two coupled fields and are displayed side-by-side. Each simulation was run for 1,000 iterations.
  • Figure 2: Visualizations from 3D simulations of Models A and B on a grid of $64\times 64\times 64$ with periodic boundaries. Each simulation was run for 1,000 iterations.
  • Figure 3: Simulation runtime of different CPUs using parallelization; for each system size, the runtime is averaged across 5 independent runs executed for 1,000 iterations. The scaling is close to 1 for all three different systems that were used.
  • Figure 4: Simulation runtime of different CPUs using parallelization; for each system size, the runtime is averaged across 5 independent runs executed for 1,000 iterations. The scaling is close to 1 for all three different systems that were used. The models were simulated up to the maximum system size allowed by the available memory.
  • Figure 5: Simulation runtime of various CUDA-enabled GPUs; for each system size, the runtime is averaged across 5 independent runs executed for 1,000 iterations. The inconsistent scaling is due to caching and communication bottlenecks at smaller system sizes. The models were simulated up to the maximum system size allowed by the available memory on the GPU.
  • ...and 1 more figures