Skip to content

Commit

Permalink
Merge branch 'async' of github.com:C2SM/processing-chain into async
Browse files Browse the repository at this point in the history
  • Loading branch information
mjaehn committed Feb 6, 2024
2 parents 09f43ac + e60303f commit 72608f1
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 72608f1

Please sign in to comment.