【发布时间】:2021-07-08 01:01:00
【问题描述】:
我尝试强制 Snakemake 按顺序运行规则(包含许多作业)以避免内存冲突。
rule run_eval_all:
input:
expand("config["out_model"] + "{iLogit}.rds", iLogit = MODELS)
rule eval_model:
input:
script = config["src_est"] + "evals/script.R",
model = config["out_model"] + "{iLogit}.rds",
output:
"out/{iLogit}.rds"
threads: 5
resources:
mem_mb = 100000
shell:
"{runR} {input.script} "
"--out {output}"
我通过snakemake --cores all --resources mem_mb=100000 run_eval_all 运行规则。但我不断收到如下错误:
x86_64-conda-linux-gnu % snakemake --resources mem_mb=100000 run_eval_all
Traceback (most recent call last):
File "/local/home/zhakaida/mambaforge/envs/r_snake/bin/snakemake", line 10, in <module>
sys.exit(main())
File "/local/home/zhakaida/mambaforge/envs/r_snake/lib/python3.9/site-packages/snakemake/__init__.py", line 2401, in main
resources = parse_resources(args.resources)
File "/local/home/zhakaida/mambaforge/envs/r_snake/lib/python3.9/site-packages/snakemake/resources.py", line 85, in parse_resources
for res, val in resources_args.items():
AttributeError: 'list' object has no attribute 'items'
如果我运行snakemake --cores all run_eval_all,它可以工作,但作业并行运行(如预期的那样),有时会导致内存过度使用和崩溃。我该如何正确地为 Snakemake 申请内存?
【问题讨论】:
标签: snakemake