I would like to have Snakemake set binding memory limits for individual rules. Based on the snakemake documentation, mem_mb argument seems like it would work, but the job uses more memory than I've allocated.
Here's a simple rule that uses several GB of memory. I would like the rule to be stopped once it hits the memory limit, but it completes without issue.
rule:
output:
"a"
threads: 1
resources:
mem_mb = 100
shell:
"""
python3 -c 'import numpy; x=numpy.ones(1_000_000_000)'
touch a
"""
Is it possible to make this limit bind? I'd like a solution that's portable, working for Windows and Linux. I'm using snakemake locally, not with a batch scheduler or container setup.