On 9/5/24 11:13, Benjamin Jin via slurm-users wrote:
I am tyring to build a custom plugin to force some jobs to be pended.
In the official document, `ESLURM*` errors are only valid for `job_submit_lua`.
I tried to send `ESLURM_JOB_PENDING`, but it only rejects the job submission.
Does anyone know how to pend a job in job_submit plugin?
I believe that a job state of "Pending" is only possible *after* the job has been submitted successfully to slurmctld, and after the job_submit plugin has completed for the job. If slurmctld cannot allocate nodes to the job, it will be assigned a state of "Pending", i.e., the job is waiting for resources.
The job_submit plugin is documented in https://slurm.schedmd.com/job_submit_plugins.html and it's not really obvious what you can manipulate in the plugin. My guess is that the future job state, after slurmctld has accepted the job, cannot be changed in the job_submit plugin. I don't know if a state of ESLURM_JOB_HELD can be set?
May I suggest that you try to setup user limits in Slurm so that jobs requesting too many resources will remain "Pending".
I hope this helps, Ole