Is it possible to restrict number of jobs to run by a particular rule in snakemake? --jobs
controls globably how many jobs are allowed to run at a time, but I would like to restrict by a specific rule.
This is because, I have a particular rule that can be used at most for two jobs in parallel. However, if I set --jobs
to 20, this results in tool in that particular rule crashing. I use snakemake v5.2.0 in LSF cluster.
You could probably use resources.
Define them in a rule
rule only_two:
...
resources:
load=50
...
and then run snakemake
with a certain resource limit.
snakemake --resources load=100
It should only run two instances of rule only_two
.
All other rules might have a load
value of 1 or less and you could run 100 or more of them simultaneously.
https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#resources
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With