OpenMP and POSIX threads on Linux*

OpenMP and POSIX threads on Linux*

To what extent is Intel's implementation of OpenMP on Linux* based on Pthreads? When I look at the code generated by Intel C++ or Fortran with -openmp, I see a lot of __kmpc* calls such as:
call __kmpc_fork_call

I know these are implemented in the compiler OpenMP lib:

But there is a lot of functionality added by the compiler, over and above what is provided by Pthreads. For example, the Fork-Join model with parallel region master and slave threads -- there is no such concept in Phreads. With Pthreads, all threads are peers.

Are the __kmpc* calls implemented on top of Pthreads, or are they essentially a unique, low-level threading API?


2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Patrick,
The Intel OpenMP implementation for Linux is based on Pthreads. In general, the kmpc_* calls wrap Pthreads functions. The compiler turns OpenMP directives into theaded code but it really doesn't add any functionality that isn't available in the Pthreads library.

It's true that with Pthreads all threads are peers. There's no master-worker relationship between threads unless the programmer chooses to code that way. Thread libraries (e.g., Pthreads) are designed to be flexible and general. OpenMP, which is designed to express data parallelism, is explicitly master-worker.


Leave a Comment

Please sign in to add a comment. Not a member? Join today