DafnyMPI: A Dafny Library for Verifying Message-Passing Concurrent Programs
Aleksandr Fedchin, Antero Mejr, Hari Sundar, Jeffrey S. Foster
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext cc336c3c-6729-46a3-94e8-60dda8f238bdBuilds on5
- Actris: session-type based reasoning in separation logicJonas Kastberg Hinrichsen, Jesper Bengtson, Robbert KrebbersPOPL 2020 · 44 citations
- Armada: low-effort verification of high-performance concurrent programsJacob R. Lorch, Yixuan Chen, Manos Kapritsos, Bryan Parno et al.PLDI 2020 · 25 citations
- Deadlock-Free Separation Logic: Linearity Yields Progress for Dependent Higher-Order Message PassingJules Jacobs, Jonas Kastberg Hinrichsen, Robbert KrebbersPOPL 2024 · 12 citations
- Higher-Order Leak and Deadlock Free LocksJules Jacobs, Stephanie BalzerPOPL 2023 · 5 citations
- Formally Verified Cloud-Scale AuthorizationAleks Chakarov, Jaco Geldenhuys, Matthew Heck, Michael Hicks et al.ICSE 2025 · 1 citation
Related papers
- Symbolic verification of message passing interface programsHengbiao Yu, Zhenbang Chen, Xianjin Fu, Ji Wang et al.ICSE 2020 · 20 citations
- Efficient Predictive Monitoring of Message Passing Interface ProgramsJiaqiang Yao, Haocheng Geng, Zhenbang ChenISSTA 2026
- Collective Contracts for Message-Passing Parallel ProgramsZiqing Luo, Stephen F. SiegelCAV 2024
- Verifying Array Properties in Pure Data-Parallel ProgramsNikolaj Hey Hinnerskov, Robert Schenck, Cosmin E. OanceaPLDI 2026 · 1 citation
- VeyMont: Parallelising Verified Programs Instead of Verifying Parallel ProgramsPetra van den Bos, Sung-Shik JongmansFM 2023 · 6 citations
