Skip to content

Commit

Permalink
fix: provide proper error when using immediate submit in combination …
Browse files Browse the repository at this point in the history
…with checkpoint jobs. (#1437)

* fix: provide proper error when using immediate submit in combination with checkpoint jobs.

* help text
  • Loading branch information
johanneskoester committed Feb 26, 2022
1 parent 6b9f5da commit 865cf0f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion snakemake/__init__.py
Expand Up @@ -2120,7 +2120,8 @@ def get_argument_parser(profile=None):
"$ snakemake --cluster 'sbatch --dependency {dependencies}.\n"
"Assuming that your submit script (here sbatch) outputs the "
"generated job id to the first stdout line, {dependencies} will "
"be filled with space separated job ids this job depends on.",
"be filled with space separated job ids this job depends on. "
"Does not work for workflows that contain checkpoint rules.",
)
group_cluster.add_argument(
"--jobscript",
Expand Down
8 changes: 8 additions & 0 deletions snakemake/workflow.py
Expand Up @@ -873,6 +873,14 @@ def files(items):
)
return False

if immediate_submit and any(dag.checkpoint_jobs):
logger.error(
"Immediate submit mode (--immediate-submit) may not be used for workflows "
"with checkpoint jobs, as the dependencies cannot be determined before "
"execution in such cases."
)
return False

updated_files.extend(f for job in dag.needrun_jobs for f in job.output)

if generate_unit_tests:
Expand Down

0 comments on commit 865cf0f

Please sign in to comment.