5

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?

Emre Turkoz
  • 828
  • 1
  • 21
  • 33

3 Answers3

4

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.
23W
  • 1,162
  • 12
  • 32
  • 1
    Small addition: PPL parallel_for algorithm have some overheads for dynamics task scheduling between CPU cores. So, it's not good solution for small calculation cycles. But, there is good Microsoft PPL extension: [PPLExtras](http://archive.msdn.microsoft.com/concrtextras). This extension contains fixed version (static sheduling algorithm) for parallel_for special for small cycles - best perfomance. – 23W Mar 12 '13 at 09:01
2

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
Alex
  • 380
  • 2
  • 12
  • 1
    I wouldn't be so quick to base my choice on a single test done by someone else, which also ran for just a few milliseconds. – rustyx Sep 04 '16 at 17:15
1

If your only concern is performance then what I think about the two approaches is completely irrelevant. This is a question resolvable by an empirical approach, not by argumentation.

High Performance Mark
  • 74,067
  • 7
  • 97
  • 147