arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1711.04471cs.MScs.DCcs.NAmath.NA
收藏

针对FORTRAN 77遗留科学代码的领域特定加速与自动并行化

Domain-Specific Acceleration and Auto-Parallelization of Legacy Scientific Code in FORTRAN 77 using Source-to-Source Compilation

University of Glasgow(格拉斯哥大学)

Wim Vanderbauwhede, Gavin Davidson

AI总结:

本文提出一种源到源编译方法,通过整体程序分析自动将单线程FORTRAN 77代码转换为OpenCL加速程序,实现代码的并行化。

摘要:

大规模并行加速器如GPGPU、许多核心和FPGA为科学家提供了加速复杂系统模拟的强大且经济的工具。然而,将代码移植到这些设备需要深入了解异构编程工具和有效的并行化策略。本文提出了一种源到源编译方法,通过整体程序分析自动将单线程FORTRAN 77遗留代码转换为OpenCL加速程序,并行化内核。主要贡献包括:(1)整体源码重构,允许代码中的任何子程序被卸载到加速器;(2)通过消除冗余传输最小化主机与加速器之间的数据传输;(3)通过识别可并行化的映射和归约进行务实的自动并行化。我们验证了编译器在NIST FORTRAN 78测试套件和多个实际代码上的转换性能:大涡模拟城市流动、高分辨率湍流流动模型、海洋模型Gmodel的浅水组件、大气气候模型线性巴克林模型以及粒子扩散模拟器Flexpart-WRF。自动并行化组件在2D浅水模型(2DSW)和大涡模拟城市流动(UFLES)上进行了测试,产生了完整的OpenCL启用代码库。2DSW和UFLES的完全OpenCL加速版本在GPU上分别比原始CPU代码快9倍和20倍,性能与手动移植代码相同。

英文摘要:

Massively parallel accelerators such as GPGPUs, manycores and FPGAs represent a powerful and affordable tool for scientists who look to speed up simulations of complex systems. However, porting code to such devices requires a detailed understanding of heterogeneous programming tools and effective strategies for parallelization. In this paper we present a source to source compilation approach with whole-program analysis to automatically transform single-threaded FORTRAN 77 legacy code into OpenCL-accelerated programs with parallelized kernels. The main contributions of our work are: (1) whole-source refactoring to allow any subroutine in the code to be offloaded to an accelerator. (2) Minimization of the data transfer between the host and the accelerator by eliminating redundant transfers. (3) Pragmatic auto-parallelization of the code to be offloaded to the accelerator by identification of parallelizable maps and reductions. We have validated the code transformation performance of the compiler on the NIST FORTRAN 78 test suite and several real-world codes: the Large Eddy Simulator for Urban Flows, a high-resolution turbulent flow model; the shallow water component of the ocean model Gmodel; the Linear Baroclinic Model, an atmospheric climate model and Flexpart-WRF, a particle dispersion simulator. The automatic parallelization component has been tested on as 2-D Shallow Water model (2DSW) and on the Large Eddy Simulator for Urban Flows (UFLES) and produces a complete OpenCL-enabled code base. The fully OpenCL-accelerated versions of the 2DSW and the UFLES are resp. 9x and 20x faster on GPU than the original code on CPU, in both cases this is the same performance as manually ported code.

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

↑