Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restrict number of jobs by a rule in snakemake

Tags:

snakemake

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.

like image 390
Manavalan Gajapathy Avatar asked Aug 23 '18 02:08

Manavalan Gajapathy


1 Answers

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

like image 178
Jan Schreiber Avatar answered Oct 19 '22 06:10

Jan Schreiber