Is it still worth to invest time into OpenMP implementations?

Since clang/llvm has no plan to support OpenMP any time soon, and Intel is going far away down the road of TBB library. Is it still worth to implement multi-thread scientific libraries (I am working on ccv: http://github.com/liuliu/ccv) on top of OpenMP? Despite all the criticisms, my experience with OpenMP is quite happy (it is super easy to use, and the performance gain is reasonable). But if it is a dying technology, what's the replacement for easier-multi-thread in C? (not pthread, and TBB is C++ thing). Thanks!


OpenMP is alive and well, with some efforts going into even extending it to manycore accellerator type things. Incorporating OpenMP sadly isn't high on Clang's priority list, but all existing compiler vendors (Intel, gcc, pgi, etc) are committed to not only existing implementations but the ongoing developments in the standard. I wouldn't worry about it; eventually clang/llvm will come around.


If you look at the C++11 feature support in clang list you'll notice that the concurrency support is entirely nonexistent.

So even though the new C++ standard actually offers great features for concurrency and multithreading, we currently can't really use it if we want to stay platform independent.

So if you have existing OpenMP code, don't sweat it; clang simply isn't supported and while that's a pity, it makes no sense to switch to another technology just because of it. Of course you could use TBB but I'd say that in the light of C++11 concurrency TBB is just a transitional technology anyway.

Personally, I'd be more than happy to see the last of OpenMP but at the moment we're not there yet.


The new C standard, C11, has its own support for threads, that follows a broken down pthreads model. (C++11 has the same, BTW) This can't replace OpenMP, though, in its simplicity to tackle parallel loops and doing reductions etc.

There is one "new" tool that is worth looking into, _Atomic . Classical thread libraries only give you mutexes to avoid races, which can be quite heavy in cases that there is congestion on some data. _Atomic finally gives a lowlevel language interface to features that processors have in most cases, anyhow, and it allows you to do quick updates of counters or stuff like that between threads without races.

_Atomic and OpenMP should cooperate without problems.

链接地址: http://www.djcxy.com/p/64518.html

上一篇: 线程与共享内存和MPI之间的主要区别?

下一篇: 投入OpenMP实施还是值得的吗?