Skip to content

Failure to parse workflow config when setting slurm_extra based on attempt #208

Open
@blaiseli

Description

@blaiseli

Software Versions

$ snakemake --version
8.27.1
$ pip list | grep "snakemake-executor-plugin-slurm"
snakemake-executor-plugin-slurm           0.15.0
snakemake-executor-plugin-slurm-jobstep   0.2.1
$ sinfo --version
slurm 23.02.6

Describe the bug

When I try to set resources using an <v1> if attempt == 1 else <v2> expression in the workflow config.yaml, this works with integers, but not with strings.

Example:

set-resources:
    my_rule:
        mem_mb: 16384 if attempt == 1 else (32768 if attempt == 2 else (49152 if attempt == 3 else 65536))
        runtime: 119 if attempt == 1 else 1439
        cpus_per_task: 32 if attempt == 1 else 12
        # This fails
        slurm_extra: "'--qos=fast'" if attempt == 1 else "'--qos=normal'"
        # This works:
        # slurm_extra: "'--qos=fast'"

Logs

When trying to set up slurm_extra as above, I get the following kind of error:

slurm_script: error: Couldn't parse config file: while parsing a block mapping
  in "/pasteur/appa/homes/bli/src/nanopore_assembly/src/workflow/profile/config.yaml", line 82, column 9
expected <block end>, but found '<scalar>'
  in "/pasteur/appa/homes/bli/src/nanopore_assembly/src/workflow/profile/config.yaml", line 86, column 37

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions