作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2026, Vol. 52 ›› Issue (8): 193-202. doi: 10.19678/j.issn.1000-3428.0252315

• 体系结构与先进计算 • 上一篇    下一篇

基于SDFG的控制流模型到数据流模型的程序转换方法

付佳伟*(), 陈俊仕, 安虹   

  1. 中国科学技术大学计算机科学与技术学院, 安徽 合肥 230026
  • 收稿日期:2025-04-11 修回日期:2025-06-05 出版日期:2026-08-15 发布日期:2025-07-22
  • 通讯作者: 付佳伟
  • 作者简介:

    付佳伟(CCF学生会员), 男, 硕士研究生, 主研方向为并行编程模型、编译器设计

    陈俊仕(CCF会员), 研究员、博士

    安虹(CCF会员), 教授、博士

  • 基金资助:
    中国科学院战略性先导科技专项(XDB0500102)

Program Transpilation Method from Control Flow Model to Dataflow Model Based on SDFG

FU Jiawei*(), CHEN Junshi, AN Hong   

  1. School of Computer Science and Technology, University of Science and Technology of China, Hefei 230026, Anhui, China
  • Received:2025-04-11 Revised:2025-06-05 Online:2026-08-15 Published:2025-07-22
  • Contact: FU Jiawei

摘要:

数据流编程是一种新型的并行编程范式, 其通过细粒度的任务拆分实现高性能的并行计算, 但也带来了额外的编程复杂性。本文提出一种新型的程序转换方法与编译流程, 借助两层程序中间表示实现了将控制流结构的计算程序全自动无缝转换为数据流结构。由于两种编程模型在程序的表达方式上具有诸多差异, 自动化转换过程中面临许多挑战, 本文将其细化为4个具体的类别, 并逐一提出应对方案。在PolyBench/C数据集上的实验结果表明, 通过本文设计的转换方案产生的数据流程序, 其整体并行计算性能接近基于有状态数据流多重图(SDFG)的OpenMP并行化方案, 并在近一半的样例中超越OpenMP方案。本文还选择了多个具体的程序进行深入分析, 讨论了不同编译方案产生的结果存在性能差异的原因, 展现了Codelet模型在大量线程下面对不规则并行模式的优越性。

关键词: 数据流编程, Codelet模型, 有状态数据流多重图, 程序转换, 源到源翻译器

Abstract:

Dataflow programming is an emerging parallel-programming paradigm. By splitting tasks into fine granularities, high-performance parallel computing can be achieved at the expense of increased programming complexity. This study proposes a new program transpilation method and compilation procedure that leverages two levels of intermediate representation and converts control flow computational programs into a dataflow architecture in a fully automatic manner. Owing to the substantial disparities between these programming models, many challenges exist in automatic conversion schemes, which are split into four categories and addressed separately. Experimental results on the PolyBench/C dataset indicate that the proposed conversion scheme can produce dataflow parallel programs on par with those produced by the Stateful DataFlow multiGraph (SDFG)-based OpenMP parallelizing compiler while surpassing it in approximately half of the cases. This study also conducts case studies on multiple program samples and discusses the causes of performance distinctions in different compilation schemes, revealing the superiority of the Codelet model with a massive number of threads on irregular parallelism.

Key words: dataflow programming, Codelet model, Stateful DataFlow multiGraph (SDFG), program transpilation, source-to-source compiler