An extension of C++ with memory-centric specifications for HPC to reduce memory footprints and streamline MPI development
<|reference_start|>An extension of C++ with memory-centric specifications for HPC to reduce memory footprints and streamline MPI development: The C++ programming language and its cousins lean towards a memory-inefficient storage of structs: The compiler inserts helper bits into the struct such that individual attributes align with bytes, and it adds additional bytes aligning attributes with cache lines, while it is not able to exploit knowledge about the range of integers, enums or bitsets to bring the memory footprint down. Furthermore, the language provides neither support for data exchange via MPI nor for arbitrary floating-point precision formats. If developers need to have a low memory footprint and MPI datatypes over structs which exchange only minimal data, they have to manipulate the data and to write MPI datatypes manually. We propose a C++ language extension based upon C++ attributes through which developers can guide the compiler what memory arrangements would be beneficial: Can multiple booleans be squeezed into one bit field, do floats hold fewer significant bits than in the IEEE standard, or does the code require a user-defined MPI datatype for certain subsets of attributes? The extension offers the opportunity to fall back to normal alignment and padding rules via plain C++ assignments, no dependencies upon external libraries are introduced, and the resulting code remains standard C++. 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.<|reference_end|>
@article{radtke2024an,
    title={An extension of C++ with memory-centric specifications for HPC to reduce
  memory footprints and streamline MPI development},
    author={Pawel K. Radtke and Cristian G. Barrera-Hinojosa and Mladen Ivkovic
  and Tobias Weinzierl},
    journal={arXiv preprint arXiv:2406.06095},
    year={2024},
    archivePrefix={arXiv},
    eprint={2406.06095},
    primaryClass={cs.MS}
}