diff options
author | Andrew Morrow <andrew.morrow@viam.com> | 2024-01-09 18:06:37 (GMT) |
---|---|---|
committer | Andrew Morrow <andrew.morrow@viam.com> | 2024-01-19 18:46:37 (GMT) |
commit | 8d7067d2a43a708e68ade68546f4ffc940a780bf (patch) | |
tree | 5def1a73ccbcaf04ae44127a52e25950c4c7a3da /SCons/Taskmaster | |
parent | a64b1bfd9614413fee4c6584bb2b5feddca73534 (diff) | |
download | SCons-8d7067d2a43a708e68ade68546f4ffc940a780bf.zip SCons-8d7067d2a43a708e68ade68546f4ffc940a780bf.tar.gz SCons-8d7067d2a43a708e68ade68546f4ffc940a780bf.tar.bz2 |
wip
Diffstat (limited to 'SCons/Taskmaster')
-rw-r--r-- | SCons/Taskmaster/Job.py | 11 | ||||
-rw-r--r-- | SCons/Taskmaster/JobTests.py | 7 |
2 files changed, 11 insertions, 7 deletions
diff --git a/SCons/Taskmaster/Job.py b/SCons/Taskmaster/Job.py index 0bd4060..66387d6 100644 --- a/SCons/Taskmaster/Job.py +++ b/SCons/Taskmaster/Job.py @@ -74,7 +74,7 @@ class Jobs: def __init__(self, num, taskmaster) -> None: """ Create 'num' jobs using the given taskmaster. The exact implementation - used varies with the number of jobs requested and the state of the `tm_v2` flag + used varies with the number of jobs requested and the state of the `legacysched` flag to `--experimental`. """ @@ -88,13 +88,14 @@ class Jobs: stack_size = default_stack_size experimental_option = GetOption('experimental') or [] - if 'tm_v2' in experimental_option: - self.job = NewParallel(taskmaster, num, stack_size) - else: + if 'legacysched' in experimental_option: if num > 1: self.job = LegacyParallel(taskmaster, num, stack_size) else: self.job = Serial(taskmaster) + else: + self.job = NewParallel(taskmaster, num, stack_size) + self.num_jobs = num def run(self, postfunc=lambda: None) -> None: @@ -617,7 +618,7 @@ class NewParallel: results_queue, self.results_queue = self.results_queue, results_queue if self.trace: - self.trace_message("Found {len(results_queue)} completed tasks to process") + self.trace_message(f"Found {len(results_queue)} completed tasks to process") for (rtask, rresult) in results_queue: if rresult: rtask.executed() diff --git a/SCons/Taskmaster/JobTests.py b/SCons/Taskmaster/JobTests.py index b114d05..c457e78 100644 --- a/SCons/Taskmaster/JobTests.py +++ b/SCons/Taskmaster/JobTests.py @@ -525,14 +525,17 @@ class SerialTaskTest(_SConsTaskTest): """test serial jobs with actual Taskmaster and Task""" self._test_seq(1) + # Now run test with LegacyParallel + OptionsParser.values.experimental=['legacysched'] + self._test_seq(1) class ParallelTaskTest(_SConsTaskTest): def runTest(self) -> None: """test parallel jobs with actual Taskmaster and Task""" self._test_seq(num_jobs) - # Now run test with NewParallel() instead of LegacyParallel - OptionsParser.values.experimental=['tm_v2'] + # Now run test with LegacyParallel + OptionsParser.values.experimental=['legacysched'] self._test_seq(num_jobs) |