lbmpy: Automatic code generation for efficient parallel lattice Boltzmann methods

Martin Bauer,Harald Köstler,Ulrich Rüde
DOI: https://doi.org/10.48550/arXiv.2001.11806
2020-04-11
Abstract:Lattice Boltzmann methods are a popular mesoscopic alternative to macroscopic computational fluid dynamics solvers. Many variants have been developed that vary in complexity, accuracy, and computational cost. Extensions are available to simulate multi-phase, multi-component, turbulent, or non-Newtonian flows. In this work we present lbmpy, a code generation package that supports a wide variety of different methods and provides a generic development environment for new schemes as well. A high-level domain-specific language allows the user to formulate, extend and test various lattice Boltzmann schemes. The method specification is represented in a symbolic intermediate representation. Transformations that operate on this intermediate representation optimize and parallelize the method, yielding highly efficient lattice Boltzmann compute kernels not only for single- and two-relaxation-time schemes but also for multi-relaxation-time, cumulant, and entropically stabilized methods. An integration into the HPC framework waLBerla makes massively parallel, distributed simulations possible, which is demonstrated through scaling experiments on the SuperMUC-NG supercomputing system
Mathematical Software,Computational Engineering, Finance, and Science,Distributed, Parallel, and Cluster Computing
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is to develop an automatic code - generation tool to support the highly efficient parallel lattice Boltzmann method (LBM). Specifically, the researchers proposed a code - generation package named lbmpy, aiming at: 1. **Supporting multiple LBM variants**: lbmpy can handle LBM variants with different levels of complexity, precision, and computational cost, including the single - relaxation - time (SRT), two - relaxation - time (TRT), multi - relaxation - time (MRT) methods, as well as more advanced cumulant and entropy - stable methods. 2. **Providing a flexible development environment**: By using a high - level domain - specific language (DSL), users can easily define, extend, and test various LBM methods. All LBM methods can be specified in symbolic form and generate highly efficient computational kernels after a series of transformations. 3. **Optimizing code performance**: lbmpy can automatically generate highly optimized parallel code, which is suitable for large - scale parallel computing frameworks. It optimizes the generated code through automatic parallelization and applying specific automated steps, ensuring good scalability and performance on modern supercomputers. 4. **Simplifying the development process**: Through automated symbolic operations, lbmpy reduces the time and error risk for developers to manually write and optimize LBM code, making the method more reliable and repeatable. In summary, the goal of this paper is to provide a powerful tool through lbmpy to help researchers and engineers develop and optimize LBM - based fluid - dynamics simulation code more efficiently, especially in high - performance computing environments.