Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SLURM how to know if a running job is a srun or a sbatch job?

Tags:

slurm

I need to distinguish between batch and interactive job when are in RUNNING state. I can't find with sact or stat a way to know if a job is a interactive session.

Did anyone already solved a similar problem?

like image 356
user3535936 Avatar asked Oct 20 '25 15:10

user3535936


1 Answers

You can use the batchflag formatting keyword in the squeue command to infer if a job has been submitted using the sbatch command.

$ squeue --Format=batchflag -u ${USER} --states=RUNNING

From the BatchFlag description in the scontrol help page:

Jobs submitted using the sbatch command have BatchFlag set to 1. Jobs submitted using other commands have BatchFlag set to 0.

like image 139
aebmad Avatar answered Oct 23 '25 19:10

aebmad



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!