diff --git a/etc/slurm/job_submit.lua b/etc/slurm/job_submit.lua index 65b766d247f0a76e03475f5ee7160a86ce2c4dad..1b42e0643424dcefe0ec61b4cdf0f9c8b391071c 100644 --- a/etc/slurm/job_submit.lua +++ b/etc/slurm/job_submit.lua @@ -25,46 +25,46 @@ local grp = require("posix").grp function slurm_job_submit(job_desc, part_list, submit_uid) - local target_group = "gpfs5" - local username = pwd.getpwuid(submit_uid).pw_name - local group_member = grp.getgrnam(target_group).gr_mem - local found = false + local target_group = "gpfs5" + local username = pwd.getpwuid(submit_uid).pw_name + local group_member = grp.getgrnam(target_group).gr_mem + local found = false - slurm.log_info("username:" .. username) - slurm.log_info("job_desc:" .. dump(job_desc) .. type(job_desc)) - slurm.log_info("job_desc.features:" .. dump(job_desc.features)) - slurm.log_info("part_list:" .. dump(part_list) .. type(part_list)) - slurm.log_info("submit_uid:" .. dump(submit_uid) .. type(submit_uid)) + slurm.log_info("username:" .. username) + slurm.log_info("job_desc:" .. dump(job_desc) .. type(job_desc)) + slurm.log_info("job_desc.features:" .. dump(job_desc.features)) + slurm.log_info("part_list:" .. dump(part_list) .. type(part_list)) + slurm.log_info("submit_uid:" .. dump(submit_uid) .. type(submit_uid)) - -- Checking if the user is in the target_group - -- By compare group member and the username - for i,member in ipairs(group_member) do - if member == username then - found = true - job_desc.features = "gpfs5" - break - end - end - if not found then - job_desc.features = "gpfs4" - end + -- Checking if the user is in the target_group + -- By compare group member and the username + for i,member in ipairs(group_member) do + if member == username then + found = true + job_desc.features = "gpfs5" + break + end + end + if not found then + job_desc.features = "gpfs4" + end - slurm.log_info("found:" .. dump(found)) - slurm.log_info("job_desc.features:" .. dump(job_desc.features)) - --slurm.log_user("job_desc.features: " .. dump(job_desc.features)) + slurm.log_info("found:" .. dump(found)) + slurm.log_info("job_desc.features:" .. dump(job_desc.features)) + --slurm.log_user("job_desc.features: " .. dump(job_desc.features)) - return slurm.SUCCESS + return slurm.SUCCESS end function slurm_job_modify(job_desc, job_rec, part_list, modify_uid) - if job_desc.comment == nil then - local comment = "***TEST_COMMENT***" - slurm.log_info("slurm_job_modify: for job %u from uid %u, setting default comment value: %s", - job_rec.job_id, modify_uid, comment) - job_desc.comment = comment - end + if job_desc.comment == nil then + local comment = "***TEST_COMMENT***" + slurm.log_info("slurm_job_modify: for job %u from uid %u, setting default comment value: %s", + job_rec.job_id, modify_uid, comment) + job_desc.comment = comment + end - return slurm.SUCCESS + return slurm.SUCCESS end slurm.log_info("initialized")