- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear all,
What are the mains differences between Open MP and TBB (Threading Building Blocks)? Clearly is TBB faster than openMP? Can TBB be activated using Fortran programming?
Best regards, Didace
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
TBB is a C++ namespace implementation, so the threading is restricted to the C++. TBB in principle is more versatile than OpenMP, although it's still primarily a data parallel model. For problems in which OpenMP is well suited, it should perform better than TBB. We've been struggling over some cases where the difference in performance is more than it ought to be. In either case, programming skill is needed for good results.
Unfortunately, the threading library support for TBB, while compatible with Cilk+ and ArBB, isn't compatible with OpenMP, so it's difficult to make good use of TBB with Fortran. You would likely be able to use threaded parallelism only in C++ functions, using extern "C" linkage for interoperability with Fortran.
Unfortunately, the threading library support for TBB, while compatible with Cilk+ and ArBB, isn't compatible with OpenMP, so it's difficult to make good use of TBB with Fortran. You would likely be able to use threaded parallelism only in C++ functions, using extern "C" linkage for interoperability with Fortran.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Didace,
As Tim points out, TBB does not integrate well with FORTRAN (we are on a Fortran forum).
This asside, for the C++ programmer, the selection of threading model will greatly depend on your application requirements. For applications where you principally have
loop
main context
parallel loop (or n-way fork)
main context
end loop
Then OpenMP will likely provide better performance
TBB is designed to better handle parallel tasks where the tasks tend to run with more independence. When a TBB task encounters a parallel_... statement there is no assumption as to the availibility of hardware theads to perform the slices of the loop or specified tasks. The threads may be (typically are) performing other tasks. Whereas in the typical OpenMP application, the assumption is thefull compliment of, or specified number of, threads are available.
Jim Dempsey
As Tim points out, TBB does not integrate well with FORTRAN (we are on a Fortran forum).
This asside, for the C++ programmer, the selection of threading model will greatly depend on your application requirements. For applications where you principally have
loop
main context
parallel loop (or n-way fork)
main context
end loop
Then OpenMP will likely provide better performance
TBB is designed to better handle parallel tasks where the tasks tend to run with more independence. When a TBB task encounters a parallel_... statement there is no assumption as to the availibility of hardware theads to perform the slices of the loop or specified tasks. The threads may be (typically are) performing other tasks. Whereas in the typical OpenMP application, the assumption is thefull compliment of, or specified number of, threads are available.
Jim Dempsey

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page