基于python的单gpu浸入边界法数值模拟流动求解器

IF 2.5 3区 工程技术 Q3 COMPUTER SCIENCE, INTERDISCIPLINARY APPLICATIONS
M. Guerrero-Hurtado , J.M. Catalán , M. Moriche , A. Gonzalo , O. Flores
{"title":"基于python的单gpu浸入边界法数值模拟流动求解器","authors":"M. Guerrero-Hurtado ,&nbsp;J.M. Catalán ,&nbsp;M. Moriche ,&nbsp;A. Gonzalo ,&nbsp;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":"{\"title\":\"A Python-based flow solver for numerical simulations using an immersed boundary method on single GPUs\",\"authors\":\"M. Guerrero-Hurtado ,&nbsp;J.M. Catalán ,&nbsp;M. Moriche ,&nbsp;A. Gonzalo ,&nbsp;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}","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

摘要

我们通过Numba和Python,基于Nvidia CUDA,在单个gpu上提供了一个有效的实现,用于模拟具有复杂几何形状的运动物体周围的三维不可压缩流。该流程通过为GPU量身定制的浸入边界方法的实现在该框架中解决,其中利用不同的GPU网格架构来优化整体性能。通过针对单个gpu,我们消除了对节点内和节点间通信的需求,这可能会带来开销。通过这种方法,所有模拟数据始终保留在GPU的全局内存中。我们提供了关于数值方法的详细信息,算法在GPU中的实现和内存管理,这在单GPU实现中至关重要。此外,我们将结果与类似的基于CPU的并行求解器进行比较,并根据不同操作的相对计算时间和CPU代码与单个GPU情况相比的缩放来满意地评估代码的效率。总的来说,我们的测试表明,在峰值性能(96-128个CPU核)下,单gpu代码比CPU求解器快34到54倍。这种加速主要来自线性方程组解方法的改变,而在CPU和GPU实现中等价的算法部分的加速则更为适度(即,非线性项的计算加速×1.6−3)。最后,我们在两个感兴趣的应用程序中展示了这种新GPU实现的性能,一个用于外部流(即,生物启发空气动力学),一个用于内部流(即,心血管流),展示了两种不同GPU卡(硬件)中代码的强大缩放。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
A Python-based flow solver for numerical simulations using an immersed boundary method on single GPUs
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., ×1.63 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
Computers & Fluids 物理-计算机:跨学科应用
CiteScore
5.30
自引率
7.10%
发文量
242
审稿时长
10.8 months
期刊介绍: 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.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信