M. Guerrero-Hurtado , J.M. Catalán , M. Moriche , A. Gonzalo , O. Flores
{"title":"A Python-based flow solver for numerical simulations using an immersed boundary method on single GPUs","authors":"M. Guerrero-Hurtado , J.M. Catalán , M. Moriche , A. Gonzalo , O. Flores","doi":"10.1016/j.compfluid.2024.106511","DOIUrl":null,"url":null,"abstract":"<div><div>We present an efficient implementation for the simulation of three-dimensional, incompressible flow around moving bodies with complex geometries on single GPUs, based on Nvidia CUDA through Numba and Python. The flow is solved in this framework through an implementation of the Immersed Boundary Method tailored for the GPU, where different GPU grid architectures are exploited to optimize the overall performance. By targeting a single-GPU, we eliminate the need for both intra- and inter-node communication, which can potentially introduce overheads. With this approach, all simulation data remains in the GPU’s global memory at all times. We provide details about the numerical methodology, the implementation of the algorithm in the GPU and the memory management, critical in single-GPU implementations. Additionally, we verify the results comparing with our analogous CPU-based parallel solver and assess satisfactorily the efficiency of the code in terms of the relative computing time of the different operations and the scaling of the CPU code compared to a single GPU case. Overall, our tests show that the single-GPU code is between 34 to 54 times faster than the CPU solver in peak performance (96–128 CPU cores). This speedup mainly comes from the change in the method of solution of the linear systems of equations, while the speedup in sections of the algorithm that are equivalent in the CPU and GPU implementations is more modest (i.e., <span><math><mrow><mo>×</mo><mn>1</mn><mo>.</mo><mn>6</mn><mo>−</mo><mn>3</mn></mrow></math></span> speedup in the computation of the non-linear terms). Finally, we showcase the performance of this new GPU implementation in two applications of interest, one for external flows (i.e., bioinspired aerodynamics) and one for internal flows (i.e., cardiovascular flows), demonstrating the strong scaling of the code in two different GPU cards (hardware).</div></div>","PeriodicalId":287,"journal":{"name":"Computers & Fluids","volume":"288 ","pages":"Article 106511"},"PeriodicalIF":2.5000,"publicationDate":"2024-12-09","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Computers & Fluids","FirstCategoryId":"5","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S0045793024003426","RegionNum":3,"RegionCategory":"工程技术","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS","Score":null,"Total":0}
引用次数: 0
Abstract
We present an efficient implementation for the simulation of three-dimensional, incompressible flow around moving bodies with complex geometries on single GPUs, based on Nvidia CUDA through Numba and Python. The flow is solved in this framework through an implementation of the Immersed Boundary Method tailored for the GPU, where different GPU grid architectures are exploited to optimize the overall performance. By targeting a single-GPU, we eliminate the need for both intra- and inter-node communication, which can potentially introduce overheads. With this approach, all simulation data remains in the GPU’s global memory at all times. We provide details about the numerical methodology, the implementation of the algorithm in the GPU and the memory management, critical in single-GPU implementations. Additionally, we verify the results comparing with our analogous CPU-based parallel solver and assess satisfactorily the efficiency of the code in terms of the relative computing time of the different operations and the scaling of the CPU code compared to a single GPU case. Overall, our tests show that the single-GPU code is between 34 to 54 times faster than the CPU solver in peak performance (96–128 CPU cores). This speedup mainly comes from the change in the method of solution of the linear systems of equations, while the speedup in sections of the algorithm that are equivalent in the CPU and GPU implementations is more modest (i.e., speedup in the computation of the non-linear terms). Finally, we showcase the performance of this new GPU implementation in two applications of interest, one for external flows (i.e., bioinspired aerodynamics) and one for internal flows (i.e., cardiovascular flows), demonstrating the strong scaling of the code in two different GPU cards (hardware).
期刊介绍:
Computers & Fluids is multidisciplinary. The term ''fluid'' is interpreted in the broadest sense. Hydro- and aerodynamics, high-speed and physical gas dynamics, turbulence and flow stability, multiphase flow, rheology, tribology and fluid-structure interaction are all of interest, provided that computer technique plays a significant role in the associated studies or design methodology.