Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
89 Views

TBB vs. OpenMP

I'm just wondering why should we use TBB instead of OpenMP in HPC aplications? Is there any specific featrue(s) that separate this libraray from OpenMP? I have developed a small benchmark for the sake of comparing performance and mostly OpenMP beat TBB. 

 

0 Kudos
5 Replies
Highlighted
89 Views

You don't have to, actually.

You don't have to, actually. If you have a well balanced simple parallel loops then OpenMP will fit such scenario the best. if you have Fortran code then openmp is only solution there. BTW have you compared openmp/tbb with cilk plus yet?

There is a comparation article (TBB/OpenMP/Native threads) that might help to decide which parallel runtime is better to take for some particular application.

https://software.intel.com/en-us/intel-threading-building-blocks-openmp-or-native-threads

Moreover, tbb will be useful for not-well-balanced workloads, nested parallelism (the nature of tbb), complex flow graph structures and core C++ feature like exception safety or C++11 friendly constructions.

Some more info summary to read:

http://www.itworld.com/article/2845683/why-threading-building-blocks-are-the-best-multicore-programm...

--Vladimir

0 Kudos
Highlighted
Beginner
89 Views

No, I have not tried Cilk yet

No, I have not tried Cilk yet. Actually the reason which I am curious in such comparison is that I am working on my thesis and I need to know in which cases it's better to use TBB and why is it better.

My assumption was that, We always get better performance if we re-implement the code via TBB.

0 Kudos
Highlighted
89 Views

>>My assumption was that, We

>>My assumption was that, We always get better performance if we re-implement the code via TBB

This is not necessarily true for HPC applications, nor necessarily true for workstation/desktop applications.

When an application has many different types of concurrent procedures to run, then TBB may be a better choice (though the newer OpenMP Task capabilities may even-out the advantage).

When an application has a large collection of similar things (or sections of large array) then OpenMP may be a better choice. OpenMP can be structured to work well with affinity placement of threads (TBB and Cilk Plus are not structured that way).

Some good reference material for your Thesis

http://store.elsevier.com/High-Performance-Parallelism-Pearls-Volume-One/James-Reinders/isbn-9780128...

http://www.amazon.com/High-Performance-Parallelism-Pearls-Volume/dp/0128038195/ref=pd_bxgy_14_img_2?...

The second link is Volume 2

The second link (amazon) has additional good reference material listed in the "Also Bought" section.

Jim Dempsey

0 Kudos
Highlighted
89 Views

>>  I have developed a small

>>  I have developed a small benchmark for the sake of comparing performance and mostly OpenMP beat TBB.

Please, never base a programming performance premise based on a small benchmark. And never bet your Thesis on such a premise. There are many different types of applications. If you want to produce a well founded Thesis, I suggest you perform a comprehensive study of actual cases and not simple or complex benchmarks. An example of a broad range of benchmarks is the PARSEC benchmark suite.

*** However, none of those examples are strictly HPC applications.

Jim Dempsey

0 Kudos
Highlighted
Beginner
89 Views

Quote:Shayan Y. wrote:

Shayan Y. wrote:

No, I have not tried Cilk yet. Actually the reason which I am curious in such comparison is that I am working on my thesis and I need to know in which cases it's better to use TBB and why is it better.

My assumption was that, We always get better performance if we re-implement the code via TBB.

Nice suggestion , Thanks.

0 Kudos