I am using the latest versions of snakemake (8.25) and am trying to use the executor plugin (0.11.1) for slurm for my pipeline.
However, when I use the command-line to run snakemake with the slurm executor all rules are considered SLURM-rules. That is to say, neither localrules: a, b, c nor the per-rule localrule: True directive have any effect. After some digging I found that this only occurs if the group directive is used on the respective rules. I.e. if I remove the grouping then everything runs fine and localrules are recognized properly.
Minimal Snakefile if you want to try it
The rule a belongs to group local
DIRECTORY = "test"
rule all_a:
input:
[f"{DIRECTORY}/test_file-a-{i}.txt" for i in range(10)],
localrule: True
rule a:
input:
directory(DIRECTORY)
output:
DIRECTORY + "/test_file-a-{i}.txt"
localrule: True
group:
"local"
shell:
"touch {output[0]}"
Running all_a reveals that both all_a as well as a are considered normal rules rather than localrules
indicating that now the rules are indeed localrules.
PS: as you can probably see from the copy/paste output, the actual commands used also specified some resources and partitions which is actually how I found the bug in the first place as I was trying to run simple CPU stuff on a GPU partition since SLURM is only supposed to be used by gpu-using rules in my pipeline...
I am using the latest versions of snakemake (8.25) and am trying to use the executor plugin (0.11.1) for slurm for my pipeline. However, when I use the command-line to run snakemake with the slurm executor all rules are considered SLURM-rules. That is to say, neither
localrules: a, b, c
nor the per-rulelocalrule: True
directive have any effect. After some digging I found that this only occurs if thegroup
directive is used on the respective rules. I.e. if I remove the grouping then everything runs fine and localrules are recognized properly.Minimal Snakefile if you want to try it
The rule
a
belongs to grouplocal
Running
all_a
reveals that bothall_a
as well asa
are considered normalrule
s rather thanlocalrule
son the other hand if we remove the
group
clearative and run the same command in the terminal we get:indicating that now the rules are indeed
localrule
s.PS: as you can probably see from the copy/paste output, the actual commands used also specified some resources and partitions which is actually how I found the bug in the first place as I was trying to run simple CPU stuff on a GPU partition since SLURM is only supposed to be used by gpu-using rules in my pipeline...
Thanks a lot already,
Cheers, Noah :sunny: