1

is it possible to use variable expansion in #SBATCH lines in slurm? for instance I want to have line below:

#SBATCH --array=0-100%{$1-10}

so that by default it uses 10 concurrent job unless I manually pass an argument when I call sbatch.

Above gives me an Invalid job array specification error.

Milad
  • 4,901
  • 5
  • 32
  • 43
  • Does this answer your question? [Pass command line arguments via sbatch](https://stackoverflow.com/questions/27708656/pass-command-line-arguments-via-sbatch) – ndrwnaguib Sep 20 '22 at 18:00

1 Answers1

3

No, this isn't possible. But you can overwrite the scripts default --array by giving it explicitly on the sbatch command line.

ciaron
  • 1,089
  • 7
  • 15