Quotes in submit.yml.erb field

Hi everyone,

I have another Ruby tricky question. I want to implement adding SLURM constraints to the job submission parameters. So, I create a constraints entry box in form.yml, and in submit.yml.erb do

script:
  native:
    <%- if constraint != "" -%>
    - "-C"
    - "<%= constraint %>"
    <%- end -%>

That all works great for a single constraint, but, to combine more than one constraint, it needs to be quoted. For example, to ask for both AMD CPU kinds that we have, the SLURM option is -C "rom|mil".

I am struggling with adding those quotes OOD’s generated list of SLURM options. The above in submit.yml.erb generates the following in the job_script_options.json:

native:
0:   "-C"
1:   "rom|mil"

which gets passed to the sbatch without quotes, that is as sbatch -C rom|mil, which SLURM does not like.

Anyone knows how to add quotes to this? I tried things like escaping, or double quotes, but no luck so far.

Thanks,
Martin

1 Like

I’ll answer this myself. I must have had a typo in the constraint, as after some wrangling with it, it started working without making any changes to the submit.yml.erb. So, it looks like OOD is doing things right and quoting stuff correctly.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.