arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.03398cs.MSastro-ph.IMcs.DCcs.PL
收藏

使用Fortran标准并行性加速生产Solar MHD代码:从OpenACC到“做并发”

Acceleration of a production Solar MHD code with Fortran standard parallelism: From OpenACC to `do concurrent'

Ronald M. Caplan, Miko M. Stulajter, Jon A. Linker

摘要:

使用标准语言结构来加速计算,避免对(通常是特定于供应商的)外部API的需求,这一点越来越受到关注。这些结构具有更便于携带和更“面向未来”的潜力。对于Fortran代码,当前的重点是{ \tt do concurrent}(DC)循环。虽然已经有一些使用DC进行基准测试和/或小型代码的GPU加速的成功例子,但其广泛采用将需要在全尺寸应用程序中演示其使用。在这里,我们看看在称为球体外磁流体动力学算法(MAS)的生产应用程序中使用DC的当前功能和性能。MAS是研究日冕和日光层动力学的最先进的模型,超过70,000行,之前已经使用MPI+OpenACC移植到GPU。我们试图尽可能多地删除OpenACC指令,以支持DC。我们展示了使用NVIDIA { \tt nvfortran}编译器的Fortran 202 X预览实现、统一托管内存和修改后的MPI启动方法,我们可以在多个GPU上实现GPU加速,而无需使用单个OpenACC指令。然而,这样做会导致1.25倍到3倍的减速。我们讨论了未来需要做哪些改进来避免这种损失,并展示了我们如何仍然可以保持密切的关系。

英文摘要:

There is growing interest in using standard language constructs for accelerated computing, avoiding the need for (often vendor-specific) external APIs. These constructs hold the potential to be more portable and much more `future-proof'. For Fortran codes, the current focus is on the {\tt do concurrent} (DC) loop. While there have been some successful examples of GPU-acceleration using DC for benchmark and/or small codes, its widespread adoption will require demonstrations of its use in full-size applications. Here, we look at the current capabilities and performance of using DC in a production application called Magnetohydrodynamic Algorithm outside a Sphere (MAS). MAS is a state-of-the-art model for studying coronal and heliospheric dynamics, is over 70,000 lines long, and has previously been ported to GPUs using MPI+OpenACC. We attempt to eliminate as many of its OpenACC directives as possible in favor of DC. We show that using the NVIDIA {\tt nvfortran} compiler's Fortran 202X preview implementation, unified managed memory, and modified MPI launch methods, we can achieve GPU acceleration across multiple GPUs without using a single OpenACC directive. However, doing so results in a slowdown between 1.25x and 3x. We discuss what future improvements are needed to avoid this loss, and show how we can still retain close

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

↑