arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2401.03008astro-ph.HEphysics.comp-phphysics.flu-dynphysics.plasm-ph
收藏

用于相对论磁流体动力学的 ECHO 代码的 GPU 加速现代 Fortran 版本

A GPU-Accelerated Modern Fortran Version of the ECHO Code for Relativistic Magnetohydrodynamics

Luca Del Zanna, Simone Landi, Lorenzo Serafini, Matteo Bugli, Emanuele Papini

AI总结:

本文通过原生 Fortran 内置构造和少量 OpenACC 指令将相对论 MHD 的 ECHO 代码移植到 GPU,在基准测试中速度提升至少 16 倍,并展示了高分辨率湍流模拟的潜力。

摘要:

相对论磁流体动力学(MHD)的数值研究在高能天体物理学中起着至关重要的作用,但遗憾的是,由于涉及的物理过程复杂(高洛伦兹因子流、极端磁化、致密天体附近的弯曲时空)以及分辨湍流运动所需的各种空间尺度,其计算要求很高。将运行在标准处理器上的现有代码移植到基于 GPU 的平台上会带来巨大的好处。然而,这通常需要对原始代码进行大幅重写,使用像 CUDA 这样的特定语言,并对数据管理进行复杂分析并优化并行过程。在此,我们描述了将用于狭义和广义相对论 MHD 的 ECHO 代码移植到加速设备的过程,该移植仅基于原生的 Fortran 语言内置构造,特别是“do concurrent”循环、少量 OpenACC 指令,以及 NVIDIA 编译器的统一内存选项提供的直接数据管理。得益于对原始代码的这些极小修改,与基于 CPU 的平台相比,新版本的 ECHO 在 GPU 平台上的运行速度至少快了 16 倍。所选基准是相对论 MHD Alfvén 波的三维传播,并提供了在 CINECA 的 LEONARDO 准百亿亿次超级计算机上进行的强扩展和弱扩展测试(使用多达 256 个节点,对应 1024 个 GPU 和超过 140 亿个网格单元)。最后,展示了一个高分辨率相对论 MHD Alfvén 湍流模拟的示例,证明了基于 GPU 的新版本 ECHO 在天体物理等离子体方面的潜力。

英文摘要:

The numerical study of relativistic magnetohydrodynamics (MHD) plays a crucial role in high-energy astrophysics, but unfortunately is computationally demanding, given the complex physics involved (high Lorentz factor flows, extreme magnetization, curved spacetimes near compact objects) and the large variety of spatial scales needed to resolve turbulent motions. A great benefit comes from the porting of existing codes running on standard processors to GPU-based platforms. However, this usually requires a drastic rewriting of the original code, the use of specific languages like CUDA, and a complex analysis of data management and optimization of parallel processes. Here we describe the porting of the ECHO code for special and general relativistic MHD to accelerated devices, simply based on native Fortran language built-in constructs, especially 'do concurrent' loops, few OpenACC directives, and the straightforward data management provided by the Unified Memory option of NVIDIA compilers.Thanks to these very minor modifications to the original code, the new version of ECHO runs at least 16 times faster on GPU platforms compared to CPU-based ones. The chosen benchmark is the 3D propagation of a relativistic MHD Alfvén wave, for which strong and weak scaling tests performed on the LEONARDO pre-exascale supercomputer at CINECA are provided (using up to 256 nodes corresponding to 1024 GPUs, and over 14 billion cells). Finally, an example of high-resolution relativistic MHD Alfvénic turbulence simulation is shown, demonstrating the potential for astrophysical plasmas of the new GPU-based version of ECHO.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑