What are the differences between Intel TBB and Microsoft PPL?
Asked Answered
D

1

29

I'm planning to start "playing" with task-based parallelism for a cross-platform project. I wanted to use Intel Threading Building Blocks. I'm starting with Windows and Visual Studio.

As I just want to prototype for the moment, I'm thinking about "playing" only on windows, then have enough knowledge to use the library on all compatible platforms.

I've learned that since VS2010, Microsoft provide a similar library, Parallel Processing Library, that have (almost) the same interface than Intel TBB.

Some sources suggest, including TBB's team blog, that they build it together and that it's the same library.

However its not really explicit because it's often suggested that there are minor differences between the two libraries.

So, what are those differences, if any? Should I start directly with last stable ITBB or is it low-risk to just play with Microsoft PPL in prototypes and use ITBB on the cross-platform "real" project?

Dowell answered 22/9, 2011 at 12:58 Comment(9)
what's the benefit of first use PPL and then switch to TBB?Baeza
Depending on your task, maybe OpenMP is quite enough. From my experience, for example, it performs better in image processing.Foochow
@Alex: it does, for sure. image processing is classical and simple example of data parallelization. OP says about taks-based parallelism. In any case OpenMP is much simpler so should be reviewed in any case.Baeza
@AndyT: PPL is automatically available in Visual Studio 2010 that I use - nothing to setup, just include and code-, I don't have to bother with installing anything and setting up the library for each prototype (that can be automated but is still time expensive - even with CMake). If I can prototype something in PPL and be sure it will work and compile without modification with ITBB, then I can start directly with PPL and use ITBB in the real project - that is cross-platform.Dowell
@AlexFarber: Off-topic: I need to practice task-based parallelization specifically. I already know when OpenMP is enough.Dowell
@Klaim: compare: a) download and setup TBB (~ an hour); b) switch later to TBB (even if TBB is very similar to PPL this can take much longer than an hour)Baeza
oh, and licensing. I don't know, does MS charge for commercial usage of PPL?Baeza
@AndyT Setting up each prototype for including ITBB can be time expensive compared to just using PPL and not having to change anything. I don't know about the time that takes b) , that's why I ask because from what I read there seem to be so few differences that it might be just a replace in all files to got from PPL to TBB. If you have more specific informations on the switch, be my guest and post a full answer. :)Dowell
PPL is Parallel Patterns Library ? As for costs, it's a compile-time library. You're free to use the compiler output, even with the free Express editions.Ladylove
B
30

TBB is a superset of PPL (as in VS2010), so it provides all PPL API plus its own APIs that PPL does not have.

Note that namespace Concurrency in VS2010 also contains APIs of Concurrency Runtime (ConcRT, on top of which PPL is built), Asynchronous Agents and etc. TBB does not have most of that, though it has some (e.g. critical_section). As an alternative to Asynchronous Agents, the recent version of TBB features the new flow graph API.

In theory, to switch from PPL to TBB, you just need to replace a path from where you take ppl.h (with TBB, the header comes in <tbbdir>/include/tbb/compat) and of course link with the TBB DLL. However in this case you will be limited to PPL API. To use the "extra" TBB API that does not exist in PPL (such as parallel_pipeline, parallel_reduce, concurrent_priority_queue and other), you need to work with TBB from the very beginning.

Bruis answered 23/9, 2011 at 10:21 Comment(2)
Excellent answer, very precise! Now I understand the fuzzy informations around both libraries : each time something supersets but still differ by additions from something else, it confuse everyone. See C and C++ for example... anyway thanks! I'll go with TBB from the beginning.Dowell
@Nik-Lz, over the years we did not see a significant demand for source code compatibility between TBB and PPL. On the TBB side we keep the source compatibility with previous library versions, and so perhaps with old versions of PPL. But we did not follow PPL development, so additions there are likely missed in TBB. At the same time, many of the "common" classes/functions were extended in TBB, for example to support C++ move semantics. I think now TBB and PPL are two sufficiently different threading libraries with a limited common API subset.Bruis

© 2022 - 2024 — McMap. All rights reserved.