A new 35-page tutorial has been published which gives some insight into the thinking behind Intel Concurrent Collections, and the process of using it for parallel programming. The tutorial shows the workflow for creating a Fibonacci sequence generator in C++. As you might remember, Intel Concurrent Collections is also available for Haskell, and the tutorial provides some insight into the core concepts of Concurrent Collections for that language too.
There are a couple of important concepts in Concurrent Collections:
- There is a focus on whether something should execute, rather than when it should execute. You can use tags for synchronising the order of steps that must run in a particular sequence, but steps generally execute as soon as they have the data they need. The default mode of operation is in parallel and as soon as the required resources are available.
- There is a separation of parallel logic from parallel tuning. A domain expert can express the steps and the dependencies between them, and a programming expert can then work on tweaking performance. Sometimes it will be the same person working in two steps, but this still represents an important contribution towards making parallel programming more accessible to less experienced programmers. Theoretically, you could have a domain expert defining the steps of the program using pseudo-code, with a programmer then creating the real code around that, and this might work well within the workflow.
Concurrent Collections has the following building blocks:
- Steps – These are a bit like modular functions and are the steps in the program’s process.
- Items – These data items use a key-value pair structure, and are used to share data between steps.
- Tags – These are used to tell a step when to execute when there are dependencies between steps.
The process is to create a text representation of the program, using different shaped brackets to represent steps, items and tags. (This part could be done by a domain expert, and while you could jump straight in to using C++ this seems to me to skip a lot of the benefit of using Concurrent Collections.) The Concurrent Collections translator then processes the text representation to turn it into a C++ structure (with the required files included in the header) and with code hints added. The code hints then offer guidance as the programmer fleshes out the C++ program with code for each step. The programmer can tweak the step granularity to strike the right balance between parallel potential and minimising the synchronisation overhead. The code can then be tuned, by a programming rather than a domain expert, to deliver optimal performance.
I recommend you read the full tutorial to get a flavour for how it works. Concurrent Collections is a prototype product available for free download. The team behind it is inviting feedback on how easy it is to use, how it compares to other frameworks you’ve used, and how easy the text notation is to use, among other things. If you’ve got a moment, why not submit your feedback to them? You could be helping to shape the next major tool for parallel programming.