-
Notifications
You must be signed in to change notification settings - Fork 117
[wip] [feat] Module helper #1203
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
Conversation
|
Hello @davidedelvento, Thank you for submitting the Pull Request!
Do see the ReFrame Coding Style Guide |
|
Can I test this patch? |
victorusu
left a comment
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.
@davidedelvento, thanks for the PR.
I think it is a great initiative, we should have that inside ReFrame.
I am just concerned about the integration with the current code, since some of the helper functions or classes that you implement are not in sync with the way modules are implemented in ReFrame or have already been implemented inside ReFrame.
| @@ -0,0 +1,67 @@ | |||
| import subprocess | |||
|
|
|||
| class PopenCommunicate(): | |||
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 would be great if this code could have a tighter integration with ReFrame.
The PopenCommunicate() should not be needed since ReFrame provides methods to run external processes.
Having said that, I am in the opinion that one needs to use the Python bindings for Lmod, which is the way that all module systems are implemented in ReFrame (https://github.com/eth-cscs/reframe/blob/master/reframe/core/modules.py). So, this class should be dropped.
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.
Hi @victorusu
Thanks for the suggestions. I see your points. In fact, I pushed here what I had done in another context, so it's no surprise that it looks a bit like duct-taped ;-)
I'll try to get to your suggestions as soon as I have time.
Cheers,
Davide
| return str(proc.communicate()[0]) # None-terminated, removed None | ||
|
|
||
|
|
||
| def _all_avail_mods(thing_to_load, ml_av_output): |
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 think an extended version of this function should go to the Lmod backend. But it does require an extension of the Modules' System.
|
|
||
| return all_versions | ||
|
|
||
| def _loop_among_one(module_glob, pc, env_context=""): |
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 also think this should go to the Lmod backend.
The python bindings for Lmod are preferred over calling ml avail.
And the function name should be slightly improved to better explain what it does.
|
I haven't forgotten about this, quite the contrary. Just gotten caught in more urgent things. Hope to find the time for this (and overall reframe work) in the not-too-far future... |
|
@davidedelvento Nice. It will be much easier to merge this if it targets specifically #1159. For that we'd need simply to extend the module systems API of ReFrame (and accordingly its backends) to obtain a list of module names based on a given pattern. Each backend may implement that in its own way. We'd also need a utility function (pretty simple) that would expose that functionality in a convenient way to be used in a paremeterized test. Such a PR would be much simpler than this one and would make it easier to merge upstream. |
|
This is replaced by #1417. |
Contex
Per discussion on #1159
Not adding [feat] to the PR title since there is no feature just a helper file which (hopefully) will later contribute to the feature implementation described in #1159
Actual PR description
This is what NCAR uses in house, with minimal cleaning, for the very reason of #1159. Before spending more time on it to clean it up and integrating into ReFrame, I wanted to get some feedback.
Note that there is one skipped test (empty, mostly a reminder of something we might want to add later) and a failed one. The one that fails is there to demonstrate the assumptions that the method makes which may cause unexpected behavior. I think that rather than fixing the parsing for all possible edge cases, it'd be better, easier and more robust if the users avoid combinations of modules which cause them (see the test case for detail, in my opinion is very clear what is happening and why). The failing test is there just to grab your attention and talk about options. I am pretty sure before merging this test needs at least to be marked as skipped.
Besides that, not sure what you'd prefer to do, since this is a standalone file dropped into the tree, which at the moment has no connection with the rest of the framework. Perhaps if there's a branch were #1159 is being worked on, it may be better merged there?