节点文献

面向DCU异构超算平台的WRF模式移植与优化

WRF Model Porting and Optimization for DCU-Based Heterogeneous Supercomputing Platforms

【作者】 张斌

【导师】 陆忠华;

【作者基本信息】 郑州大学 , 计算机技术(专业学位), 2025, 硕士

【摘要】 国产DCU(Deep Computing Unit)异构超算平台,采用当前国际主流的CPU与DCU的异构计算架构,具有强大的计算能力,能够高效处理复杂的计算任务和海量数据。天气研究与预报模式WRF(Weather Research and Forecasting Model)是一款广泛应用的中尺度预报模式,其大气动力学和热力学方程的数值求解过程引出大量复杂的、计算密集型的空间局部网格计算,存在多维度数据依赖、多变量耦合、物理模型边界的特殊性以及物理和动力学过程的复杂性等模型特征。其复杂的物理过程和数值求解过程中产生的大量计算导致了明显的计算瓶颈,同时其空间局部网格计算本身蕴含着高度的并行性,能够充分利用异构计算平台的大规模并行计算能力。因此国产DCU异构超算平台可以为WRF模式中日益增长的复杂物理过程和高分辨率模拟提供必要的计算支撑。本文基于国产DCU异构超算平台,采用Kokkos编程框架对WRF动力框架中的核心热点函数进行了并行移植和优化,本文的主要工作有:1.针对WRF动力框架中的计算瓶颈,本文面向国产DCU异构超算平台,基于Kokkos系统性地移植了WRF动力框架中8个核心热点函数。在深入剖析WRF程序的架构特点,并充分理解面向国产DCU异构加速平台的Kokkos编程模型规范的基础上,采用C++语言并结合Kokkos库,对WRF中计算密集型的核心热点函数进行了重新设计与实现,最终完成了WRF-Kokkos版本。使得该软件够在国产DCU异构超算平台上,以单节点和多节点配置模式稳定且高效地运行。2.WRF-Kokkos的性能优化。为了最大限度地提升WRF-Kokkos在国产DCU异构超算平台上的性能表现,本文深入分析Kokkos的底层运行机制,并细致剖析了WRF热点函数的计算特性,从数组管理、数据传输以及计算流程这三个关键层面进行优化。1)全局数组生命周期管理与DCU端数据复用优化,将函数间共享的数组提升为全局作用域,减少了重复的数据分配和传输操作;2)针对计算过程中需要用的全局数组,进行统一传输管理,减少局部数组的使用;3)通过多重循环融合,减少发起核函数的开销,通过分支外提减少计算和同步开销。3.WRF-Kokkos性能测试分析。首先在国产HYGON DCU异构超算实验平台上验证了WRF-Kokkos的正确性,其结果在合理范围内。接着针对WRF-Kokkos((4500m分辨率数据)的八个核心热点函数在单节点(4DCU)上运行时长与Fortran版本单节点单CPU的4进程相比加速比可以达到1.64,与单进程相比加速比可达7.7,WRF-Kokkos(500m分辨率数据)的八个核心热点函数在16节点(64DCU)的运行时长与Fortran版本在16节点(16CPU)64进程的运行时长相比加速比可达1.62。综上所述,WRF-Kokkos展现出了较好的国产DCU异构超算平台移植性,并能充分利用该异构计算平台的强大算力。本文针对WRF的异构改写基于通用高性能移植框架Kokkos实现,也为日后向更多架构的超算平台进行移植工作提供了一定的工作基础。

【Abstract】 The domestic DCU heterogeneous supercomputing platform adopts the current mainstream CPU-DCU heterogeneous computing architecture,offering powerful computational capabilities to efficiently handle complex computational tasks and massive data processing.The Weather Research and Forecasting Model(WRF)is a widely used mesoscale forecasting model,whose numerical solution of atmospheric dynamics and thermodynamics equations involves complex,computation-intensive spatial local grid calculations.These calculations exhibit characteristics such as multi-dimensional data dependencies,multi-variable coupling,the uniqueness of physical model boundaries,and the complexity of physical and dynamic processes.The intricate physical processes and the massive computations required for numerical solving result in significant computational bottlenecks.However,the spatial local grid computations inherently contain high parallelism,making it possible to fully leverage the large-scale parallel computing capabilities of heterogeneous computing platforms.Therefore,the domestic DCU heterogeneous supercomputing platform can provide the necessary computational support for the increasingly complex physical processes and high-resolution simulations in the WRF model.This study,based on the domestic DCU heterogeneous supercomputing platform,adopts the Kokkos programming framework to parallelize and optimize the core hotspot functions in the WRF dynamical framework.The main contributions of this work are as follows:1.To address the computational bottlenecks in the WRF dynamical framework,this study systematically ports eight core hotspot functions of the WRF dynamical framework to the domestic DCU heterogeneous supercomputing platform using Kokkos.Based on an in-depth analysis of the WRF program architecture and a thorough understanding of the Kokkos programming model for the domestic DCU heterogeneous acceleration platform,the computation-intensive core hotspot functions in WRF were redesigned and implemented using C++and the Kokkos library.As a result,the WRF-Kokkos version was developed,enabling the software to run stably and efficiently on the domestic DCU heterogeneous supercomputing platform in both single-node and multi-node configurations.2.To maximize the performance of WRF-Kokkos on the domestic DCU heterogeneous supercomputing platform,this study conducts an in-depth analysis of the underlying execution mechanism of Kokkos and a detailed examination of the computational characteristics of WRF hotspot functions.Optimizations are carried out across three key aspects:array management,data transfer,and computational workflow:1)Global Array Lifecycle Management and DCU-Side Data Reuse Optimization–Arrays shared between functions are promoted to a global scope,reducing redundant data allocation and transfer operations.2)Unified Management of Global Arrays Used in Computation–A centralized data transfer management approach is implemented to minimize the use of local arrays.3)Loop Fusion and Branch Optimization–Multiple nested loops are fused to reduce kernel launch overhead,while branch extraction is applied to minimize computation and synchronization costs.3.WRF-Kokkos performance testing and analysis.The correctness of WRF-Kokkos was first validated on the domestic HYGON DCU heterogeneous supercomputing experimental platform,with results falling within a reasonable range.Performance tests were then conducted on the eight core hotspot functions.For the4500m resolution dataset,on a single node(4 DCUs),the execution time achieved a speedup of 1.64×compared to the Fortran version running with 4 processes on a single CPU,and a speedup of 7.7×compared to a single-process execution.For the 500m resolution dataset,on 16 nodes(64 DCUs),the execution time achieved a speedup of1.62×compared to the Fortran version running with 64 processes on 16 nodes(16CPUs).In summary,WRF-Kokkos demonstrates good portability to the domestic DCU heterogeneous supercomputing platform and effectively leverages its powerful computational capabilities.The heterogeneous adaptation of WRF in this study is implemented using the general high-performance portability framework Kokkos,providing a foundation for future porting efforts to other supercomputing architectures.

  • 【网络出版投稿人】 郑州大学
  • 【网络出版年期】2026年 06期
  • 【分类号】TP332
节点文献中: 

本文链接的文献网络图示:

本文的引文网络