实践中的概念:面向HPC生态系统的C++ MPI绑定。从可标准化核心到可组合接口
Concepts in Practice: C++ MPI Bindings for the HPC Ecosystem - From a Standardizable Core to a Composable Interface
AI总结:
提出基于C++20概念的MPI绑定分层架构,核心层标准化数据缓冲区与过程包装,上层KaMPIng-v2提供可组合管道语法,并适配GPU库。
摘要:
官方的C++ MPI绑定于2008年从标准中移除,留下了众多第三方库试图填补的空白。然而,现有的包装器通常仅覆盖MPI的有限子集或针对特定用例,未能达到通用解决方案的要求。最近一篇概念性论文提出了基于C++20概念的现代C++绑定的一般设计原则,但未承诺具体接口。\n我们首次在分层架构中实现了这些原则。在基础层,我们定义了一个核心层:精炼的C++20概念,形式化MPI标准的数据缓冲区概念、标准C++构造的自动映射、第三方类型的非侵入式定制点,以及基于概念的MPI过程包装器。其结果是一个低级的原生C++ MPI接口,可直接与STL容器一起工作,高度可扩展,并适合标准化。在此核心之上,我们提出了KaMPIng-v2——一个C++ MPI库,提供KaMPIng的便利性和内存安全性,并具有受C++范围启发的可组合、基于管道的语法,用于高效、无样板代码的MPI编程。最后,我们通过为GPU和性能可移植性库设计轻量级适配器,展示了核心层的广泛适用性,使HPC生态系统成为MPI中的一等公民。Kokkos视图、Thrust设备向量和SYCL缓冲区可以直接传递给MPI过程,适配器逻辑保持自包含。\n所有贡献均有一个功能完整的开源参考实现支持,证明了所提出设计的实际可行性。
英文摘要:
The official C++ MPI bindings were removed from the standard in 2008, leaving a gap that numerous third-party libraries have attempted to fill. However, existing wrappers typically cover only a limited subset of MPI or target specific use cases, falling short of a general-purpose solution. A recent conceptual paper proposed general design principles for modern C++ bindings based on C++20 concepts, without committing to a concrete interface. We present the first concrete realization of these principles in a layered architecture. At the foundation, we define a core layer: refined C++20 concepts formalizing the MPI standard's notion of data buffers, automatic mapping of standard C++ constructs, non-intrusive customization points for third-party types, and concept-based wrappers for MPI procedures. The result is a low-level native C++ MPI interface that works directly with STL containers, is highly extensible, and lends itself to standardization. Built on this core, we present KaMPIng-v2 -- a C++ MPI library offering the convenience and memory-safety of KaMPIng with composable, pipe-based syntax inspired by C++ ranges for efficient, boilerplate-free MPI programming. Finally, we demonstrate the core layer's broad applicability by designing lightweight adapters for GPU and performance-portability libraries, making the HPC ecosystem a first-class citizen in MPI. Kokkos views, Thrust device vectors, and SYCL buffers can be passed directly to MPI procedures, with adapter logic remaining self-contained. All contributions are backed by a fully functional open-source reference implementation, demonstrating the practical viability of the proposed design.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。