-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
determine the toolchain generation in hooks #31
base: main
Are you sure you want to change the base?
Conversation
src/build_tools/hooks_hydra.py
Outdated
def get_tc_versions(): | ||
" build dict of (sub)toolchain-versions per valid generation " | ||
tc_versions = {} | ||
for toolcgen in VALID_TCGENS: | ||
tc_versions[toolcgen] = [] | ||
for toolc in VALID_TCS: | ||
try: | ||
tc_versions[toolcgen].extend(get_toolchain_hierarchy({'name': toolc, 'version': toolcgen})) | ||
except EasyBuildError: | ||
# skip if no easyconfig found for toolchain-version | ||
pass | ||
|
||
return tc_versions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the dict returned by this method does not change during runtime. So it can be converted to a global constant.
def get_tc_versions(): | |
" build dict of (sub)toolchain-versions per valid generation " | |
tc_versions = {} | |
for toolcgen in VALID_TCGENS: | |
tc_versions[toolcgen] = [] | |
for toolc in VALID_TCS: | |
try: | |
tc_versions[toolcgen].extend(get_toolchain_hierarchy({'name': toolc, 'version': toolcgen})) | |
except EasyBuildError: | |
# skip if no easyconfig found for toolchain-version | |
pass | |
return tc_versions | |
# dict of (sub)toolchain-versions per valid generation " | |
TOOLCHAIN_VERSIONS = {} | |
for toolcgen in VALID_TCGENS: | |
TOOLCHAIN_VERSIONS[toolcgen] = [] | |
for toolc in VALID_TCS: | |
try: | |
TOOLCHAIN_VERSIONS[toolcgen].extend(get_toolchain_hierarchy({'name': toolc, 'version': toolcgen})) | |
except EasyBuildError: | |
# skip if no easyconfig found for toolchain-version | |
pass | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i thought about this at first, but if it is set globally it will be calculated for every hook,
whereas the function will run only once for each easyconfig
--toolchain
optionreplaces #30