计算机工程与设计2024,Vol.45Issue(2) :633-640,封3.DOI:10.16208/j.issn1000-7024.2024.02.040

国产神威环境下Athread代码生成工具的设计与开发

Design and development of automatic Athread code generation tool under Sunway environment

刘加伟 郭强 庄园 张海红 王利 曾云辉
计算机工程与设计2024,Vol.45Issue(2) :633-640,封3.DOI:10.16208/j.issn1000-7024.2024.02.040

国产神威环境下Athread代码生成工具的设计与开发

Design and development of automatic Athread code generation tool under Sunway environment

刘加伟 1郭强 1庄园 1张海红 1王利 1曾云辉1
扫码查看

作者信息

  • 1. 齐鲁工业大学(山东省科学院)计算机科学与技术学部,山东济南 250014;齐鲁工业大学(山东省科学院)山东省计算中心(国家超级计算济南中心),山东济南 250103
  • 折叠

摘要

针对国产神威环境下众核代码编写工作量大的问题,设计实现一个可以将核心段的串行代码自动转换为Athread代码的工具.采用Rust语言进行词法和语法分析,面向不同数组维度的Fortran和C语言程序,基于主程序调用master程序再由master程序调用slave程序的三层模板程序架构,集成常用众核优化方法的代码框架.经过实验分析,采用该自动转换工具生成的Athread代码相较于人工编写的OpenACC*加速的程序有更高的加速比,特别是对多个核心段进行众核化加速时的加速比相差15%,验证该转换工具具有很好的实用性.

Abstract

Aiming at the problem that it is difficult to write Athread code under Sunway environment,an automatic Athread code generation tool that could convert the serial kernel into Athread code was designed and developed.Rust language was used for lexical and syntactic analysis.For different dimensions of arrays in Fortran language and C language,based on a three-tier pro-gram template,the main program called the master program and then the master program called the slave program,while popu-lar many-core optimization methods were applied.Experimental results show that the Athread code generated using the automatic generation tool has higher speedup than the OpenACC*accelerated program,especially for multiple kernels,the speedup can be about 15%,which verifies that the generation tool is valuable in practical application.

关键词

加速线程库/代码生成/模板引擎/语法分析/众核处理器/神威·太湖之光/高性能计算

Key words

Athread library/code generation/template engine/syntactic analysis/many-core processor/Sunway Taihulight/high performance computing

引用本文复制引用

基金项目

科教产融合试点工程重大创新专项基金项目(2022JBZ01-01)

出版年

2024
计算机工程与设计
中国航天科工集团二院706所

计算机工程与设计

CSTPCD北大核心
影响因子:0.617
ISSN:1000-7024
参考文献量15
段落导航相关论文