Default memory request with possibility of override in a Snakefile?

天涯浪子 提交于 2019-12-10 18:31:44

问题


I have a Snakefile with several rules and only a few need more than 1 GB/core to run on a cluster. The resources directive is great for this, but I can't find a way of setting a default value. I would prefer not having to write resources: mem_per_cpu = 1024 for every rule that doesn't need more than the default.

I realize that I could get what I want using __default__ in a cluster config file and overriding the mem_per_cpu value for specific rules. I hesitate to do this because the memory requirements are platform-independent, so I would prefer including them in the Snakefile itself. It would also prevent me from being able to specify local resource limits using the --resources command-line option.

Is there a simple solution with Snakemake that would help me here? Thanks!


回答1:


I was reading the changelog of the Snakemake and I came across this:

Add –default-resources flag, that allows to define default resources for jobs (e.g. mem_mb, disk_mb), see docs.



来源:https://stackoverflow.com/questions/45111823/default-memory-request-with-possibility-of-override-in-a-snakefile

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