Output log file to cluster option

ぐ巨炮叔叔 提交于 2019-12-13 03:00:53

问题


I'm submitting jobs to slurm/sbatch via snakemake. I'm trying to send the log from sbatch to a file in the same directory tree of the rule's output.

For example, this works:

rm -rf foo
snakemake -s test.smk --jobs 1 --cluster "sbatch --output log.txt"

but it fails (i.e. slurm job status is FAILED) if I try:

rm -rf foo
snakemake -s test.smk --jobs 1 --cluster "sbatch --output {output}.log"

presumably, because {output} points to foo/bar/ which does not exist. But snakemake should have created it, right?

This is test.smk:

rule all:
    output:
        'foo/bar/done.txt'
    shell:
        """
        touch {output}
        """

So, how can I send logs to a directory tree not yet existing but created by the rule? (I'm reluctant in including code in the snakefile that create dirs in anticipation).

snakemake -v
4.8.0

来源:https://stackoverflow.com/questions/50042226/output-log-file-to-cluster-option

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!