Advanced C++: constexpr (and also consteval and constinit)
Advanced C++: DLAF Use Case
Advanced C++ for HPC: Introduction
Advanced C++: GROMACS Use Case
Advanced C++: Introduction to Kokkos
Advanced C++: Lambdas and Functions
Advanced C++: Move Semantics
Advanced C++: Multithreaded Task System (Use Case)
Advanced C++: Name Resolution and Type Deduction
Advanced C++: Object Types and Value Initialization
Advanced C++: Ranges
Advanced C++: Resource Management
Advanced C++: STL
Advanced C++: Templates
Advanced C++ for High-Performance Computing
Overview
The course aims at providing the fundamental tools for effective C++ programming in the context of high-performance computing. The tools include generic programming techniques, API development, and specific C++-11/14/17 constructs. Starting from a basic knowledge of C++, the attendees should be able to start using C++ language to engineer durable abstractions to develop and optimize applications. Example usage of modern C++ concepts and features are taken from scientific applications used by the HPC community, giving the attendees the opportunity to see the presented tools in action in real world cases. Exercises are provided from a GitHub repository. This material is meant to reflect the current state of the current C++ standard. As the standard changes, some aspects of this course may become outdated.
This course is an integral part of the ESiWACE-2 project, and we acknowledge the partial funding from that project. The contact person is william.sawyer@cscs.ch.
Overview
C++ is a very powerful programming language, used worldwide to develop complex and performance critical applications. It is then an important candidate for developing HPC applications. Mastering the power of the language requires substantial effort but pays off as projects scale up in size and complexity, and, as the hardware architectures become more and more diverse and complex, C++ allows the implementation of the proper abstractions to make applications sustainable in the future. Specifically, C++ allows the development of type safe, flexible and portable functionalities, with no runtime overhead.
The course has many units derived largely from our experience using C++ for HPC. It is assumed the student has a basic knowledge of C++ programming in order to put these advanced topics into a proper context. Several C++ Use Cases are provided as an illustration of how C++ can be used productively in the HPC setting. Finally, there is also a unit containing C++ exercises, which are publicly available in a repository.
- Introduction
- Values and Object Initialization
- Name Resolution
- Templates
- Move Semantics
- Constexpr / Consteval / Constinit
- Lambdas and functions
- STL
- Ranges
- Resource Management
- Concept-based design
- Use Case: DLAF
- Use Case: GROMACS
- Use Case: Tasking library
- Use Case: Kokkos
- Q&A / Exercises
The course was actually given by a number of instructors:
Nora Abi Akar, Software Engineer (CSCS)
Anton Afanasyev, Software Engineer (CSCS)
Mauro Bianco, Scientific Software & Libraries Group Lead (CSCS)
Christopher Bignamini, Computational Scientist (CSCS)
Nur Aiman Fadel, Software Engineer (CSCS)
Sebastian Keller, Computational Scientist (CSCS)
The OER editor gratefully acknowledges their contributions.
Introduction to the CSCS 2021 Advanced C++ Course
Object Types and Value Initialization
Name Resolution and Type Deduction
Templates
Move Semantics
Constant Expressions
Lambdas and Functions
Standard Template Library
C++20 Ranges
Resource Management
Distributed Linear Algebra with Futures: Use Case
Concept-based Design
GROMACS Use Case
Multithreaded Task System Use Case
KOKKOS Use Case
Exercises
Examples and Exercises can be found in https://github.com/eth-cscs/examples_cpp