In my workflow, I have two multithreaded programs that I am piping together. See the rule definition from my Snakemake file below.
rule do_the_thing:
input: 'input.dat'
output: 'output.dat'
threads: 16
shell: 'cmd1 --threads {threads} {input} | cmd2 --threads {threads} > {output}'
As written, the command will consume 32 threads. Is there a way I can perform arithmetic operations on the threads variable, so that (for instance) each command consumes only half of the available threads?