Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft Parallel Patterns Library (PPL) vs. OpenMP

I want to compare PPL vs. OpenMP regarding their performance, but can't find a detailed investigation on the web. I believe there are not many people who are experienced with PPL.

I'm developing my software on Windows, using Visual Studio 2010, and don't want to port it to somewhere else in a short term.

If portability is not an issue, and only concern is the performance, what do you think about these two methods?

like image 800
Emre Turkoz Avatar asked Mar 14 '12 10:03

Emre Turkoz


2 Answers

On MSDN there is a great comparison of the properties OpenMP and ConcRT (core of PPL):

The OpenMP model is an especially good match for high-performance computing, where very large computational problems are distributed across the processing resources of a single computer. In this scenario, the hardware environment is known and the developer can reasonably expect to have exclusive access to computing resources when the algorithm is executed.

However, other, less constrained computing environments may not be a good match for OpenMP. For example, recursive problems (such as the quicksort algorithm or searching a tree of data) are more difficult to implement by using OpenMP. The Concurrency Runtime complements the capabilities of OpenMP by providing the Parallel Patterns Library (PPL) and the Asynchronous Agents Library. Unlike OpenMP, the Concurrency Runtime provides a dynamic scheduler that adapts to available resources and adjusts the degree of parallelism as workloads change.

So, Main disadvantages of OpenMP:

  • static sheduling model.
  • not contains cancelation mechanism (very huge disadvantage, in many concurrence algorithm cancelation is required).
  • not contains concurrence agent approach.
  • troubles with exceptions in paralel code.
like image 113
23W Avatar answered Sep 26 '22 15:09

23W


It probably depends on your algorithm, however this research indicates that PPL may be faster then OpenMP:

http://www.codeproject.com/Articles/373305/Visual-Cplusplus-11-Beta-Benchmark-of-Parallel-Loo

Serial : 72ms
OpenMP : 16ms
PPL    : 12ms
like image 37
Alex Avatar answered Sep 23 '22 15:09

Alex