Can Fortran’s ‘do concurrent’ Replace Directives for Accelerated Computing?

Can Fortran’s ‘do concurrent’ Replace Directives for Accelerated Computing?
复制标题

Fortran 的“并发”能否取代加速计算指令?

DOI:
10.1007/978-3-030-97759-7_1
复制
发表时间:
2022
期刊:
vol 13194. Springer,
影响因子:
--
通讯作者:
Stulajter, M. M.
Stulajter, M. M.
中科院分区:
--
文献类型:
--
作者:
Stulajter, M. M.

文献摘要

相似文献

最近,人们对使用标准语言构造(例如C++的S并行算法和Fortran的DO并发)作为基于指令的API(例如OpenMP和Openacc)的替代方案进行加速计算的兴趣越来越大。这些构造有可能更加可移植,一些编译器已经(或计划)支持这样的标准。在这里,我们看看用Fortran的do并发替换指令的当前功能、可移植性和性能,该小型应用程序目前实现了用于GPU加速的Openacc和用于多核CPU并行的OpenMP。我们用DO并发替换尽可能多的指令,在三个主要编译器中测试各种配置和编译器选项:GNU的gfortran、NVIDIA的nvfortran和Intel的sifort。我们发现,使用正确的编译器版本和标志,可以在不损失性能或可移植性的情况下替换许多指令,并且在nvfortran的情况下,可以全部替换它们。我们讨论了可能适用于更复杂的代码的限制,以及未来可能会缓解这些限制的语言添加。软件和奇点/附件容器是公开提供的,以允许复制结果。
Recently, there has been growing interest in using standard language constructs (e.g. C++’s Parallel Algorithms and Fortran’sdo concurrent) for accelerated computing as an alternative to directive-based APIs (e.g. OpenMP and OpenACC). These constructs have the potential to be more portable, and some compilers already (or have plans to) support such standards. Here, we look at the current capabilities, portability, and performance of replacing directives with Fortran’sdo concurrentusing a mini-app that currently implements OpenACC for GPU-acceleration and OpenMP for multi-core CPU parallelism. We replace as many directives as possible withdo concurrent, testing various configurations and compiler options within three major compilers: GNU’sgfortran, NVIDIA’snvfortran, and Intel’sifort. We find that with the right compiler versions and flags, many directives can be replaced without loss of performance or portability, and, in the case ofnvfortran, they can all be replaced. We discuss limitations that may apply to more complicated codes and future language additions that may mitigate them. The software and Singularity/Apptainer containers are publicly provided to allow the results to be reproduced.