4

I have a SLURM array

#SBATCH --array=0-1000%10

and I need to add a variable instead of "1000"

to be something like

#! /bin/bash
num=$1
#SBATCH --array=1-${num}%10

or if there is other way to setup the range. Thanks!

1 Answer 1

3

Slurm does not interpret variables in #SBATCH lines, and stops looking for #SBATCH lines as soon as a non-comment line is found so in your case the num=$1 line.

One option is to pass that parameter as an argument of the sbatch command line

sbatch --array=1-${num}%10 submit.sh

For more details see here

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.