diff --git a/roles/slurm-common/templates/job_submit.lua.j2 b/roles/slurm-common/templates/job_submit.lua.j2 index 1d3da3711c9a33ebab56ebf119eab728db4d1210..646844f9d79ec9a276a44aaae9caff0928795fe2 100644 --- a/roles/slurm-common/templates/job_submit.lua.j2 +++ b/roles/slurm-common/templates/job_submit.lua.j2 @@ -15,13 +15,45 @@ function slurm_job_submit(job_desc, part_list, submit_uid) + +-- Check no default account + if job_desc.account == "default" then -slurm.log_user("You have to specify your project ID as part of your job submission. The account=default is now deprecated on M3 job scheduler.") -return slurm.ERROR + slurm.log_user("You have to specify your project ID as part of your job submission. The account=default is now deprecated on M3 job scheduler.") + return slurm.ERROR end + + +-- Check for gres.gpu requirements in m3c, m3h and m3g, else move job to comp + +if ((job_desc.partition == "m3c" ) or (job_desc.partition == "m3h" ) or (job_desc.partition == "m3g" )) then + local partition = "" + if (job_desc.gres == nil) then + partition = "comp" + slurm.log_info("slurm_job_submit: for user: %u, partition: %s", submit_uid, partition) + job_desc.partition = partition + end + return slurm.SUCCESS end + +-- Check for QOS rtq in m3c, m3h and m3g, then forward job to rtqp,comp,m3g + +if job_desc.qos == "rtq" then + local partition = "" + partition = "rtqp,comp,m3g" + slurm.log_info("slurm_job_submit: for user: %u, partition: %s", submit_uid, partition) + job_desc.partition = partition + return slurm.SUCCESS +end + + + +end + + + function slurm_job_modify(job_desc, job_rec, part_list, modify_uid) return slurm.SUCCESS end