A Distributed Algebra System for Time Integration on Parallel Computers

Abhinav Singh, Landfried Kraatz, Pietro Incardona, Ivo F. Sbalzarini · DOI

TL;DR

This paper introduces a novel distributed algebra system that seamlessly integrates the Boost.Odeint library for solving ordinary differential equations with the OpenFPM framework for high-performance computing. This allows for efficient and scalable time integration of complex dynamical systems on parallel CPU and GPU architectures, simplifying the development of scientific simulation codes.

What Problem Does This Paper Address?

Simulating dynamical systems often involves numerically solving differential equations. This requires time-integration methods that approximate the system's trajectory over time. While many sophisticated time-integration schemes exist, implementing them efficiently on parallel computers, especially those with distributed memory or GPUs, presents significant challenges. These challenges include managing data distribution, synchronizing computations across multiple processors, and handling the complexity of adaptive time-stepping methods. Existing libraries often require substantial manual effort to adapt for parallel environments, hindering rapid prototyping and experimentation. This paper addresses the need for a more integrated and user-friendly approach to parallel time integration, bridging the gap between powerful ODE solvers and scalable parallel computing frameworks.

Methods

The core of this work is the creation of a custom "state-type" and a corresponding "Algebra" within the OpenFPM framework. This allows Boost.Odeint, a C++ library for solving ODEs, to work with OpenFPM's distributed data structures.

  • Custom State-Type: OpenFPM's existing distributed vector types are wrapped to be compatible with Odeint's requirements. These state-types are templated to handle different dimensionalities and can be specialized for GPU computing (CUDA/HIP).
  • Distributed Algebra: A new algebra, odeint::vector_space_algebra_ofp, is implemented. This algebra defines the necessary arithmetic operations on the custom state-types, ensuring that these operations are performed in a distributed manner, encapsulating inter-process communication.
  • Template Expression System: The integration leverages OpenFPM's template expression system, which allows users to define spatial derivatives and PDE expressions in a near-mathematical notation. This system is extended to handle time derivatives, making it straightforward to integrate ODE models into the parallel framework.
  • System Functor: A "System functor" is used to encapsulate the right-hand side of the ODE, which can include spatial derivatives computed by OpenFPM. This functor is called by Odeint at each time-stepping stage.

This approach effectively separates the spatial discretization (handled by OpenFPM) from the temporal integration (handled by Odeint), providing a modular and scalable solution.

Datasets

The paper does not explicitly mention or introduce new datasets in the traditional machine learning sense. Instead, it uses well-defined mathematical problems as benchmarks to evaluate the correctness and performance of the implemented system. These include:

  • Exponential Dynamics: Defined by $f(x, y,t) = A(x, y)e^t$, with $A(x,y) = xy$.
  • Sigmoidal Dynamics: Defined by $f(t) = \frac{1}{1 + e^{-t}}$ and $\frac{df(t)}{dt} = f(t)(1 - f(t))$.
  • 3D Gray-Scott Reaction-Diffusion Problem: A coupled PDE system used to test performance with spatial coupling and communication overhead.

These problems are chosen for their known analytical solutions, allowing for rigorous verification of the numerical methods.

Key Insights and Ideas

  • Seamless Integration: The most significant insight is the successful and relatively straightforward integration of a powerful ODE solver (Odeint) into a high-performance parallel computing framework (OpenFPM) by creating compatible state-types and algebras.
  • Modularity and Abstraction: The system elegantly separates spatial and temporal aspects of simulations. This modularity significantly simplifies the process of implementing and modifying complex scientific models.
  • Performance Portability: The use of OpenFPM's underlying infrastructure ensures that the implemented time integration schemes are automatically portable across different hardware architectures, including CPUs and GPUs, without requiring significant code changes.
  • Compact Code: The template-expression language and the integration with Odeint lead to remarkably compact code for complex simulations, as demonstrated by the 60-line example for the 3D Gray-Scott problem.
  • Autotuning Potential: The framework lays the groundwork for extending autotuning systems to optimize time-stepping strategies, similar to how spatial discretization methods are optimized.

Key Results

  • Correctness: The implementation demonstrates correct convergence orders for various time integration schemes (Runge-Kutta, Adams-Bashforth) on both exponential and sigmoidal dynamics, matching theoretical expectations down to machine precision.
  • Scalability: Strong scaling tests on up to 512 CPU cores show near-ideal parallel efficiency (around 80%) for problems without spatial coupling, indicating efficient distribution of work. For the 3D Gray-Scott problem with spatial coupling, a parallel efficiency of nearly 80% was achieved on 512 CPU cores, demonstrating good handling of communication overhead.
  • GPU Speedup: The software achieves a speedup of approximately 2x when running on a Nvidia consumer GPU (RTX 4090) compared to a high-end multi-core CPU (AMD Ryzen 3990X), showcasing the benefits of GPU acceleration.
  • Performance of Odeint Integration: The integrated Odeint solution was found to be about an order of magnitude faster than a native OpenFPM implementation for a specific benchmark, likely due to Odeint's optimized on-the-fly computation of stages.

Limitations and Future Work

  • Explicit Steppers Only: The current implementation is limited to explicit time-stepping schemes available in Odeint. While Odeint supports custom steppers, the current algebra is restricted to those with no more than 15 elements.
  • Implicit Steppers: Implicit time integrators are not yet supported. The authors suggest that these could be implemented in the future using OpenFPM's template-expression language for implicit solvers.
  • Limited Custom Stepper Support: While Odeint allows for arbitrary custom steppers, the current algebra has limitations on the complexity of these custom steppers.
  • Future Work: The authors suggest extending support for implicit time integrators and potentially integrating other libraries like SUNDIALS. They also highlight the potential for extending autotuning systems to optimize time-stepping strategies. The software is available as part of the open-source OpenFPM project.

Summary updated

BibTeX
@article{singh2023distributed,
  author = {Abhinav Singh and Landfried Kraatz and Pietro Incardona and Ivo F. Sbalzarini},
  title = {{A Distributed Algebra System for Time Integration on Parallel Computers}},
  journal = {Journal of Open Research Software},
  year = {2023},
}
Figure