From 865cf0f22656e22cd2450e5537421ce70c1705f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20K=C3=B6ster?= Date: Sat, 26 Feb 2022 23:45:01 +0100 Subject: [PATCH] fix: provide proper error when using immediate submit in combination with checkpoint jobs. (#1437) * fix: provide proper error when using immediate submit in combination with checkpoint jobs. * help text --- snakemake/__init__.py | 3 ++- snakemake/workflow.py | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/snakemake/__init__.py b/snakemake/__init__.py index 0a6106a98..dd1ebc6af 100644 --- a/snakemake/__init__.py +++ b/snakemake/__init__.py @@ -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", diff --git a/snakemake/workflow.py b/snakemake/workflow.py index 250dfedbe..12de6fd2d 100644 --- a/snakemake/workflow.py +++ b/snakemake/workflow.py @@ -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: