title: Snakemake memory limiting
body: <p>In <em>Snakemake</em>, I have 5 rules. For each I set the memory limit by <code>resources mem_mb</code> option.
  It looks like this:</p>
  <pre><code>rule assembly:
       input:
           file1 = os.path.join(MAIN_DIR, &quot;1.txt&quot;), \
           file2 = os.path.join(MAIN_DIR, &quot;2.txt&quot;), \
           file3 = os.path.join(MAIN_DIR, &quot;3.txt&quot;)
       output:
           foldr = dir, \
           file4 = os.path.join(dir, &quot;A.png&quot;), \
           file5 = os.path.join(dir, &quot;A.tsv&quot;)
       resources:
           mem_mb=100000
       shell:
           &quot; pythonscript.py -i {input.file1} -v {input.file2} -q {input.file3} --cores 5 -o {output.foldr}  &quot;
  </code></pre>
  <p>I want to limit the memory usage of the whole <code>Snakefile</code> by doing something like:</p>
  <pre><code>snakamake --snakefile mysnakefile_snakefile --resources mem_mb=100000
  </code></pre>
  <p>So not all jobs would use <code>100GB</code> each ( if I have 5 rules, meaning as <code>500GB</code> memory allocation), but all of their executions will be maximum <code>100GB</code> ( 5 jobs, total of <code>100 GB</code> allocation?)</p>