Автор: Patrick Diehl, Steven R. Brandt, Hartmut Kaiser
Издательство: Springer
Год: 2024
Страниц: 233
Язык: английский
Формат: pdf (true), epub
Размер: 26.6 MB
This textbook focuses on practical parallel C++ programming at the graduate student level. In particular, it shows the APIs and related language features in the C++ 17 and C++ 20 standards, covering both single node and distributed systems. It shows that with the parallel features in the C++ 17 and C++ 20 standards, learning meta-languages like OpenMP is no longer necessary. Using the C++ standard library for parallelism and concurrency (HPX), the same language features can be extended to distributed codes, providing a higher-level C++ interface to distributed programming than the Message Passing Interface (MPI).
The book starts with the single-threaded implementation of the fractal sets, e.g. Julia set, and Mandelbrot set, using the C++ Standard Library (SL)’s container and algorithms. This code base is used for parallel implementation using low-level threads, asynchronous programming, parallel algorithms, and coroutines. The asynchronous programming examples are then extended to distributed programming using the C++ standard library for parallelism and concurrency (HPX). Octo-Tiger, an astrophysics code for stellar merger, is used as a showcase for a portable, efficient, and scalable high-performance application using HPX.
Parallelism is the final frontier of computing. By default, we think sequentially. Parallelism and asynchrony are often seen as challenging and complex. Tools to be used sparingly and cautiously, and only by experts. But we must shatter these assumptions, for today, we live in a parallel world. Almost every hardware platform is parallel, from the smallest embedded devices to the largest supercomputers. We must explicitly program for that parallelism to achieve the performance we need. We must change our mindset. Anyone who writes code has to think in parallel. Parallelism must become our default. It must be intuitive and easy to craft correct and performant asynchronous parallel software.
HPX is unique among its peers. It is both a parallel programming philosophy grounded in decades of research and a production software framework developed with the best software engineering practices. It strikes the perfect balance of ease-of-use and performance. Its underlying tenets—such as sending work to data, avoiding or localizing synchronization, and hiding latency—are intuitive and far reaching. In addition, HPX is intimately tied to Standard C++, the predominant language for parallel programming. It has both influenced the evolution of C++ and been inspired by it. This alignment with the standard makes it seamless and natural to use HPX in C++ software. This book will teach you how to concretely use HPX. But it will also teach you how to think in parallel. Embracing the HPX mindset will transform how you approach software engineering and computational science. I began my career working on HPX, and the HPX paradigm continues to influence how I design software every day. I hope it will have the same impact on you.
The book’s core audience is advanced undergraduate and graduate students who want to learn the basics of parallel and distributed C++ programming but are not Computer Science majors. Basic C++ knowledge, like functions, classes, loops, and conditional statements, is assumed as a requirement, while C++ advanced topics, like generic programming, lambda functions, smart pointers, and move semantics, are briefly summarized in the appendix.
Contents:
Скачать Parallel C++: Efficient and Scalable High-Performance Parallel Programming Using HPX