Abstract

A commonly used approach to develop deterministic parallel programs is to augment a sequential program with compiler directives that indicate which program blocks may potentially be executed in parallel. This paper develops a verification technique to reason about such compiler directives, in particular to show that they do not change the behaviour of the program. Moreover, the verification technique is tool-supported and can be combined with proving functional correctness of the program. To develop our verification technique, we propose a simple intermediate representation (syntax and semantics) that captures the main forms of deterministic parallel programs. This language distinguishes three kinds of basic blocks: parallel, vectorised and sequential blocks, which can be composed using three different composition operators: sequential, parallel and fusion composition. We show how a widely used subset of OpenMP can be encoded into this intermediate representation. Our verification technique builds on the notion of iteration contract to specify the behaviour of basic blocks; we show that if iteration contracts are manually specified for single blocks, then that is sufficient to automatically reason about data race freedom of the composed program. Moreover, we also show that it is sufficient to establish functional correctness on a linearised version of the original program to conclude functional correctness of the parallel program. Finally, we exemplify our approach on an example OpenMP program, and we discuss how tool support is provided.

Highlights

  • A common approach to handle the complexity of parallel programming is to write a sequential program augmented with parallelisation compiler directives that indicate which part of the code might be parallelised

  • We show that a commonly used subset of a deterministic programming language such as OpenMP can be encoded into this intermediate representation, and our verification technique allows us to reason about the correctness of compiler directives in OpenMP

  • We have presented the PPL language that captures the main forms of deterministic parallel programming, and we have shown how a commonly used subset of OpenMP can be encoded into PPL

Read more

Summary

Introduction

A common approach to handle the complexity of parallel programming is to write a sequential program augmented with parallelisation compiler directives that indicate which part of the code might be parallelised. We develop a verification technique to reason about data race freedom and functional correctness on an intermediate representation language, called PPL (for Parallel Programming Language), which captures the core features of deterministic parallel programming. We show that a commonly used subset of a deterministic programming language such as OpenMP can be encoded into this intermediate representation, and our verification technique allows us to reason about the correctness of compiler directives in OpenMP. This paper is an extended version of our paper presented at NFM 2017 [12] It contains (1) a rephrasing of the verification rules for parallel and vectorised loops, presented at FASE 2015 [5] in the setting of PPL, i.e. rephrasing them for basic blocks, and (2) an algorithm that encodes a commonly used subset of OpenMP into PPL.

OpenMP
Program specifications: syntax and semantics
Syntax and semantics of deterministic parallelism
Syntax
Semantics
Subset of OpenMP
OpenMP to PPL encoding
Example translations
Verification of basic blocks
Iteration contracts
Verification rules for basic blocks
Soundness
Denotational semantics of blocks
Correctness of parallel blocks
Verification of block composition
Verification of block composition without resource transfers
Verification of block composition with resource transfers
Tool support
Encoding of basic blocks into viper
Encoding of the b-linearise rule into viper
Example: verification of an OpenMP program
Related work
10 Conclusion and future work
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call