简体   繁体   English

批量提交snakemake作业

[英]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.pyB.pyC.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.

相关问题 Snakemake 重建/重新安排工作 - Snakemake rebuild/reschedule of jobs 是否可以使用 SRUN 而不是 SBATCH 在后台运行 SLURM 作业? - Is it possible to run SLURM jobs in the background using SRUN instead of SBATCH? 如何使用 sbatch 作业循环遍历文本文件 - How to loop through a text file using sbatch jobs 如何使用 Slurm/Sbatch 提交/运行多个并行作业? - How to submit/run multiple parallel jobs with Slurm/Sbatch? snakemake - 从集群提交包装器访问配置变量 - snakemake - accessing config variables from cluster submission wrapper 如何确保slurm中的python提交脚本位于发出sbatch命令的位置? - How does one make sure that the python submission script in slurm is in the location from where the sbatch command was given? 如何立即将所有 Snakemake 作业提交到 slurm 集群 - How to immediately submit all Snakemake jobs to slurm cluster 基于汇总标准针对所有正在运行的作业的Python多处理作业提交 - Python multiprocessing job submission based on aggregate criteria for all jobs running 当不是所有作业都成功 output 文件时,我如何编写一个蛇形输入? - How do I write a snakemake input when not all jobs successfully output files from previous rule? Snakemake:MissingInputException - Snakemake: MissingInputException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM