Minimal implementation of the OpenMP runtime library, lightweight replacement of libgomp for Mingw-w64.
Good to use in libraries and small applications.
The original project page is here.
-
Small size with static linking
It's ~150k less without linking withlibpthreadandlibgompin Mingw-w64. -
Supports Windows XP
The latest version of Mingw-w64 is not, because oflibpthreaddependency, which needs GetTickCount64. -
Portable
Although written to work with Mingw-w64, it also works on Linux usingpthreads. Can be ported to different platforms. -
CLANG support
You can link object files from GCC and CLANG together with the same library.
- GCC compiler (
GOMP_*interface) - CLANG compiler (
__kmpc_*interface) parallelfornum_threadsschedule(static)for CLANGschedule(dynamic)chunk-size- loop with index decrement
- 32/64-bit loop index
critical(unnamed only)barriersinglesectionsfor GCCreductionfor CLANG (stub)masterfor CLANG- features implemented by the compiler (inlined in object code)
atomicschedule(static)with GCCsectionswith CLANGreductionwith GCCmasterwith GCC
for nowaitfor orderedschedule(runtime)- named
critical omp_lock_t,omp_init_lock(),omp_set_lock(),omp_unset_lock()- OpenMP environment variables
And other rarely used features.
-
guidedwork same asdynamic -
the maximum number of threads is limited at compile time
(MAX_THREADSdefine) -
always
monotonic -
limited overflow checking for the loop indexes
Can overflow with extremechunk-sizeand increment values. -
you can run only one parallel block at a time
Use locks if this situation can occur. This implementation uses static resources that are shared by all threads in the process. But for static linking, it is independent from other static linkages and different OpenMP runtime implementations.