Skip to content

Commit 7c38dc1

Browse files
authored
Merge pull request #386 from Matistjati/only-compile-used-submissions
Only do multithread compilation of submissions actually used by -s
2 parents 5316f11 + 77128aa commit 7c38dc1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

problemtools/verifyproblem.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1854,9 +1854,12 @@ def start_background_work(self, context: Context) -> None:
18541854
# Send off an early background compile job for each submission and
18551855
# validator, to avoid a bottleneck step at the start of each test run.
18561856
self.problem.output_validators.start_background_work(context)
1857-
for acr in self._submissions:
1857+
for verdict in Submissions._VERDICTS:
1858+
acr = verdict[0]
18581859
for sub in self._submissions[acr]:
1859-
context.submit_background_work(lambda s: s.compile(), sub)
1860+
sub_name = sub.name # type: ignore
1861+
if context.submission_filter.search(os.path.join(verdict[1], sub_name)):
1862+
context.submit_background_work(lambda s: s.compile(), sub)
18601863

18611864
def _compute_time_limit(self, fixed_limit: float | None, lower_bound_runtime: float | None) -> tuple[float, float]:
18621865
if fixed_limit is None and lower_bound_runtime is None:

0 commit comments

Comments
 (0)