Israelcma
Israelcma

Reputation: 53

Use slurm JobID as input?

Is it possible to use the JobID as an input of the script you are submiting?

I know you can use %j to name the log file with the JobID, but is it possible to do, for example, something similar to

sbatch make-dir.sh %j

where make-dir.sh is

#!/bin/bash

echo $1

As it stands now, it will print %j, but I would like it to print the JobID.

Thanks.

Upvotes: 2

Views: 2495

Answers (1)

Carles Fenoy
Carles Fenoy

Reputation: 5357

You should use the environment variable $SLURM_JOBID in the make-dir.sh

#!/bin/bash

echo $SLURM_JOBID

Upvotes: 5

Related Questions