Skip to content

Commit

Permalink
Add --wait again for seq. jobs in nested run_chain
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaehn committed Feb 6, 2024
1 parent bf135c5 commit e60303f
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,18 @@ def get_dep_ids(self, job_name, add_dep=None):

def get_dep_cmd(self, job_name, add_dep=None):
"""Generate the part of the sbatch command that sepcifies dependencies for `job_name`"""
# Default: async case
if dep_ids := self.get_dep_ids(job_name, add_dep=add_dep):
dep_str = ':'.join(map(str, dep_ids))
return f'--dependency=afterok:{dep_str}'
if not self.force_sync:
# Default: async case
if dep_ids := self.get_dep_ids(job_name, add_dep=add_dep):
dep_str = ':'.join(map(str, dep_ids))
return f'--dependency=afterok:{dep_str}'
else:
# job_name has no dependencies but still belongs to an async workflow
# so don't use --wait
return None
else:
# job_name has no dependencies but still belongs to an async workflow
# so don't use --wait
return None
# Needed for nested run_chain.py
return '--wait'

def submit(self, job_name, script, add_dep=None):
"""Submit job with dependencies"""
Expand Down

0 comments on commit e60303f

Please sign in to comment.