This is an archive of the discontinued LLVM Phabricator instance.

KMP_HW_SUBSET vs KMP_PLACE_THREADS rival envirables fix
ClosedPublic

Authored by jlpeyton on Sep 26 2017, 1:30 PM.

Details

Summary

if both KMP_HW_SUBSET and KMP_PLACE_THREADS are set and KMP_PLACE_THREADS gets
parsed first, then the current environment variable parser rejects both and
neither get used. This patch uses the rivals mechanism that is used for other
environment variable groups (e.g., KMP_STACKSIZE, GOMP_STACKSIZE, OMP_STACKSIZE).
If both are set, then it tells the user that it is ignoring KMP_PLACE_THREADS in
favor of KMP_HW_SUBSET. The message about deprecating KMP_PLACE_THREADS when it
is set is still printed regardless.

Diff Detail

Repository
rL LLVM

Event Timeline

jlpeyton created this revision.Sep 26 2017, 1:30 PM
runtime/src/kmp_settings.cpp
4749 ↗(On Diff #116703)

This cast (void*) removes the volatile qualifier, that will make the compiler a bit unhappy.

I think we need const_cast here, e.g. CCAST(kmp_setting_t **, rivals), then it will be implicitly converted to (void*).

jlpeyton updated this revision to Diff 117890.Oct 5 2017, 2:08 PM

Updated with Andrey's suggestion

This revision is now accepted and ready to land.Oct 6 2017, 3:38 AM
This revision was automatically updated to reflect the committed changes.