Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from May 31, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 4 additions & 3 deletions snakemake/dag.py
Expand Up @@ -1173,17 +1173,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