Build flag to force enable/disable OpenMP
See original GitHub issueIt would be nice to have a build flag in setup.py
to control whether OpenMP is used or not. There are a few cases where users might want to control this.
Currently on macOS if the system GCC is picked up, it tries to enable OpenMP, which doesn’t necessarily work. Also the current build assumes that OpenMP is not supported when using Clang on macOS, but this depends on whether Apple Clang is used or some other Clang build, which does support OpenMP.
When GCC is used, then GOMP is in use, which has been shown to be not fork safe. So users may decide that they would rather not build with OpenMP support when using this compiler or when they know they plan to fork.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:34 (34 by maintainers)
Top Results From Across the Web
Turn off OpenMP - c++ - Stack Overflow
You can use the environment variable: set OMP_NUM_THREADS=1. Actually, it will not turn OpenMP off. It will force OpenMP to create only one ......
Read more >C H A P T E R 5 - Compiling for OpenMP
To enable explicit parallelization with OpenMP directives, compile your program with the cc, CC, or f95 option flag -xopenmp. This flag can take...
Read more >Optimize Options (Using the GNU Compiler Collection (GCC))
Otherwise -Og enables all -O1 optimization flags except for those that may ... If you want to force the compiler to check if...
Read more >2.4 Building with make - Quantum Espresso
To install the QUANTUM ESPRESSO source package using make, ... configure –enable-openmp. ... make.inc, compilation rules and flags (used by Makefile).
Read more >A “Hands-on” Introduction to OpenMP*
◇Help us improve … tell us how you would make this ... Disable dynamic adjustment of the ... Flush forces data to be...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It’s not just
omp_get_num_threads
, it’s all the functions inopenmp.pxd
, because who knows what we might need in the future? Here’s that file:Probably
I really don’t think we want to go down that road. What if there’s a routine in
openmp.pxd
that we cannot mock properly? We would have to provide both parallel and sequential implementations.I might be wrong but it seems to me that the only ones who would benefit from this are mac users who:
brew
So basically we are missing on potential contributors using macos that don’t want to do 2. and 3.
There is https://github.com/scikit-learn/scikit-learn/pull/13543