Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.11"
dependencies = [
"snakemake-interface-common>=1.17.4",
"snakemake-interface-common>=1.19.0",
"throttler>=1.2.2",
"argparse-dataclass>=2.0.0",
]
Expand Down
56 changes: 30 additions & 26 deletions snakemake_interface_executor_plugins/executors/real.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from abc import abstractmethod
from typing import Dict

from snakemake_interface_common import at_least_snakemake_version
from snakemake_interface_executor_plugins.executors.base import (
AbstractExecutor,
SubmittedJobInfo,
Expand Down Expand Up @@ -79,32 +81,34 @@ def additional_general_args(self):

def get_job_args(self, job: JobExecutorInterface, **kwargs):
unneeded_temp_files = list(self.workflow.dag.get_unneeded_temp_files(job))
return join_cli_args(
[
format_cli_arg(
"--target-jobs", encode_target_jobs_cli_args(job.get_target_spec())
),
# Restrict considered rules for faster DAG computation.
# This does not work for updated jobs because they need
# to be updated in the spawned process as well.
format_cli_arg(
"--allowed-rules",
job.rules,
quote=False,
skip=job.is_updated,
),
# Ensure that a group uses its proper local groupid.
format_cli_arg("--local-groupid", job.jobid, skip=not job.is_group()),
format_cli_arg("--cores", kwargs.get("cores", self.cores)),
format_cli_arg("--attempt", job.attempt),
format_cli_arg("--force-use-threads", not job.is_group()),
format_cli_arg(
"--unneeded-temp-files",
unneeded_temp_files,
skip=not unneeded_temp_files,
),
]
)
arg_list = [
format_cli_arg(
"--target-jobs", encode_target_jobs_cli_args(job.get_target_spec())
),
# Restrict considered rules for faster DAG computation.
format_cli_arg(
"--allowed-rules",
job.rules,
quote=False,
# Via this fix: https://github.com/snakemake/snakemake/pull/3640
# --allowed-rules can be always used. The fix is released in
# snakemake 9.6.2. Before, --allowed-rules had to be skipped
# for jobs that have been updated after checkpoint evaluation.
skip=job.is_updated and not at_least_snakemake_version("9.6.2"),
),
# Ensure that a group uses its proper local groupid.
format_cli_arg("--local-groupid", job.jobid, skip=not job.is_group()),
format_cli_arg("--cores", kwargs.get("cores", self.cores)),
format_cli_arg("--attempt", job.attempt),
format_cli_arg("--force-use-threads", not job.is_group()),
format_cli_arg(
"--unneeded-temp-files",
unneeded_temp_files,
skip=not unneeded_temp_files,
),
]

return join_cli_args(arg_list)

@property
def job_specific_local_groupid(self):
Expand Down