Skip to content
Snippets Groups Projects
Commit f722be81 authored by Christopher Spinrath's avatar Christopher Spinrath
Browse files

Do not repeat experiments if they time out

parent f36c1ed7
No related branches found
No related tags found
No related merge requests found
......@@ -110,11 +110,15 @@ class Task:
cwd = self._work_dir,
timeout = 3600, # FIXME
)
return False
except subprocess.TimeoutExpired:
print()
print("Task timed out!")
print()
return True
@classmethod
def from_dict(cls, data):
name = data.get("name", "Unnamed Task")
......@@ -194,10 +198,16 @@ def main(config_file):
for rep in range(c.repetitions):
print(f"Repetition {rep}")
timed_out = False
for task in c.tasks:
print(f"Running task {task.name}")
task.run(variables)
timed_out = task.run(variables)
print()
if timed_out: # repetitions are useless if tasks time out
break
if __name__ == "__main__":
main()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment