-
Notifications
You must be signed in to change notification settings - Fork 203
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
take into account maxparallel for individual extensions #3811
base: develop
Are you sure you want to change the base?
Conversation
…nto account for individual extensions Co-authored-by: Alexander Grund <Flamefire@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.
Might also want to remove the min
from det_parallelism
(systemtools.py) which is likely where the issue I mentioned earlier came from.
BTW: As an alternative: Why not call |
Done (with other changes) in #3812 |
@Flamefire Just calling I don't think it's worth the refactoring at all, the current approach is cleaner imho. At first sight we're duplicating code, but the |
This is not exactly true. If you call the EasyBlock.set_parallel with the extension as the I was just thinking that it might not be a good idea to rely on It is unfortunate that EasyBlock and Extension don't have a common base where we could put |
First of all, that would be very hacky to say the least, you should call a method of class Also, how exactly would you do that? To call The other option would be to create a separate function Your point about a top-level |
And does ext1(maxparallel=2) followed by ext2(maxparallel=3) end up doing the right thing when top-level parallel=5? |
See above:
That's what I meant above: "Or factoring it out to a function which takes a cfg and log and call that, if that looks to hacky" In the end I wouldn't even fiddle with it, just take the |
@Flamefire OK, I stand corrected, it does work (see below), but I flat out refuse to leverage the
OK, I'll look into that.
@akesandgren Yes, that does work as expected, every extension inherits the |
…rk into ext_maxparallel
… 'parallel' easyconfig parameter for easyblock and extensions
@@ -138,6 +138,12 @@ def __init__(self, mself, ext, extra_params=None): | |||
self.log.debug("Skipping unknown custom easyconfig parameter '%s' for extension %s/%s: %s", | |||
key, name, version, value) | |||
|
|||
self.cfg['parallel'] = self.master.orig_parallel | |||
par = get_parallel_ec_param_value(self.cfg, self.log) | |||
self.log.info("Setting parallelism: %s", par) |
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.
Redundant log.info line
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.
Actually both are redundant as get_parallel_ec_param_value
does the logging and the log already has the context of the extension (a bit above though, but still)
Edit: Ah no, that does only debug logging...
write_file(test_ec, test_ec_txt) | ||
ec = process_easyconfig(test_ec)[0] | ||
eb = get_easyblock_instance(ec) | ||
|
||
# require to trigger setting of 'parallel' value |
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.
"required"
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.
If you move that setting of orig-parallel to the ctor this is not really required anymore, unless you add a top-level maxparallel
and test the mentioned case of an extension having a higher value for it and it should still work.
E.g. instead of the EC parallel
(why do we have that anyway? Isn't that basically the same as maxparallel
?) use a maxparallel
of 2 and a build option parallel of 5, then barbar should still yield in a parallel value of 3
@@ -212,6 +213,8 @@ def __init__(self, ec): | |||
self.postmsg = '' # allow a post message to be set, which can be shown as last output | |||
self.current_step = None | |||
|
|||
self.orig_parallel = None |
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.
Why not set this to the correct value here already?
self.log.debug("Desired parallelism: minimum of 'parallel' build option/easyconfig parameter: %s", par) | ||
# keep track of original value for 'parallel', so it can be restored before determining level | ||
# of parallelism that can be used for extensions | ||
self.orig_parallel = self.cfg['parallel'] |
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.
Move to ctor?
@@ -1025,10 +1025,16 @@ def test_init_extensions(self): | |||
|
|||
test_ec = os.path.join(self.test_prefix, 'test.eb') | |||
test_ec_txt = toy_ec_txt.replace("('barbar', '0.0', {", "('barbar', '0.0', {'easyblock': 'DummyExtension',") | |||
test_ec_txt = test_ec_txt.replace("('barbar', '0.0', {", "('barbar', '0.0', {'maxparallel': 3,") |
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.
Isn't this changing the same as the line above? Maybe combine both into one? This looks like a C&P mistake
One thing I didn't take into account here: just setting So, this needs a bit more love, it'll have to wait until after the EasyBuild v4.4.2 release, this is by no means a blocker... |
If we have to do a bit more anyway: Why not deprecate the EC "parallel" param? It is confusing.
This would also catch cases where we access |
See #3842 for a change which implements my above described approach. |
Conflicts here |
No description provided.