USCbiostats / slurmR

slurmR: A Lightweight Wrapper for Slurm
https://uscbiostats.github.io/slurmR/
Other
58 stars 12 forks source link

mem-per-cpu as sbatch-opt #32

Closed kgoldfeld closed 3 years ago

kgoldfeld commented 3 years ago

I am trying to specify the RAM to be used per CPU, but the option name ("mem-per-cpu") is not a valid R variable name. So, the list statement (as in sbatch_opt(list(mem-per-cpu="16G")) results in an error. I specified the variable name with backticks - and no errors were generated, but I am not sure it has actually worked. Is that the proper way to solve this issue, or is there another way I should be doing it?

gvegayon commented 3 years ago

You need to add single, backticks, or double quotes to the name of the parameter. All these work:

list(`mem-per-cpu1` = 1, "mem-per-cpu2" = 2, 'mem-per-cpu3' = 3)
# $`mem-per-cpu1`
# [1] 1
#
# $`mem-per-cpu2`
# [1] 2
# 
# $`mem-per-cpu`
# [1] 3