Skip to content
Snippets Groups Projects
Commit cb333428 authored by Bo-Chun Chen's avatar Bo-Chun Chen
Browse files

style: follow lua indent convention

parent 32d927cb
No related branches found
No related tags found
1 merge request!1Add lua script for Slurm job_submit/lua interface
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment