Skip to content

Commit

Permalink
fix: more robust calculation of number of jobs until ready for execut…
Browse files Browse the repository at this point in the history
…ion (#1691)

* fix: more robust calculation of number of jobs until ready for execution

* cleanup
  • Loading branch information
johanneskoester committed May 31, 2022
1 parent 41175b3 commit fdfc717
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions snakemake/dag.py
Expand Up @@ -1179,17 +1179,18 @@ def update_needrun(job):
for job_, files in depending[job].items():
if job_ in candidates_set:
if job_ not in visited:
# TODO may it happen that order determines whether
# _n_until_ready is incremented for this job?
if all(f.is_ancient and f.exists for f in files):
# No other reason to run job_.
# Since all files are ancient, we do not trigger it.
continue
visited.add(job_)
queue.append(job_)
_n_until_ready[job_] += 1
reason(job_).updated_input_run.update(files)

# update _n_until_ready
for job in _needrun:
_n_until_ready[job] = sum(1 for dep in dependencies[job] if dep in _needrun)

# update len including finished jobs (because they have already increased the job counter)
self._len = len(self._finished | self._needrun)

Expand Down

0 comments on commit fdfc717

Please sign in to comment.