Skip to content

Commit f73b3cf

Browse files
committed
Stop checking for unneeded temp files from groups
Files produced by jobs in the middle of a group job that are neither endpoints nor needed by any other jobs in the dag are no longer subject to an existance check
1 parent ac83023 commit f73b3cf

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

snakemake/dag.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,12 @@ def check_and_touch_output(
579579
if job.benchmark:
580580
expanded_output.append(job.benchmark)
581581

582+
if isinstance(ignore_missing_output, list):
583+
expanded_output = [
584+
f for f in expanded_output if f not in ignore_missing_output
585+
]
586+
ignore_missing_output = []
587+
582588
if not ignore_missing_output:
583589
try:
584590
wait_for_files(

snakemake/jobs.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,6 +1461,21 @@ def cleanup(self):
14611461
job.cleanup()
14621462

14631463
def postprocess(self, error=False, **kwargs):
1464+
def needed(job_, f):
1465+
return any(
1466+
f in files
1467+
for j, files in self.dag.depending[job_].items()
1468+
if (
1469+
not self.dag.finished(j)
1470+
and self.dag.needrun(j)
1471+
and j not in self.jobs
1472+
)
1473+
) or f in self.dag.targetfiles
1474+
1475+
kwargs["ignore_missing_output"] = [
1476+
f for j in self.jobs for f in j.output
1477+
if is_flagged(f, "temp") and not needed(j, f)
1478+
]
14641479
# Iterate over jobs in toposorted order (see self.__iter__) to
14651480
# ensure that outputs are touched in correct order.
14661481
for level in self.toposorted:

0 commit comments

Comments
 (0)