take into account maxparallel for individual extensions#3811
take into account maxparallel for individual extensions#3811boegel wants to merge 5 commits intoeasybuilders:developfrom
Conversation
…nto account for individual extensions Co-authored-by: Alexander Grund <Flamefire@users.noreply.github.com>
Flamefire
left a comment
There was a problem hiding this comment.
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
|
|
||
| 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.
Redundant log.info line
There was a problem hiding this comment.
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...
| 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.
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
| 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.
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'] |
|
|
||
| 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.
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.