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

skip _sis_runnable check when already finished #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions sisyphus/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import sys
import time
import traceback
from typing import List, Iterator, Type, TypeVar
from typing import List, Iterator, Type, TypeVar, Optional

from sisyphus import block, tools
from sisyphus.task import Task
Expand Down Expand Up @@ -472,7 +472,7 @@ def _sis_finished(self):
self._sis_is_finished = True
return True
else:
if self._sis_setup() and self._sis_runnable():
if self._sis_setup() and self._sis_runnable(return_when_finished=None):
# check all task if they are finished
for task in self._sis_tasks():
# job is only finished if all sub tasks are finished
Expand Down Expand Up @@ -684,8 +684,15 @@ def _sis_all_path_available(self):
return False
return True

def _sis_runnable(self):
def _sis_runnable(self, *, return_when_finished: Optional[bool] = True):
"""True if all inputs are available, also checks if new inputs are requested"""
if return_when_finished is not None:
albertz marked this conversation as resolved.
Show resolved Hide resolved
# Avoid _sis_finished call due to potential recursive calls.
if not self._sis_is_finished and job_finished(self._sis_path()):
# Job is already marked as finished, skip check next time
self._sis_is_finished = True
if self._sis_is_finished:
return return_when_finished

if not self._sis_update_possible():
# Short cut used for most jobs
Expand Down