Table of Contents
Fetching ...

KaMPIng: Flexible and (Near) Zero-Overhead C++ Bindings for MPI

Tim Niklas Uhl, Matthias Schimek, Lukas Hübner, Demian Hespe, Florian Kurpicz, Christoph Stelz, Peter Sanders

TL;DR

This work proposes novel language bindings that cover all abstraction levels from low-level MPI calls to convenient STL-style bindings, where most parameters are inferred from a small subset of parameters, by bringing named parameters to C++.

Abstract

The Message-Passing Interface (MPI) and C++ form the backbone of high-performance computing, but MPI only provides C and Fortran bindings. While this offers great language interoperability, high-level programming languages like C++ make software development quicker and less error-prone. We propose novel C++ language bindings that cover all abstraction levels from low-level MPI calls to convenient STL-style bindings, where most parameters are inferred from a small subset of parameters, by bringing named parameters to C++. This enables rapid prototyping and fine-tuning runtime behavior and memory management. A flexible type system and additional safety guarantees help to prevent programming errors. By exploiting C++'s template metaprogramming capabilities, this has (near) zero overhead, as only required code paths are generated at compile time. We demonstrate that our library is a strong foundation for a future distributed standard library using multiple application benchmarks, ranging from text-book sorting algorithms to phylogenetic interference.

KaMPIng: Flexible and (Near) Zero-Overhead C++ Bindings for MPI

TL;DR

This work proposes novel language bindings that cover all abstraction levels from low-level MPI calls to convenient STL-style bindings, where most parameters are inferred from a small subset of parameters, by bringing named parameters to C++.

Abstract

The Message-Passing Interface (MPI) and C++ form the backbone of high-performance computing, but MPI only provides C and Fortran bindings. While this offers great language interoperability, high-level programming languages like C++ make software development quicker and less error-prone. We propose novel C++ language bindings that cover all abstraction levels from low-level MPI calls to convenient STL-style bindings, where most parameters are inferred from a small subset of parameters, by bringing named parameters to C++. This enables rapid prototyping and fine-tuning runtime behavior and memory management. A flexible type system and additional safety guarantees help to prevent programming errors. By exploiting C++'s template metaprogramming capabilities, this has (near) zero overhead, as only required code paths are generated at compile time. We demonstrate that our library is a strong foundation for a future distributed standard library using multiple application benchmarks, ranging from text-book sorting algorithms to phylogenetic interference.
Paper Structure (24 sections, 13 figures, 1 table)

This paper contains 24 sections, 13 figures, 1 table.

Figures (13)

  • Figure 1: KaMPIng offers a high-level easy-to-use interface (1) and full control over each parameter (2). Data types and buffer sizes can be automatically inferred (3). Arguments allow passing by reference or by value and transferring data ownership via move semantics (4). Out-parameters allow controlling which default-computed parameters are returned to the user (5). Resize policies allow controlling memory allocation (6).
  • Figure 2: Allgathering of a vector using MPI.
  • Figure 3: The vector allgather MPI example from \ref{['fig:kamping_vs_mpi']} can be gradually migrated to use more of KaMPIng's features.
  • Figure 4: Defining custom static types using automatic type reflection or a custom type definition.
  • Figure 5: Usage of KaMPIng's serialization.
  • ...and 8 more figures