Guodong Li, Michael Delisi, G. Gopalakrishnan, R. Kirby
{"title":"Formal specification of the MPI-2.0 standard in TLA+","authors":"Guodong Li, Michael Delisi, G. Gopalakrishnan, R. Kirby","doi":"10.1145/1345206.1345257","DOIUrl":null,"url":null,"abstract":"Parallel programs will increasingly be written using complex APIs such as MPI-2.0 [1], OpenMP [2], PThreads, etc. It is well documented that even experienced programmers misunderstand these APIs, especially when they are described in natural languages. The behavior of APIs observed through ad hoc experiments on actual platforms is not a conclusive or comprehensive description of the standard. Formal specifications, as currently written and distributed, are inaccessible to most practitioners. In our previous work [4], we presented the formal specification of around 30% of the MPI-1.0 primitives (mainly for point-to-point communication) in TLA+ [6]. TLA+ enjoys wide usage within (at least) Microsoft and Intel by engineers (e.g., [5]). To make our specification accessible to practitioners, we built a C front-end in the Microsoft Visual Studio (VS) parallel debugger environment through which users can submit short (perhaps tricky) MPI programs with embedded assertions, called litmus tests. This input is turned into TLA+ code and run through the TLC model checker [6]. This permits practitioners to play with (and find holes in) the semantics. We also maintain cross-reference tags with the MPI reference document for traceability. While we have demonstrated the merits of our previous work ([4]), this paper handles far more details including those pertaining to data transfers. In this work, we have covered much of MPI-2.0 (has over 300 API functions, as opposed to 128 for MPI-1.0). In addition, our new work provides a rich collection of tests that help validate our specifications. It also modularizes the specification, permitting reuse. The approximate sizes (without including comments and blank lines) of the major parts in the current TLA+ specification are shown in Table 1. We do not plan to model primitives whose behavior depends on the underlying operating system, The framework plus our TLA+ models can be downloaded from [3]. In [4], we describe an execution environment into which users can supply litmus tests and calculate their outcomes directly based","PeriodicalId":290559,"journal":{"name":"Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming","volume":"82 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2008-02-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"25","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 13th ACM SIGPLAN Symposium on Principles and practice of parallel programming","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/1345206.1345257","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 25
Abstract
Parallel programs will increasingly be written using complex APIs such as MPI-2.0 [1], OpenMP [2], PThreads, etc. It is well documented that even experienced programmers misunderstand these APIs, especially when they are described in natural languages. The behavior of APIs observed through ad hoc experiments on actual platforms is not a conclusive or comprehensive description of the standard. Formal specifications, as currently written and distributed, are inaccessible to most practitioners. In our previous work [4], we presented the formal specification of around 30% of the MPI-1.0 primitives (mainly for point-to-point communication) in TLA+ [6]. TLA+ enjoys wide usage within (at least) Microsoft and Intel by engineers (e.g., [5]). To make our specification accessible to practitioners, we built a C front-end in the Microsoft Visual Studio (VS) parallel debugger environment through which users can submit short (perhaps tricky) MPI programs with embedded assertions, called litmus tests. This input is turned into TLA+ code and run through the TLC model checker [6]. This permits practitioners to play with (and find holes in) the semantics. We also maintain cross-reference tags with the MPI reference document for traceability. While we have demonstrated the merits of our previous work ([4]), this paper handles far more details including those pertaining to data transfers. In this work, we have covered much of MPI-2.0 (has over 300 API functions, as opposed to 128 for MPI-1.0). In addition, our new work provides a rich collection of tests that help validate our specifications. It also modularizes the specification, permitting reuse. The approximate sizes (without including comments and blank lines) of the major parts in the current TLA+ specification are shown in Table 1. We do not plan to model primitives whose behavior depends on the underlying operating system, The framework plus our TLA+ models can be downloaded from [3]. In [4], we describe an execution environment into which users can supply litmus tests and calculate their outcomes directly based
并行程序将越来越多地使用复杂的api编写,如MPI-2.0[1]、OpenMP[2]、PThreads等。有充分的证据表明,即使是经验丰富的程序员也会误解这些api,特别是当它们用自然语言描述时。通过在实际平台上的特别实验观察到的api行为并不是对标准的结论性或全面的描述。目前编写和分发的正式规范对大多数从业者来说是不可访问的。在我们之前的工作[4]中,我们在TLA+[6]中提出了大约30%的MPI-1.0原语(主要用于点对点通信)的正式规范。TLA+在(至少)微软和英特尔的工程师(例如b[5])中享有广泛的使用。为了使我们的规范便于从业者使用,我们在Microsoft Visual Studio (VS)并行调试器环境中构建了一个C前端,用户可以通过它提交带有嵌入式断言的简短(可能棘手的)MPI程序,称为石蕊测试。该输入被转换为TLC +代码,并通过TLC模型检查器[6]运行。这允许从业者使用语义(并找到语义中的漏洞)。我们还维护与MPI参考文档的交叉引用标记,以实现可追溯性。虽然我们已经展示了之前工作(b[4])的优点,但本文处理了更多细节,包括与数据传输有关的细节。在这项工作中,我们涵盖了MPI-2.0的大部分内容(有300多个API函数,而MPI-1.0只有128个)。此外,我们的新工作提供了丰富的测试集合,帮助验证我们的规范。它还模块化了规范,允许重用。当前TLA+规范中主要部件的大致尺寸(不包括注释和空行)见表1。我们不打算对行为依赖于底层操作系统的原语进行建模,框架加上我们的TLA+模型可以从[3]下载。在[4]中,我们描述了一个执行环境,用户可以在其中提供石蕊测试并直接计算其结果