Source-linked AI summary

Accelerating Sparse Linear Solvers in OpenFOAM using RISC-V Vector Extensions

Gabriele Ceccolini, Federico Ficarelli, Filippo Barbari, Simone Bnà, Andrea Bartolini

arXiv:2609.05429v1cs.DC

TL;DR

OpenFOAM’s scalar-oriented matrix format and limited SIMD support constrain vector acceleration of its sparse solvers. This work uses runtime format conversion, RISC-V intrinsics, and a custom GAMG smoother on EPAC and SG2044, achieving 6× and 1.5× smoother speedups, respectively.

  • Problem

    OpenFOAM relies mainly on MPI and its native LDU-COO format lacks the contiguous access patterns needed for efficient vector processing.

  • Method

    The work vectorizes SpMV and smoother kernels with RISC-V intrinsics, converts matrix data at runtime, and integrates the kernels into a custom GAMG smoother.

  • Results

    6× smoother speedup was achieved on EPAC and 1.5× on SG2044.

  • Takeaways & Limitations

    Legacy OpenFOAM can be accelerated through non-invasive plugins and runtime format conversion without altering its core codebase.

Abstract

from arXiv · show

Computational Fluid Dynamics (CFD) relies heavily on the efficiency of linear solvers based on sparse linear algebra kernels. Widely used frameworks like OpenFOAM exploit parallelism primarily at the domain decomposition level via MPI. Support for vector/SIMD architectures is limited to compiler auto-vectorization. Furthermore, support for such architectures is limited by OpenFOAM's internal matrix data format, which is intrinsically ill-suited for the contiguous memory accesses required for efficient execution on vector processors. In this work, we focused on two very different RISC-V architectures: the prototype long-vector EPAC accelerator and the commercial short-vector CPU Sophon SG2044. On these platforms, we optimized the Sparse Matrix-Vector multiplication (SpMV) using RISC-V vector intrinsics and integrated it into a custom smoother, performing a runtime conversion of internal data into a vector-friendly format. Experimental results on the EPAC test chip show a 6x speedup for the smoother; benchmarks on Monte Cimone (MCv2) cluster with the Sophon SG2044 processor achieve a 1.5x smoother speedup, proving that legacy CFD codes can be effectively accelerated on both research and commercial emerging hardware.

Introduction

OpenFOAM relies mainly on MPI and its scalar-oriented LDU-COO format limits efficient vector processing. The work introduces runtime format conversion, RISC-V vector intrinsics, and a custom GAMG smoother evaluated across two contrasting RISC-V architectures.

  • OpenFOAM relies primarily on MPI for process-level parallelism, while its native LDU-COO format lacks vector-friendly contiguous memory access.
  • The approach converts matrix data at runtime into a vector-friendly layout and accelerates sparse linear algebra with RISC-V vector intrinsics.
  • The evaluation targets GAMG, OpenFOAM’s native multigrid solver for stiff elliptic problems, on EPAC and SG2044.
  • The work contributes manual SpMV vectorization, a custom vectorized GAMG smoother plugin, and end-to-end evaluation on a real CFD multi-step simulation.

Implementation

The implementation targets the Richardson smoother in GAMG, vectorizing its kernels and integrating vector-friendly sparse formats through a runtime-linked OpenFOAM plugin.

  • The Richardson smoother was targeted because it is inherently vector-friendly and accounts for ∼50% of total simulation time.
  • All three smoother kernels—two dense vector kernels and one SpMV—were manually vectorized using RVV intrinsics for EPAC and SG2044.
  • SELL-C-σ and ELL storage formats were evaluated against scalar LDU-COO, with SpMV receiving major attention because it dominates scalar smoother computation.
  • The vectorized kernels were integrated into a custom smoother dynamically linked to OpenFOAM at runtime.

Experimental results

Across CFD-derived sparse matrices, SELL-C-σ and vectorized smoothers improved performance on both RISC-V platforms, with larger gains on the long-vector EPAC architecture.

  • 7× SpMV speedup was achieved on EPAC with SELL-C-σ, versus 2× on SG2044, relative to the symmetric scalar LDU-COO baseline.The comparison used symmetric matrices from a cylinder-flow simulation spanning 128k to 4096k cells.
  • SELL-C-σ consistently produced better memory access behavior than ELL, reflected in EPAC VPU stalls and SG2044 cache misses.
  • 6× total smoother speedup was observed on EPAC, while SG2044 achieved 1.5× overall speedup.
  • Long-vector architectures were highly effective for memory-bound kernels because they tolerate memory latency and maximize memory-bandwidth utilization.
  • The results demonstrate acceleration of legacy OpenFOAM through non-invasive plugins and runtime format conversion without altering the core codebase.
Loading 2609.05429v1…