The International Conference for High Performance Computing, Networking, Storage, and Analysis

Workshops Archive

Lessons Learned: Template-Heavy C++ in Production HPC Runtime Systems


Workshop: LLVM-HPC2025: The 11th Workshop on the LLVM Compiler Infrastructure in HPC

Authors: Arne Hendricks (University of Erlangen-Nuremberg)

Abstract: Modern HPC runtime systems increasingly rely on sophisticated C++ template metaprogramming to achieve zero-cost abstractions and type safety. This paper presents lessons learned from implementing the AllScale runtime system, a production HPC framework that makes extensive use of variadic templates, SFINAE, and template specialization for distributed data management. Through analysis of our template-heavy architecture for data items, automatic serialization, and type-safe requirement systems, we identify key challenges, performance implications, and best practices for template metaprogramming in HPC contexts. Our findings show that careful template design can maintain compile-time performance while enabling zero-cost abstractions that achieve 92-105\% of hand-tuned MPI performance. We provide concrete recommendations for managing template complexity, compilation overhead, and debugging challenges in production HPC systems.


Back to LLVM-HPC2025: The 11th Workshop on the LLVM Compiler Infrastructure in HPC Archive Listing Back to Full Workshop Archive Listing