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.
翻译:消息传递接口(MPI)与 C++ 构成了高性能计算的核心基础,但 MPI 仅提供 C 和 Fortran 语言绑定。虽然这提供了良好的语言互操作性,但像 C++ 这样的高级编程语言能使软件开发更快速且更不易出错。我们提出了一种新颖的 C++ 语言绑定方案,通过将命名参数引入 C++,覆盖了从底层 MPI 调用到便捷的 STL 风格绑件的所有抽象层次——其中大多数参数可从少量参数子集推断得出。这支持快速原型设计以及运行时行为和内存管理的微调。灵活的类型系统和额外的安全保证有助于防止编程错误。通过利用 C++ 的模板元编程能力,该方案实现了(近乎)零开销,因为仅在编译时生成必需的代码路径。我们通过从教科书式排序算法到系统发育推断的多种应用基准测试证明,我们的库是构建未来分布式标准库的坚实基础。