[slurm-users] getting started with job_submit_lua

Mark Dixon mark.c.dixon at durham.ac.uk
Wed Sep 16 08:44:41 UTC 2020


On Wed, 16 Sep 2020, Diego Zuccato wrote:
...
> From the source it seems these fields are available:
>        account
>        comment
>        direct_set_prio
>        gres
>        job_id          Always nil ? Maybe no JobID yet?
>        job_state
>        licenses
>        max_cpus
>        max_nodes
>        min_cpus
>        min_nodes
>        nice
>        partition
>        priority
>        req_switch
>        time_limit
>        time_min
>        wait4switch
>        wckey
>
> If you access 'em directly, you'll find that some are actually populated.

Hi Diego, thanks for replying :)

I gave this alternative a go:

   function slurm_job_submit( job_desc, part_list, submit_uid )

      slurm.log_info("submit called lua plugin")
      slurm.log_info("submit -- account %s", job_desc.account)
      slurm.log_info("submit -- gres %s", job_desc.gres)
      slurm.log_info("submit completed lua plugin")

      return slurm.SUCCESS
   end

   function slurm_job_modify(job_desc, job_rec, part_list, modify_uid)
      slurm.log_info("submit called lua plugin2")
      return slurm.SUCCESS
   end

And got:

   Sep 16 09:36:58 quack1 slurmctld[9617]: job_submit.lua: submit called lua plugin
   Sep 16 09:36:58 quack1 slurmctld[9617]: error: job_submit/lua: /usr/local/slurm/19.05.7-1/etc/job_submit.lua: [string "slurm.log (0, string.format(unpack({...})))"]:1: bad argument #2 to 'format' (no value)

It seems "pairs" wasn't lying, job_desc really is empty?

A job_submit function isn't much use without any information about the 
job!

Please help!

Mark



More information about the slurm-users mailing list