# CPU-GPU Heterogeneous Code Acceleration of a Finite Volume Computational Fluid Dynamics Solver

**Authors:** Weicheng Xue, Hongyu Wang, Christopher J. Roy  
**arXiv:** [2305.18057](https://arxiv.org/abs/2305.18057)  
**Date:** 2023-05-29  
**Summary page:** https://www.summarizepaper.com/en/paper/2305.18057v1/

## Key points

- Focus on acceleration of a finite-volume CFD solver using CPU-GPU heterogeneous code
- Description of the CFD solver called SENSEI and its discretization
- Utilization of MPI and OpenACC for CPU-GPU heterogeneous computing workflow in SENSEI
- Proposal of a performance model for CPU-GPU heterogeneous computing with ghost cell exchange
- Comparison of scaling performance with pure multi-CPU/GPU performance for a supersonic inlet test case
- Improvement in performance by leveraging both CPUs and GPUs as workers compared to using pure CPUs or GPUs
- Suggestions for application users interested in accelerating their own scientific computing simulations using CPUs and GPUs
- Feedback for hardware architects interested in designing better CPU-GPU heterogeneous systems
- Comparison of different solutions (CPU serial, multi-CPU parallel, GPU serial, multi-GPU parallel) for a supersonic flow test case with relative difference less than 10^-12
- Discussion on factors influencing overall performance of CPU-GPU heterogeneous computing, including optimal workload ratio between single GPU worker and single CPU worker
- Demonstration that utilizing both CPUs and GPUs can significantly improve performance compared to using only one type of processor
- Proposal of a performance model to accurately estimate advantages of leveraging both CPUs and GPUs
- Valuable insights for application users looking to accelerate scientific computing simulations and hardware architects aiming to design better CPU-GPU heterogeneous systems.

## Summary

This work focuses on the acceleration of a finite-volume Computational Fluid Dynamics (CFD) solver using CPU-GPU heterogeneous code. The authors present a high-level description of the CFD solver called SENSEI, its discretization, and the CPU-GPU heterogeneous computing workflow in SENSEI utilizing MPI and OpenACC. To estimate the performance of the heterogeneous implementation, the authors propose a performance model for CPU-GPU heterogeneous computing that requires ghost cell exchange. They demonstrate the scaling performance of CPU-GPU heterogeneous computing by comparing it with pure multi-CPU/GPU performance for a supersonic inlet test case. The results show that leveraging both CPUs and GPUs as workers together improves performance compared to using pure CPUs or GPUs. The authors also provide suggestions for application users interested in accelerating their own scientific computing simulations by leveraging the computational power of CPUs and GPUs. Additionally, they offer feedback for hardware architects interested in designing better CPU-GPU heterogeneous systems for heterogeneous computing. In terms of results, one CFD test case considered is the supersonic flow through a simplified 2D 30-degree inlet. The authors compare the CPU serial solution, multi-CPU parallel solution, GPU serial solution, and multi-GPU parallel solution. They find that all solutions have a relative difference less than 10^-12. The inflow conditions for this test case are provided in Table 1. Furthermore, factors influencing the overall performance of CPU-GPU heterogeneous computing are discussed. One such factor is determining the optimal single GPU worker over single CPU worker workload ratio. This can be achieved by running cases with different workload ratios. Overall, this study demonstrates that utilizing both CPUs and GPUs as workers can significantly improve performance compared to using only one type of processor. The proposed performance model helps estimate the advantages of leveraging both CPUs and GPUs accurately. This work provides valuable insights for application users looking to accelerate their scientific computing simulations and hardware architects aiming to design better CPU-GPU heterogeneous systems.
