Milad
Milad

Reputation: 5540

bash variable expansion in slurm's #SBATCH directive

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.

Upvotes: 1

Views: 633

Answers (1)

ciaron
ciaron

Reputation: 1169

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

Upvotes: 3

Related Questions