[slurm-users] [External] How to detect Job submission by srun / interactive jobs

Florian Zillner fzillner at lenovo.com
Mon May 18 15:21:14 UTC 2020

Hi Stephan,

From the slurm.conf docs:
Jobs submitted using the sbatch command have BatchFlag set to 1. Jobs submitted using other commands have BatchFlag set to 0.
You can look that up e.g. with scontrol show job <jobid>. I haven't checked though how to access that via lua. If you know, let me know, I'd be interested as well.

# scontrol show job 128922
JobId=128922 JobName=sleep
   JobState=RUNNING Reason=None Dependency=(null)
   Requeue=1 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0
   RunTime=00:00:54 TimeLimit=00:30:00 TimeMin=N/A


-----Original Message-----
From: slurm-users <slurm-users-bounces at lists.schedmd.com> On Behalf Of Stephan Roth
Sent: Montag, 18. Mai 2020 16:04
To: slurm-users at lists.schedmd.com
Subject: [External] [slurm-users] How to detect Job submission by srun / interactive jobs

Dear all,

Does anybody know of a way to detect whether a job is submitted with 
srun, preferrably in job_submit.lua?

The goal is to allow interactive jobs only on specific partitions.

Any recommendation or best practice on how to handle interactive jobs is 

Thank you,

More information about the slurm-users mailing list