Properly handle toolchains defining openmp toolchain opt as dict (relevant for NVHPC toolchain)#5093
Conversation
Signed-off-by: Jan André Reuter <[email protected]>
Signed-off-by: Jan André Reuter <[email protected]>
Signed-off-by: Jan André Reuter <[email protected]>
Signed-off-by: Jan André Reuter <[email protected]>
That test seems to be brittle... |
Test assumes a fixed order of flags, which might be relevant for certain optimizations, but OpenMP can appear at any place. Since the changes to framework causes the flag to appear earlier, update the test to reflect this as well. Signed-off-by: Jan André Reuter <[email protected]>
b4f01ad to
d7f5662
Compare
Signed-off-by: Jan André Reuter <[email protected]>
|
@lexming Can you take a look at this? |
boegel
left a comment
There was a problem hiding this comment.
I would definitely like to see this fix covered by the tests, i.e. we should verify that openmp toolchain options has the correct effect for a toolchain based on nvidia-compilers...
Agreed. I'll need to figure out how to extend the existing dummy EasyConfigs by |
Signed-off-by: Jan André Reuter <[email protected]>
|
@boegel, tried to add a test for OpenMP & vectorize with |
Signed-off-by: Jan André Reuter <[email protected]>
Signed-off-by: Jan André Reuter <[email protected]>
lexming
left a comment
There was a problem hiding this comment.
thanks for the fix! LGTM
I just a have a minor comment on the tests
Co-authored-by: Alex Domingo <[email protected]>
Signed-off-by: Jan André Reuter <[email protected]>
|
Merging, thanks @Thyre! |
openmp toolchain opt as dictopenmp toolchain opt as dict (relevant for NVHPC toolchain)
In 956f038, we've added a dict for NVHPC to not only enable OpenMP when
'openmp': Trueis passed, but also disable OpenMP when either'openmp': Falseor no value is passed.This is due to NVHPC enabling OpenMP by default, causing issues with e.g. programs using the OpenMP Tools Interface as well.
Unfortunately, the handling of arguments in
_set_compiler_flagsdidn't consider OpenMP as an argument where toolchains can pass a dict. Because of that, enabling OpenMP withnvidia-compilersorNVHPCcauses the following effect, described by @pavelToman:To fix this, copy the handling of
vectorizeto also be used foropenmp. This requires removingopenmpfromCOMPILER_OPTIONSto avoid the default handling earlier on. Since many toolchains simply specify a string or list of strings, keep backwards compatibility by converting them to a dict, passing an empty string for'openmp': False(which is the default).Also harden both
openmpandvectorizeagainst bogus passed values to avoid EasyBuild crashing with a KeyError.