-
Notifications
You must be signed in to change notification settings - Fork 204
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
Deprecate use of parallel
easyconfig parameter and fix updating the template value
#4580
base: 5.0.x
Are you sure you want to change the base?
Conversation
f714fb3
to
8a76544
Compare
ec['parallel']
and fix updating the template value
8a76544
to
81a2649
Compare
9e11b40
to
1554bd4
Compare
ec['parallel']
and fix updating the template valueparallel
easyconfig parameter and fix updating the template value
ec['parallel'] currently doubles as an EC option and as the storage for the calculated parallelism set by the EasyBlock. This makes it hard to reason about especially as maxparallel has pretty much the same effect. Also changes to ec['parallel'] done by e.g. easyblocks (or the set_parallel method) are not reflected by the template `%(parallel)s` Solution: Introduce a property which on write updates the template and some magic to mirror the effect of the now deprecated ec['parallel']
Migrate from `self.cfg['parallel']` to `self.cfg.parallel`
We need to fix our own easyblocks first but that requires this change. So allow until 5.1 or remove after updating the easyblocks.
The EC parameter is deprecated so the tests fail.
748a503
to
162621f
Compare
After this is merged some easyblocks need to be updated accordingly
|
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. I would like to test this with updated easyblocks ready all at once, then I would merge it.
I looked into updating the easyblocks. I see one instance of:
And many like
So we do have a distinction between
So some changes would need to be adjusted and others tested. And I think I got things backward. What I now think was the evolution of those 2 parameters:
This is currently still supported by setting How do we want to proceed?
In both cases I'd deprecate setting Of course combining My suggestion is hence:
With this we should not have any behavior change in almost all cases. One is of course the "fix" of the template. |
So the corsika example I think we should just solve some other way; it's just abusing ConfigureMake (it's not a "make" at all), while it really just wants to do it's own custom thing. I did a (admittedly quickly) skim the easyblocks during our meeting, and I didn't think it looked to be a problem with the new approach? apart from the trivial cases, e.g. install_options.append(f'NUM_THREADS={self.cfg.parallel}') others, if they truly do need to skip the flag when it's not parallel (I suspect many of them actually just work with paracmd = ''
if self.cfg.parallel > 1:
paracmd = "-j %s" % self.cfg.parallel |
It does need a definition of how to handle I'm not so sure about dismissing the corsika example as it is actually close enough to regular Question would be how many ECs previously using |
Yes, we should probably make sure those cases don't turn into We discussed this in the EB 5.0 sync meeting today, evaluating a few different options, pros and cons and their affect on things that "abuse" ConfigureMake with custom build_cmd's (which are no longer The path of least pain was deemed to be that In the future I hope to move some of those easyconfigs over to using the generic easyblock (#4531) so that |
I added commits to change Edit: I'd keep the behavior as I had implemented it:
This way should be fully backwards compatible except that everything going through the property updates the template value which it did not before. Logically the new |
When copying an EC we need to copy the parallel property too. When instantiating an extension we need to check the `max_parallel` again in case it was set in the extension options.
This PR lead me to discovering a bug in how parallelism of extensions is handled:
My solution: When instantiating extensions ensure the current parallel property is also copied (as before). Then apply -> Lot's of unanticipated work but a couple of hidden bugs discovered and fixed by this PR |
Move `set_parallel` to `post_init` which matches better than the `ready_step`. That is described: > creating build dir, resetting environment > Verify if all is ok to start build. None of that matches the behavior of a `set_parallel` call as opposed to > Run post-initialization tasks. When handling potentially additional limitations in extensions we need to check if we have `parallel` set already before applying it. This should only be the case for tests which take shortcuts in the logic such as skipping `post_init`.
3dcb0af
to
d79ffe0
Compare
Rebase of #3842 to 5.0x
ec['parallel'] currently doubles as an EC option and as the storage for the calculated parallelism set by the EasyBlock.
This makes it hard to reason about especially as maxparallel has pretty much the same effect. Also changes to ec['parallel'] done by e.g. easyblocks (or the set_parallel method) are not reflected by the template
%(parallel)s
Solution: Introduce a property which on write updates the template and some magic to mirror the effect of the now deprecated ec['parallel']
Additional change I'd like to do: Treat
parallel = False
(legacy) asmaxparallel =1
socfg.parallel
is always a numberSee #3811 (comment) for the motivation
Requires easybuilders/easybuild-easyconfigs#19375 to avoid deprecation warnings
Compared to #3842 I had to move the deprecation to 5.1 as easyblocks need updating but that requires this PR. So either we keep 5.1 as the target or merge this, update the easyblocks, then remove the deprecation (and fail hard) for 5.0
Testing this is possibly by using an EB5 venv and installing this branch with
pip install --force-reinstall https://github.com/Flamefire/easybuild-framework/archive/deprecate_parallel-5.tar.gz