An automatic many-core code generation method and its implementation under Sunway environment

Jiawei Liu, Qiang Guo, Yuan Zhuang, Haihong Zhang, Yunhui Zeng · 2021

The parallel programming model of Sunway supercomputer based on accelerated thread library plays an important role on the acceleration performance of master-slave core parallelism. At present, two thread-based programming libraries, OpenACC and Athread, are provided. Although OpenACC is convenient, its parallel efficiency is not high and it is disadvantageous for deep optimization. While Athread is flexible and easy to deep optimization, it has a huge workload compared with OpenACC. This paper is based on a three-tier program template in which the main program calls the master program and then the master program calls the slave program, and the Rust language is used for lexical and grammatical analysis. Through the above steps, a method that can automatically convert the source program into Athread-format code is proposed, and some useful optimization methods are also integrated, such as parameters passed by a structure, local static variables and slave-core partition parallelism. Finally, a prototype of conversion tool from Fortran and C code to Athread code is designed and implemented. This method can avoid the vast majority of errors in code writing and greatly improve the efficiency of many-core work for researchers.

Read the paper · More papers on PaperTik