-
Notifications
You must be signed in to change notification settings - Fork 217
Make recursive-unload not generate load storms. #2316
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
Make recursive-unload not generate load storms. #2316
Conversation
Protect the load("module") with
isloaded("module") or mode() == "unload"
that way we get recursive unload without risking load storms with Lmod.
easybuild/tools/module_generator.py
Outdated
| # to "module unload" | ||
| load_statement = [self.conditional_statement('isloaded("%(mod_name)s") or mode() == "unload"', '\n'.join(body), negative=True)] | ||
| else: | ||
| load_statement = [self.conditional_statement('isloaded("%(mod_name)s")', '\n'.join(body), negative=True)] |
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.
@akesandgren This is a bit too copy-pasta, let's change this too the below, and include a reference to http://lmod.readthedocs.io/en/latest/210_load_storms.html:
if build_option('recursive_mod_unload') or recursive_unload:
# ...
# see also http://lmod.readthedocs.io/en/latest/210_load_storms.html
load_guard = isloaded("%(mod_name)s") or mode() == "unload"'
else:
load_guard = 'isloaded("%(mod_name)s")'
load_statement = [self.conditional_statement(load_guard, '\n'.join(body), negative=True)]|
@akesandgren Oh, and you'll need to fix the broken test, obviously. You ran run the test in isolation (sort of) using |
… guard and actual statement generation. Also add reference to Lmod documentation for this.
|
Thanks for the great fix @akesandgren. Just for context:
|
Protect the load("module") with
isloaded("module") or mode() == "unload"
that way we get recursive unload without risking load storms with Lmod.