-
Notifications
You must be signed in to change notification settings - Fork 117
[feat] Add utility function to look for available environment modules #1417
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
|
@jenkins-cscs retry dom |
Co-authored-by: Vasileios Karakasis <vkarak@gmail.com>
Co-authored-by: Vasileios Karakasis <vkarak@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1417 +/- ##
==========================================
- Coverage 91.73% 91.57% -0.17%
==========================================
Files 83 83
Lines 12886 12993 +107
==========================================
+ Hits 11821 11898 +77
- Misses 1065 1095 +30
Continue to review full report at Codecov.
|
|
Hello @victorusu, Thank you for updating! Cheers! There are no PEP8 issues in this Pull Request!Do see the ReFrame Coding Style Guide Comment last updated at 2020-09-22 19:26:46 UTC |
|
This PR should do pretty much what we have been discussing in #1159. Could you test it? |
|
I'll have to put this on the pile. I haven't had time to touch our Reframe tests in months... |
|
@jenkins-cscs retry all |
|
I've been very busy with other stuff too, but trying various aspects of ReFrame in NCAR's environment is at the top of my todo list, just after a couple of other things which are due by the end of the month. So I should get to it in early October, and perhaps sooner. |
|
@mboisson @davidedelvento I don't want to rush you, I just wanted to put that in your radar and test it whenever you have time. My plan is to merge this in the next weeks and ship it with ReFrame 3.2, but you can test it afterwards and we enhance it further. |
|
@jenkins-cscs retry all |
Also: - Improve argument names. - Improve type checking of the `environ_mapping` argument.
|
|
|
@jenkins-cscs retry all |
This PR extends the environment modules interface to include themodule availcommand.This is the first step to allow the detection of modules to be included in the tests.This PR adds the
find_modules()utility function, which will retrieve all the available modules given a substring of a module name. Internally, it delegates tomodule avail substrof the current system's modules system, but it does so per system partition and respecting the ReFrame environments defined for each partition. It returns an iterator over a "set" of tuples of(partition, environment, module). This works nicely with hierarchical modules, but it can also work fine with flat modules scheme. In this case, you can pass a dictionary to theenviron_mappingargument, which maps module names to ReFrame environments. This way,find_module()will skip any combinations of(partition, environment, module)that are not meaningful. You can use the return value of this function in parameterized tests as follows, in order to generate automatically tests for different modules. Here is an example:For flat schemes you can use it as follows:
Fixes #1159.
Still todo:
toolchain_mappingargumentFuture work:
find_modules()can be somewhat slow since it callsmodule availfor each partition/environment combination. We could in the future implement a caching mechanism on top of it.