Snakemake-Profiles / lsf

Snakemake profile for running jobs on an LSF cluster
MIT License
36 stars 22 forks source link

Unable to set queue per rule #27

Closed amakunin closed 4 years ago

amakunin commented 4 years ago

Hi!

I was trying to set queue for a rule by adding

    cluster: 
        queue='long'

but snakemake (5.22.1) gave me a SyntaxError Unexpected keyword cluster in rule definition (test.smk, line 4)

I also tried editing lsf.yaml file by adding test: '-q long', but the job was submitted to the default queue.

As I understand, the problem is with this piece of code https://github.com/Snakemake-Profiles/snakemake-lsf/blob/2e6f23cbea58bb07bde5eff873be6bc87f2a4018/%7B%7Bcookiecutter.profile_name%7D%7D/lsf_submit.py#L63-L64

And I was able to hack it by replacing cluster with params in lsf-submit.py and adding this to the rule:

    params: 
        queue='long'

Then the job was submitted to the long queue as expected.

amakunin commented 4 years ago

Update: the above applies to an old version of snakemake-lsf. In a new version, I was able to use lsf.yaml to switch the queue:

__default__:
  - '-q normal'

test:
  - '-q long'

Is this how I should switch the queues going forward?

mbhall88 commented 4 years ago

Is this how I should switch the queues going forward?

Correct. As the cluster config has been deprecated in snakemake, cluster-specific solutions, like this one for LSF, are the only way to alter cluster behaviour.

Feel free to reopen if your issue isn't fixed.