Hi,
One rule in my snakemake workflow (in which I run kraken2) has a large RAM requirement of ~50 GB. When running the workflow on many samples in parallel (e.g., snakemake --cores 12 -s workflow.smk), I get a bunch of errors because the system's RAM is exhausted.
As a result, I've tried limiting the amount of RAM used by snakemake by setting a maximum memory usage within the kraken2 rule:
    resources:
        mem_mb=55000
Intuitively, I thought that this would mean that snakemake would run each job at a time since running >1 job would exceed 55000 MB (=55 GB) of RAM usage. However, the workflow still fails by running out of RAM despite my system having 64 GB of RAM.
Next, I tried also setting a maximum amount of RAM on the command line using the --resources flag:
snakemake -j12 -s workflow.smk --resources mem_mb=55000
However, I get a traceback error:
Traceback (most recent call last):
  File "/home/cfos/.local/bin/snakemake", line 8, in <module>
    sys.exit(main())
  File "/home/cfos/.local/lib/python3.8/site-packages/snakemake/__init__.py", line 2400, in main
    resources = parse_resources(args.resources)
  File "/home/cfos/.local/lib/python3.8/site-packages/snakemake/resources.py", line 85, in parse_resources
    for res, val in resources_args.items():
AttributeError: 'list' object has no attribute 'items'
What am I doing wrong here? Any advice would be appreciated.
Which verision of snakemake are you using? Also, try to write a minimal, self-contained example that reproduces the issue and post it here if you cannot find a solution.
Good point. I'm using snakemake v6.5.1 installed via mamba. Minimal example:
test.smk:
Command:
snakemake -j1 -s test.smk --resources mem_mb=50000Output: