allow setting parallel to 0 or False to disable adding the -j argument#2842
allow setting parallel to 0 or False to disable adding the -j argument#2842boegel merged 3 commits intoeasybuilders:developfrom
Conversation
|
@migueldiascosta We should cover the use case of using |
| # make sure 'parallel = False' is not overriden | ||
| test_eb = EasyBlock(EasyConfig(toy_ec3)) | ||
| test_eb.check_readiness_step() | ||
| self.assertEqual(test_eb.cfg['parallel'], False) |
There was a problem hiding this comment.
@migueldiascosta Looks good, but you should also do the same test in the context where --parallel is not used (i.e. copy-paste this stuff above line 1372 where --parallel 97 is put in place, to ensure parallel = False works as expected in both contexts.
Side-note: this test only passes because 0 == False evaluates to True in Python...
When --parallel is also specified, the current codes takes the minimum of that value (97 in the test) and the int values of the parallel easyconfig parameter; with int(False) returning 0, you get min(97, 0) or just 0.
That's not necessarily a problem though, but maybe we should check for 0 explicitly here instead?
We should keep checking against False in the context where --parallel is not set though...
|
Going in, thanks for the fix @migueldiascosta! |
motivation:
ConfigureMake,MakeCp, etc. easyblocks allow settingbuild_cmdto something other thanmake, but without this change-j PARALLELis always added anywaythis change is enough because
self.cfg['parallel']is tested again in theconfiguremakebuild step, before adding-j