Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
fix job submit plugin to allow zero gpu request
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelmayer2 committed May 5, 2023
1 parent faced48 commit 6e68a14
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions scripts/job_submit.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
--[[
Simple job_submit plugin that redirects all jobs to the gpu partition if GPUs are requested
Simple job_submit plugin that redirects all jobs to the gpu partition if a non-zero amount of GPUs are requested
--]]

function slurm_job_submit(job_desc, job_rec, part_list, modify_uid)
if string.match(job_desc['tres_per_job'],'gpu') then
slurm.log_info("slurm_job_modify: job requested partition %s but seems to need GPUs, hence we redirect to partition gpu",
job_desc.partition)
job_desc.partition = "gpu"
if ( string.match(job_desc['tres_per_job'],'gpu') and not string.match(job_desc['tres_per_job'],'gpu.*:0') ) then
job_desc.partition = "gpu"
end

return slurm.SUCCESS
Expand All @@ -19,6 +17,6 @@ function slurm_job_modify(job_desc, job_rec, part_list, modify_uid)
return slurm.SUCCESS
end

slurm.log_info("initialized")
slurm.log_info("SLURM job submit plugin initialized")
return slurm.SUCCESS

0 comments on commit 6e68a14

Please sign in to comment.