HPX and C++ Distributed Computing

For us, HPX is a ‘A general purpose C++ runtime system for parallel and distributed applications of any scale’. While this is quite a mouthful, we mean every word of it. All of the recently published posts on this site so far have focused on the APIs HPX exposes for purely local operation on a single machine. In this installment I would like to start talking about how HPX exposes distributed functionality, i.e. how to use HPX to write truly distributed applications. As we will see, by introducing just minor extensions to the C++ standard the user is able to write homogeneous code without having to pay attention to any differences between invoking functionality locally (on the current node) or remotely (on any other node in a cluster).

HPX and C++ Parallel Algorithms

In Lenexa (May 2015), the C++ standardization committee has finalized the work related to the Technical Specification for C++ Extensions for Parallelism (the latest document at the time of this writing is N4507) . This document describes parallel algorithms which will extend and complement the (sequential) standard library algorithms we all love and use for over a decade now. This is an important – albeit only first – step towards standardizing higher level abstractions for parallelism and concurrency in C++.

HPX and C++ Task Blocks

The quest for finding efficient, convenient, and widely usable higher level parallelization constructs in C++ is continuing. With the standardization document N4411, a group of authors from Intel and Microsoft propose thetask_blockfacility which formalizes fork-join parallelism. From the paper (slightly edited):

HPX and C++ Executors

The STE||AR Group has implemented executors in HPX which, as proposed by the C++ standardization proposal called ‘Parallel Algorithms Need Executors’ (document number N4406), are objects that choose where and how a function call is completed. This is a step in the right direction for HPX and parallelism because executors give more flexibility on how and where task based work should be accomplished and gives the programmer a means to compose executors nicely with execution policies inside of algorithm implementations.

HPX and the C++ Standard

While developing HPX, it has always been a goal to create an API which is as easy to learn and use as possible. We quickly realized that almost all of our functionality can be exposed through the interfaces which are already standardized as part of the C++11 standard library or which are being proposed for standardization over the next years. So we made it our goal to conform to the C++ standard documents and proposals as closely as possible. This decision has fundamental impact on almost all aspects of our work on HPX.