[slurm-users] submit_plugin.lua: distinguish between batch and interactive usage

Loris Bennett loris.bennett at fu-berlin.de
Mon Dec 7 15:24:32 UTC 2020


Hi,

Thanks for the example.  Checking the value of job_desc.script seemed a
little indirect to me, so I wondered if there were another way, but
apparently not.

Cheers,

Loris

Lech Nieroda <lech.nieroda at uni-koeln.de> writes:

> Hello,
>
> It’s certainly possible to check whether the job is interactive or not, e.g.
>
> if job_desc.script == nil or job_desc.script == '' then
>    slurm.log_info("slurm_job_submit: jobscript is missing, assuming interactive job")
> else
>    slurm.log_info("slurm_job_submit: jobscript is present, assuming non-interactive job")
>    if is_defined(job_desc.partition) and job_desc.partition == "interactive“ then
>       slurm.log_info("slurm_job_submit: interactive partition for non-interactive job, abort“)
>       slurm.log_user("submit_job: ERROR: batch jobs are not allowed in the interactive partition. Use salloc followed by srun instead.“)
>       return -1
>    end
> end
>
> Kind regards,
> Lech
>
>
>> Am 07.12.2020 um 15:31 schrieb Loris Bennett <loris.bennett at fu-berlin.de>:
>> 
>> Hi,
>> 
>> I would like to restrict interactive usage by, say, having a lower
>> maximum run-time for interactive jobs.
>> 
>> Is there checking the value of job_desc.script the best way of
>> determining whether a job has been submitted via sbatch or not?
>> 
>> Cheers,
>> 
>> Loris
>> 
>> -- 
>> Dr. Loris Bennett (Hr./Mr.)
>> ZEDAT, Freie Universität Berlin         Email loris.bennett at fu-berlin.de
>> 
>
-- 
Dr. Loris Bennett (Hr./Mr.)
ZEDAT, Freie Universität Berlin         Email loris.bennett at fu-berlin.de



More information about the slurm-users mailing list