The lua wrapper does not now propagate the environment variables to the lua script, but that could be added to src/plugins/job_submit/lua/job_submit_lua.c (sett the _get_job_req_field and _set_job_req_field functions). If you do add that, then please send a patch for us to include it in a future release
A SLURM SPANK plugin may be another way to do this. See "man spank" for more information about that. Moe ________________________________________ From: [email protected] [[email protected]] On Behalf Of Bjørn-Helge Mevik [[email protected]] Sent: Friday, March 11, 2011 2:24 AM To: [email protected] Subject: [slurm-dev] Check environment variable in lua job submit plugin? We are running slurm 2.2.3 on our cluster. We have a wrapper script for sbatch, and want all job submission to go through that wrapper. One way to do that would be to set an environment variable in the wrapper, and check that inside the lua job_submit plugin. Is it possible to check environment variables in lua job_submit plugins? And is it possible to write a custom message out to stderr from the plugin (to tell the user to use the wrapper)? Or are there better ways of achieving the same result? (We have considered moving /usr/bin/sbatch away to a "secret" place, and place our wrapper in /usr/bin/sbatch, but that makes upgrades error-prone.) -- Bjørn-Helge Mevik, dr. scient, Research Computing Services, University of Oslo
