arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.26527cs.DCcs.PL
收藏

C语言带OpenMP并行的形式语义(扩展版)

A Formal Semantics of C with OpenMP Parallelism (Extended Version)

University of Illinois Chicago(伊利诺伊大学芝加哥分校);The College of William and Mary(威廉玛丽学院);Iowa State University(爱荷华州立大学)

Ke Du, Anshu Sharma, Liyi Li, William Mansky

AI总结:

基于CompCert验证编译器的C语义及其并发扩展,提出一种带OpenMP指令的C语言形式语义,能够捕获OpenMP指令与变量状态间的微妙交互,并保证无数据竞争。

摘要:

OpenMP是一个流行的并行化框架,允许用户通过少量简单注解将顺序代码转换为并行代码。不幸的是,通过向原本正确的程序中添加OpenMP pragma也容易无意中引入错误,包括逻辑错误和竞争条件。我们基于CompCert验证编译器的C语义及其并发扩展,提出了一种带OpenMP指令的C语言形式语义。我们的语义捕获了OpenMP指令与变量状态之间的微妙交互,这些交互被先前的OpenMP语义所掩盖,并为检测由错误注解引入的不良行为提供了基础:特别是,任何成功执行都保证无数据竞争。

英文摘要:

OpenMP is a popular parallelization framework that lets users transform sequential code into parallel code with a few simple annotations. Unfortunately, it is also easy to inadvertently introduce errors by adding OpenMP pragmas into otherwise correct programs, including both logic errors and race conditions. We present a formal semantics for C code with OpenMP directives, building on the C semantics of the CompCert verified compiler and its extension to concurrency. Our semantics captures subtle interactions between OpenMP directives and variable state that have been obscured by previous OpenMP semantics, and provides a basis for detecting undesired behaviors introduced by incorrect annotations: in particular, any successful execution is guaranteed to be free of data races.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑