[英]Sbatch submission of snakemake jobs
I have a Snakefile that runs a python script which outputs many files in a directory.我有一个运行 python 脚本的 Snakefile,该脚本在目录中输出许多文件。 I wrote the following Snakefile script to execute this我写了下面的 Snakefile 脚本来执行这个
MODELS = ["A", "B", "C"]
SEEDS = [1, 2, 3]
rule all:
input:
expand("outputs/{model}/seed{seed}", model=MODELS, seed=SEEDS)
rule sub:
input:
{model}.py
output:
directory("outputs/{model}/seed{seed}")
run:
command = "python3 {} --seed {}".format(input, wildcards.seed)
shell(command)
Each python script files A.py
, B.py
, and C.py
executes for hours.每个 python 脚本文件A.py
、 B.py
和C.py
执行数小时。 I want to be able to use sbatch that submits job without waiting for it to finish executing.我希望能够使用提交作业的 sbatch 而无需等待它完成执行。
$ snakemake --cluster "sbatch --job-name=snakemake" --jobs 200 --latency-wait 1000
When I execute the following command, some files do not get run and Snakemake does not terminate.当我执行以下命令时,某些文件不会运行并且 Snakemake 不会终止。 I tried writing a bash script that contains the above snakemake command and executed sbatch script.sh
but that did not submit jobs in the Snakefile.我尝试编写一个 bash 脚本,其中包含上述蛇形命令并执行sbatch script.sh
但未在 Snakefile 中提交作业。
Is there a way to do this without snakemake waiting for sbatch jobs to finish executing?有没有办法做到这一点,而无需蛇形等待 sbatch 作业完成执行?
It would not be a perfect solution, but have you tried the --immediate-submit
flag?这不是一个完美的解决方案,但是您是否尝试过--immediate-submit
标志? It will just submit all jobs to slurm with no regard for dependencies and without waiting.它只会将所有作业提交给 slurm,而不考虑依赖关系,也无需等待。 Normally, you'd supply a wrapper for sbatch that would translate snakemake dependencies to SLURM dependencies, but for a simple workflow like this (ie only one rule run many times), you might get away without that.通常,您会为 sbatch 提供一个包装器,它将 snakemake 依赖项转换为 SLURM 依赖项,但是对于像这样的简单工作流程(即,只运行一个规则多次),您可能会在没有它的情况下侥幸逃脱。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.