Discussion:
job_submit_lua
Nathan Harper
2014-10-06 16:03:41 UTC
Permalink
After a suggestion in another thread, I have been toying with a lua job
submit plugin, and I've achieved my original goal.

I've been sucked in by the possibilities of the plugin, and the prospect of
presenting users with a comment on job submission is an attractive one.

I've not been able to get output to the user shell to work however.
log_info does successfully enter the slurm log, and the qos reassignment
works as I'd hoped.

My logic is below - can anyone see where I'm going wrong?

if job_desc.partition == "sandybridge" then
if job_desc.account == "account1" then
local qos = "account1_sandybridge"
log_user("your qos has been changed")
log_info("slurm_job_submit: job from uid %d,
setting qos value: %s", submit_uid,
end
end
Nathan Harper
2014-10-06 16:07:47 UTC
Permalink
in my haste to anonymise, I missed a line from my logic:

if job_desc.partition == "sandybridge" then
if job_desc.account == "account1" then
local qos = "account1_sandybridge"
log_user("your qos has been changed")
log_info("slurm_job_submit: job from uid %d,
setting qos value: %s", submit_uid,
job_desc.qos = qos
end
end
--
*Nathan Harper* // IT Systems Architect

*e: * nathan.harper-0eSKoRi+iP310XsdtD+***@public.gmane.org // *t: * 0117 906 1104 // *m: * 07875 510891 //
*w: * www.cfms.org.uk <http://www.cfms.org.uk%22> // [image: Linkedin grey
icon scaled] <http://uk.linkedin.com/pub/nathan-harper/21/696/b81>
CFMS Services Ltd // Bristol & Bath Science Park // Dirac Crescent // Emersons
Green // Bristol // BS16 7FR

[image: 4.2 CFMS_Artwork_RGB] <http://www.cfms.org.uk>

------------------------------
CFMS Services Ltd is registered in England and Wales No 05742022 - a
subsidiary of CFMS Ltd
CFMS Services Ltd registered office // Victoria House // 51 Victoria Street
// Bristol // BS1 6AD
Post by Nathan Harper
After a suggestion in another thread, I have been toying with a lua job
submit plugin, and I've achieved my original goal.
I've been sucked in by the possibilities of the plugin, and the prospect
of presenting users with a comment on job submission is an attractive one.
I've not been able to get output to the user shell to work however.
log_info does successfully enter the slurm log, and the qos reassignment
works as I'd hoped.
My logic is below - can anyone see where I'm going wrong?
if job_desc.partition == "sandybridge" then
if job_desc.account == "account1" then
local qos = "account1_sandybridge"
log_user("your qos has been changed")
log_info("slurm_job_submit: job from uid %d,
setting qos value: %s", submit_uid,
end
end
Trey Dockendorf
2014-10-06 16:30:33 UTC
Permalink
Unfortunately I lost rest of email thread due to mail migrations going on
here, so forgive me if the context of my reply is wrong.

Do you have "log_user = slurm.log_user" defined? Also you could test if
"job_desc.qos == nil" before changing it, that way your not changing the
QOS (if that's the desired behavior). I have not tried making my
job_submit.lua output to user console.

- Trey
Nathan Harper
2014-10-06 20:12:37 UTC
Permalink
I actually started a new thread, I'd achieved what I'd set out to do with
the previous thread, and didn't want to confuse things. I've got the
actual logic bit working as hoped, but I'm now interested in getting the
reporting/messaging right.

I have log_user = slurm.log_user defined (came with the example)

Working with a simple test:
if job_desc.account == account1 then
log_user("this is a message")
log_info("this is a message")
end

I get the log in the logfile, but nothing to the console. I might be
missing something obvious, but I can't find any documentation about this
--
*Nathan Harper* // IT Systems Architect

*e: * nathan.harper-0eSKoRi+iP310XsdtD+***@public.gmane.org // *t: * 0117 906 1104 // *m: * 07875 510891 //
*w: * www.cfms.org.uk <http://www.cfms.org.uk%22> // [image: Linkedin grey
icon scaled] <http://uk.linkedin.com/pub/nathan-harper/21/696/b81>
CFMS Services Ltd // Bristol & Bath Science Park // Dirac Crescent // Emersons
Green // Bristol // BS16 7FR

[image: 4.2 CFMS_Artwork_RGB] <http://www.cfms.org.uk>

------------------------------
CFMS Services Ltd is registered in England and Wales No 05742022 - a
subsidiary of CFMS Ltd
CFMS Services Ltd registered office // Victoria House // 51 Victoria Street
// Bristol // BS1 6AD
Post by Trey Dockendorf
Unfortunately I lost rest of email thread due to mail migrations going
on here, so forgive me if the context of my reply is wrong.
Do you have "log_user = slurm.log_user" defined? Also you could test if
"job_desc.qos == nil" before changing it, that way your not changing the
QOS (if that's the desired behavior). I have not tried making my
job_submit.lua output to user console.
- Trey
Loading...