[slurm-users] Limit run time of interactive jobs

Angel de Vicente angel.de.vicente at iac.es
Mon May 8 17:08:31 UTC 2023


Hello,

Bjørn-Helge Mevik <b.h.mevik at usit.uio.no> writes:

>> A solution was suggested in
>> https://serverfault.com/questions/1090689/how-can-i-set-up-interactive-job-only-or-batch-job-only-partition-on-a-slurm-clu
>>> Interactive jobs have no script and job_desc.script will be empty /
>> not set.
>>
>> So maybe something like this code snippet?
>>
>> if job_desc.script == NIL then

In my case (merely a variation from some older post here at
slurm-users), I'm using the following to make sure jobs go to the right
queue (either 'batch' or 'interactive'), and it seems to work just
fine:


 if (job_desc.script == nil or job_desc.script == '') then
    if (job_desc.partition ~= interactive_partition) then
          job_desc.partition = interactive_partition
          slurm.log_user("%s: normal job seems to be interactive, moved to %s partition.", log_prefix, job_desc.partition)
    end
 else
    if (job_desc.partition == interactive_partition) then
          job_desc.partition = batch_partition
          slurm.log_user("%s: batch jobs cannot be run in the interactive partition, moved to %s partition.", log_prefix, job_desc.partition)
    end
 end


-- 
Ángel de Vicente
 Research Software Engineer (Supercomputing and BigData)
 Tel.: +34 922-605-747
 Web.: http://research.iac.es/proyecto/polmag/

 GPG: 0x8BDC390B69033F52
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5877 bytes
Desc: not available
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20230508/f920bf6e/attachment-0001.bin>


More information about the slurm-users mailing list