An extension of C++ with memory-centric specifications for HPC to reduce memory footprints and streamline MPI development

📅 2024-06-10
🏛️ arXiv.org
📈 Citations: 1
Influential: 0
📄 PDF
🤖 AI Summary
C++ faces critical limitations in HPC—including poor memory efficiency (inability to exploit range information from integers, enums, or bitsets for layout optimization), lack of automatic MPI datatype derivation, and no native support for arbitrary-precision floating-point arithmetic. This paper introduces a compiler-aware, memory-centric language extension for C++, implemented via lightweight LLVM-based attribute annotations. The extension enables bit-field packing, finite-precision floating-point modeling, and automatic MPI datatype generation for struct subsets—while preserving full standard C++ compatibility. It thus achieves fine-grained memory layout optimization and seamless MPI semantic embedding. Evaluated on an SPH numerical simulation benchmark, the approach reduces memory footprint, improves cache locality, accelerates MPI serialization, and significantly decreases manual memory alignment and communication “glue” code.

Technology Category

Application Category

📝 Abstract
The C++ programming language and its cousins lean towards a memory-inefficient storage of structs: The compiler inserts helper bits such that individual instance variables fit to byte or cache boundaries, while it is not able to exploit knowledge about the range of integers, enums or bitsets. Furthermore, the language provides neither support for data exchange via MPI nor for arbitrary floating-point precisions. We propose C++ attributes through which developers can guide the compiler what memory arrangements would be beneficial: Can multiple booleans or integers with limited range be squeezed into one bit field, do floating point numbers hold fewer significant bits than in the IEEE standard, or does the code benefit from a MPI datatype for subsets of attributes? The extension offers the opportunity to fall back to normal alignment via plain C++ assignments, no dependencies upon external libraries are introduced, and the resulting code remains standard C++ subject to some weakened guarantees on addresses and pointer arithmetics. Our work implements the language annotations within LLVM and demonstrates their potential impact, both upon the runtime and the memory footprint, through smoothed particle hydrodynamics (SPH) benchmarks. They uncover the potential gains in terms of performance and development productivity.
Problem

Research questions and friction points this paper is trying to address.

Reducing memory footprints in C++ for HPC applications
Streamlining MPI development with memory-centric specifications
Optimizing data storage for booleans, integers, and floating-point numbers
Innovation

Methods, ideas, or system contributions that make the work stand out.

C++ attributes for optimized memory arrangements
Compiler-guided bit field and precision control
MPI datatype support without external dependencies
🔎 Similar Papers
No similar papers found.