[slurm-users] how to print all the key-values of "job_desc" in job_submit.lua?

taleintervenor at sjtu.edu.cn taleintervenor at sjtu.edu.cn
Mon Mar 29 07:35:15 UTC 2021


Hello,

 

Because I'm not sure about the relations between fields of job_desc
structure and sbatch parameter, I want to print all the fields and their
values in job_desc when testing job_submit.lua. But the following code add
to job_submit.lua failed to iterate through job_desc, the for loop print
nothing while specifying "job_desc.partition" do print the value:

 

-- dev:

    if job_desc.user_name == "hpczty" then

        slurm.log_user("print job_desc>>>>>>>>>>>")

        slurm.log_user("job_desc.partition=%s",job_desc["partition"])

        for k, v in pairs(job_desc) do

            slurm.log_user("%s: %s", k, v)

        end

        return slurm.ERROR

end

 

submit job print the following message:

sbatch testjob.sh

sbatch: error: print job_desc>>>>>>>>>>>

sbatch: error: job_desc.partition=debug

sbatch: error: Batch job submission failed: Unspecified error

 

Why the loop code cannot get the content in job_desc? And what is the
correct way to print all its content without manually specify each key?

 

Thanks.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20210329/45e8e7b9/attachment.htm>


More information about the slurm-users mailing list