-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add new hook to filter invalid scales based on features set in the config file #111
Conversation
It's ready to be reviewed/tested, but not merged, since I didn't change all the other configs yet (they should all get a |
Ah, and we should also include it in the config for the CI (which is why it is now failing :)) |
ok, I updated the features for all configs, including for github-actions. Let's see if the CI passes now again. |
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.
just tested this for the gromacs test, and it seems to work nicely.
however, the way we are currently using valid_systems
is not very logical, and prone to mistakes, because we use []
both for the begin state (no filtering yet) and the end state (this test should not run).
i propose to change it as follows:
- we start out with setting
valid_systems
to['*']
in the class attribute of the test i.e. no filtering. - in the hooks whenever
valid_systems
is[]
we know the test should be filtered out (not run). - in the hooks, if
valid_systems
is[*]
and we want to filter, we replace it with[<filter>]
Yeah I actually thought about something like this as well, and then thought "What if someone is stupid enough to set this as system name?". But I agree, it's probably a better way to set it to a non-empty value. And note to self: I think the elegant way to do this is to set it to a constant that we define in |
i'm not sure i understand your point. what i meant is to change this line to
|
My point was mostly about your third point:
I.e. instead of setting it to empty
I.e. you want to actually change the 'default' I'm actually fine with both changes. I'll give a try to implementing it :) |
ok, now i understand. we could actually do both to avoid possible confusion :) |
… empty, explicitely set it equal to this constant. That way we know (and can test in other hooks) that it was explicitely filtered out as an invalid test by one of our hooks
@smoors how about this? I'm not sure changing the default really helps much, it just gives me one more thing to check on (which I now generalized in the internal helper function In any case, the correct set of tests gets generated for me. For the sake of testing, I excluded
I then get:
As you can see, the |
eessi/testsuite/hooks.py
Outdated
if len(test.valid_systems) == 0: | ||
test.valid_systems = [valid_systems] |
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.
valid_systems
is a required field, which means that it is always set, and we are now setting it to ['*']
in the class attribute. this means we can never have 0 items, and we can remove the first if
condition.
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 wasn't sure if it couldn't be set to []
on the command line, but it seems not (at least I wasn't able to do it). Nevertheless: while we now have [*]
as default valid systems by convention, this is something we set in the test class itself. If someone creates a test class with []
as default (which can easily happen), at least the current hook still works.
I guess it depends on how 'hard' we want to enforce ['*']
as default. If we really want to enforce that, having this hook fail could be one way to figure it out. But then the == 0
case would just have to lead to a hard error or something.
What do you think, do we want to be that strict? Or do you prefer to keep the current version, which would also make the []
default work?
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’m thinking of the case where someone sets it to []
somewhere outside the class attributes, meaning that the test should not run due to some condition. in that case we should respect that, and not override it or fail. so i think it should always be ['*']
in the class attributes, but we should not enforce it in this hook.
i don’t think it is a big problem if someone sets it accidentally to []
in the class attribute, because in that case no test will run, so it’s clear something is wrong with the test.
if we really want to enforce it, a solution could be to set it to ['*']
in a class that inherits from RegressionMixin
and make sure every test class inherits from both RunOnlyRegressionTest
and the custom RegressionMixin
child class, but of course then the question is how to enforce that, and maybe it makes things overly complex.
see here for an example: https://reframe-hpc.readthedocs.io/en/stable/tutorial_advanced.html#grouping-parameter-packs
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 don’t think it is a big problem if someone sets it accidentally to [] in the class attribute, because in that case no test will run, so it’s clear something is wrong with the test.
That's a good point actually
if we really want to enforce it, a solution could be to set it to ['*'] in a class that inherits from RegressionMixin and make sure every test class inherits from both RunOnlyRegressionTest and the custom RegressionMixin child class, but of course then the question is how to enforce that, and maybe it makes things overly complex.
see here for an example: https://reframe-hpc.readthedocs.io/en/stable/tutorial_advanced.html#grouping-parameter-packs
Yeah, I also thought maybe we should use Mixin classes more, after hearing e.g. Vasileios mention he also did that for his test library. I guess it might avoid more code duplication compared to the hooks and allows you to do default stuff like this. Enforcing it could be reasonably simple in the CI of the test suite by parsing the test file (it has to contain something like class classname(..., my_mixin_class)
. Well, not something I'm going to dive into now, but it might make things cleaner. If we want to move in that direction, we should do it before we have a million tests...
that's true, but my motivation for this change is to avoid future mistakes because it's not much more logical now. btw, i do like the addition of the helper function, as we have only 1 place to check for. |
Co-authored-by: Sam Moors <smoors@users.noreply.github.com>
Co-authored-by: Sam Moors <smoors@users.noreply.github.com>
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.
lgtm!
@casparvl Seems worthwhile to update the EESSI docs page on the test suite accordingly? |
Good point, done in EESSI/docs#156 |
This avoids issues on Snellius GPU, where partially allocating multiple nodes is not allowed by the Slurm configuration.