[slurm-users] Unable to access job_desc.environment (NULL) from Lua job submission script

Pablo Llopis pablo.llopis at gmail.com
Wed May 16 03:27:43 MDT 2018


Dear Slurm users,

I am trying to write a lua job submission script that sets certain
environment variables depending on the partition where the job is being
submitted to.  When I try to set the environment, I get the following error
in the slurmctld log:

 error: _set_job_env_field: job_desc->environment is NULL

The documentation on job submission scripts specifically mentions the
following [1]:

Reading and writing of job environment variables using Lua is possible by
referencing the environment variables as a data structure containing named
elements. For example:
if (job_desc.environment.LANGUAGE == "en_US") then

Therefore, my approach was to do as follows:

function slurm_job_submit(job_desc, part_list, submit_uid)
  if job_desc.partition == "X" or job_desc.partition == "Y" then
    job_desc.environment.MV2_USE_RDMA_CM = "1"
    job_desc.environment.MV2_USE_IWARP_MODE = "1"
  end
  return slurm.SUCESS
end

Therefore, my two questions are the following:

1) What is it that I'm missing here for being able to access the job's
environment?

2) Could there be another way of achieving the same thing?  I considered
having modulefiles for each partition, but obviously this is less elegant
and less transparent and user-friendly.
(Unfortunately, setting these settings on each node's /etc/mvapich2.conf
did not work for me, which I also tried to avoid all of this altogether).

Thank you in advance for any help!
Cheers,
Pablo

[1] https://slurm.schedmd.com/job_submit_plugins.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20180516/c3c24447/attachment.html>


More information about the slurm-users mailing list