加速Fortran代码:一种将Coarray Fortran与CUDA Fortran和OpenMP集成的方法
Accelerating Fortran Codes: A Method for Integrating Coarray Fortran with CUDA Fortran and OpenMP
AI总结:
本研究提出融合Intel Coarray Fortran、Nvidia CUDA Fortran与OpenMP的并行编程方法,优化内存管理、CPU-GPU亲和性等,经并行泊松求解器验证,其性能与MPI相近且更易实现,可助力新老代码高效迁移至并行计算。
摘要:
Fortran在科学计算领域占据重要地位,因此需要制定相关策略,既要确保遗留代码在高性能计算系统上高效运行,也要让该语言对开发新型高性能代码仍具吸引力。Coarray Fortran(CAF,协同数组Fortran)是Fortran 2008标准中为并行编程引入的组成部分,它以Fortran程序员熟悉的语法实现分布式内存并行,简化了从单处理器到多处理器编码的过渡。本研究聚焦于创新并完善一种并行编程方法,该方法融合了Intel Coarray Fortran、Nvidia CUDA Fortran和OpenMP的优势,分别用于实现分布式内存并行、高速GPU加速和共享内存并行。我们研究了可分页内存与页锁定内存的管理、NUMA多处理器中的CPU-GPU亲和性,以及具备速度优化能力的稳健编译器接口。我们将该方法应用于并行化泊松求解器以进行验证,并将该方法的实现方式、代码实现过程和扩展性能与消息传递接口(MPI)进行对比,发现CAF在速度相近的情况下实现难度更低。对于新代码而言,这种方法为实现优化的并行计算提供了更快捷的途径。对于遗留代码,它简化了向并行计算的过渡,无需大规模重新设计或新增语法,即可将其转化为可扩展的高性能计算应用程序。
英文摘要:
Fortran's prominence in scientific computing requires strategies to ensure both that legacy codes are efficient on high-performance computing systems, and that the language remains attractive for the development of new high-performance codes. Coarray Fortran (CAF), part of the Fortran 2008 standard introduced for parallel programming, facilitates distributed memory parallelism with a syntax familiar to Fortran programmers, simplifying the transition from single-processor to multi-processor coding. This research focuses on innovating and refining a parallel programming methodology that fuses the strengths of Intel Coarray Fortran, Nvidia CUDA Fortran, and OpenMP for distributed memory parallelism, high-speed GPU acceleration and shared memory parallelism respectively. We consider the management of pageable and pinned memory, CPU-GPU affinity in NUMA multiprocessors, and robust compiler interfacing with speed optimisation. We demonstrate our method through its application to a parallelised Poisson solver and compare the methodology, implementation, and scaling performance to that of the Message Passing Interface (MPI), finding CAF offers similar speeds with easier implementation. For new codes, this approach offers a faster route to optimised parallel computing. For legacy codes, it eases the transition to parallel computing, allowing their transformation into scalable, high-performance computing applications without the need for extensive re-design or additional syntax.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。