fix[cartesian]: Disable OpenMP multithreading for DaCe backends#2491
Conversation
|
Adding @tehrengruber as reviewer to check with PMAP people if they are running with openmp on mac for development. |
There was a problem hiding this comment.
I'd also suggest to add minimal tests (e.g. we run daily CI on MacOS hardware) to catch obvious errors like deactivating OpenMP on the wrong platform.
Also, we might wanna allow OpenMP on MacOS systems if used in combination with GCC (like we do - without issues - on the daily CI).
|
My bad - this was supposed to be a draft. Thanks for the review, I'll be back on it today |
Add unit tests
|
PR has been modified to introduce a wider GT4Py flag to deactivate OpenMP |
This is now not disabled on MacOS by default. Should be transparent to PMAP people |
twicki
left a comment
There was a problem hiding this comment.
to me this looks like it is ready to go
romanc
left a comment
There was a problem hiding this comment.
I find it a little weird that the oir to treeir translator is deciding based on gt_config.GT4PY_CARTESIAN_ENABLE_OPENMP while the pyext builder is looking at gt_config.build_settings["openmp"]["use_openmp"]. I guess it's a matter of taste.
Description
This PR deactivate OpenMP
when detecting MacOS (based on a new configuration.Darwin) as the OS.This was motivated by
apple-clangnot shipping withopenmpby default and the way to acquire it is requiresbrewor other workaround we won't expect out of our users.In detail the PR:
GT4PY_CARTESIAN_ENABLE_OPENMPenv var and configuration flagomp_get_max_threadsfrom codegen on the glue code of stencil DaCe backends when all the computes are sequential (non MacOS related),put an option in theStencilBuilderto centralize deactivation of OpenMP and turn it off when detectingDarwin(+ warning),openmpflags from the command line based on the above option.Requirements