Saved in:
Bibliographic Details
Main Authors: Radtke, Pawel K., Barrera-Hinojosa, Cristian G., Ivkovic, Mladen, Weinzierl, Tobias
Format: Preprint
Published: 2024
Subjects:
Online Access:https://arxiv.org/abs/2406.06095
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866917158444859392
author Radtke, Pawel K.
Barrera-Hinojosa, Cristian G.
Ivkovic, Mladen
Weinzierl, Tobias
author_facet Radtke, Pawel K.
Barrera-Hinojosa, Cristian G.
Ivkovic, Mladen
Weinzierl, Tobias
contents C++ leans towards a memory-inefficient storage of structs: The compiler inserts padding bits, while it is not able to exploit knowledge about the range of integers, enums or bitsets. Furthermore, the language provides no support for arbitrary floating-point precisions. We propose a language extension based upon 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, and is a programmer willing to trade attribute ordering guarantees for a more compact object representation? The extension offers the opportunity to fall back to normal alignment and native C++ floating point representations via plain C++ assignments, no dependencies upon external libraries are introduced, and the resulting code remains (syntactically) standard C++. As MPI remains the de-facto standard for distributed memory calculations in C++, we furthermore propose additional attributes which streamline the MPI datatype modelling in combination with our memory optimisation extensions. Our work implements the language annotations within LLVM and demonstrates their potential impact through smoothed particle hydrodynamics benchmarks. They uncover the potential gains in terms of performance and development productivity.
format Preprint
id arxiv_https___arxiv_org_abs_2406_06095
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle An extension of C++ with memory-centric specifications for HPC to reduce memory footprints and streamline MPI development
Radtke, Pawel K.
Barrera-Hinojosa, Cristian G.
Ivkovic, Mladen
Weinzierl, Tobias
Mathematical Software
C++ leans towards a memory-inefficient storage of structs: The compiler inserts padding bits, while it is not able to exploit knowledge about the range of integers, enums or bitsets. Furthermore, the language provides no support for arbitrary floating-point precisions. We propose a language extension based upon 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, and is a programmer willing to trade attribute ordering guarantees for a more compact object representation? The extension offers the opportunity to fall back to normal alignment and native C++ floating point representations via plain C++ assignments, no dependencies upon external libraries are introduced, and the resulting code remains (syntactically) standard C++. As MPI remains the de-facto standard for distributed memory calculations in C++, we furthermore propose additional attributes which streamline the MPI datatype modelling in combination with our memory optimisation extensions. Our work implements the language annotations within LLVM and demonstrates their potential impact through smoothed particle hydrodynamics benchmarks. They uncover the potential gains in terms of performance and development productivity.
title An extension of C++ with memory-centric specifications for HPC to reduce memory footprints and streamline MPI development
topic Mathematical Software
url https://arxiv.org/abs/2406.06095