Job Submission Lua Plugin
The Job Submit Plugin runs on the head node. It executes after a user's job request is submitted to the head node and before the job is actually queued.
Purpose
The Job Submit Plugin can do the following:
- Modify job submission information, such as the job's partition, cores, and memory amount.
- Check job information to determine whether it is allowed to run, and so on.
Installation and Configuration
Add the following to slurm.conf:
JobSubmitPlugins=job_submit/lua
Save the Lua script to /etc/slurm/job_submit.lua.
Supported Functions
-- Executed on job submission
function slurm_job_submit(job_desc, part_list, submit_uid)
end
-- Executed on job modification
function slurm_job_modify(job_desc, job_rec, part_list, modify_uid)
end
Parameters:
job_desc: job description informationpart_list: all partition informationsubmit_uid: UID of the submitting userjob_rec: current job record (job_modify only)modify_uid: UID of the user performing the modification (job_modify only)
Data Structures
Job Descriptor (job_desc)
| Field | Type | Description |
|---|---|---|
| account | string | Job account name |
| admin_comment | string | Admin comment |
| array_task_cnt | number | Number of array tasks |
| batch_features | string | Job batch features |
| burst_buffer | string | Job burst buffer |
| comment | string | Job comment |
| cpus_per_tres | string | CPUs per TRES (resource manager) |
| delay_boot | number | Delay boot time |
| direct_set_prio | number | Directly set priority |
| features | string | Job features |
| gres | string | Requested GRES (generic resources) |
| group_id | number | Job group ID |
| job_id | number | Job ID |
| job_state | number | Job state |
| licenses | string | Job licenses |
| max_cpus | number | Maximum CPUs available to the job |
| max_nodes | number | Maximum nodes available to the job |
| mem_per_tres | string | Memory allocated per TRES |
| min_cpus | number | Minimum CPUs requested by the job |
| min_mem_per_node | number | Minimum memory requirement per node |
| min_mem_per_cpu | number | Minimum memory requirement per CPU |
| min_nodes | number | Minimum nodes requested by the job |
| name | string | Job name |
| nice | number | Job priority offset (scheduling) |
| pack_job_id | number | Pack job ID |
| pack_job_id_set | string | Pack job ID set |
| pack_job_offset | number | Pack job offset |
| partition | string | Job partition; note this is the requested value and may be empty |
| pn_min_cpus | number | Minimum CPUs per node |
| pn_min_memory | number | Minimum memory per node (64-bit integer) |
| priority | number | Job priority |
| qos | string | Job Quality of Service (QoS) |
| reboot | number | Job reboot setting |
| req_switch | number | Job requested switch information |
| site_factor | number | Site factor, usually for scheduling policies |
| spank_job_env | table | SPANK (Slurm plugin) job environment variables |
| spank_job_env_size | number | Size of SPANK job environment variables |
| time_limit | number | Job time limit |
| time_min | number | Minimum job time limit |
| tres_bind | string | TRES binding information |
| tres_freq | string | TRES frequency information |
| tres_per_job | string | TRES per job |
| tres_per_node | string | TRES per node |
| tres_per_socket | string | TRES per socket |
| tres_per_task | string | TRES per task |
| user_id | number | User ID |
| user_name | string | User name |
| wait4switch | number | Job wait-for-switch status |
| wckey | string | Job workload key (workload key) |
Partition (part_list)
| Field | Type | Description |
|---|---|---|
| allow_accounts | string | Allowed account names |
| allow_alloc_nodes | string | Allowed node names |
| allow_groups | string | Allowed group names |
| allow_qos | string | Allowed QoS settings |
| alternate | string | Alternate partition name |
| billing_weights_str | string | Partition billing weight string |
| default_time | number | Default time limit (minutes) |
| def_mem_per_cpu | number | Default memory per CPU (if allocated by CPU) |
| def_mem_per_node | number | Default memory per node |
| deny_accounts | string | Denied account names |
| deny_qos | string | Denied QoS settings |
| flag_default | number | Whether it is the default partition (0: no, 1: yes) |
| flags | number | Partition flags field (e.g., enabled) |
| max_cpus_per_node | number | Maximum CPUs allowed per node |
| max_mem_per_cpu | number | Maximum memory per CPU |
| max_mem_per_node | number | Maximum memory per node |
| max_nodes | number | Maximum nodes |
| max_nodes_orig | number | Original maximum nodes |
| max_share | number | Maximum sharing ratio |
| max_time | number | Maximum time limit (minutes) |
| min_nodes | number | Minimum nodes |
| min_nodes_orig | number | Original minimum nodes |
| name | string | Partition name |
| nodes | string | Node list |
| priority_job_factor | number | Job priority factor |
| priority_tier | number | Priority tier |
| qos | string | QoS settings |
| state_up | number | Whether the partition is active (0: inactive, 1: active) |
Global Object slurm
Log Functions
| Field/Function | Description |
|---|---|
| log_error | Log error messages |
| log_info | Log informational messages (level 0) |
| log_verbose | Log verbose messages (level 1) |
| log_debug | Log debug messages (level 2) |
| log_debug2 | Log more detailed debug messages (level 3) |
| log_debug3 | Log even more detailed debug messages (level 4) |
| log_debug4 | Log the most detailed debug messages (level 5) |
| log_user | Log user messages |
Error Codes
| Field/Function | Description |
|---|---|
| ERROR | Indicates a general error |
| FAILURE | Indicates operation failure |
| SUCCESS | Indicates operation success |
| ESLURM_ACCESS_DENIED | Access denied |
| ESLURM_ACCOUNTING_POLICY | Accounting policy error |
| ESLURM_INVALID_ACCOUNT | Invalid account |
| ESLURM_INVALID_LICENSES | Invalid licenses |
| ESLURM_INVALID_NODE_COUNT | Invalid node count |
| ESLURM_INVALID_TIME_LIMIT | Invalid time limit |
| ESLURM_JOB_MISSING_SIZE_SPECIFICATION | Job missing size specification |
| ESLURM_MISSING_TIME_LIMIT | Missing time limit |
Other Definitions
| Field/Function | Description |
|---|---|
| ALLOC_SID_ADMIN_HOLD | Allocation ID reserved by admin |
| ALLOC_SID_USER_HOLD | Allocation ID reserved by user |
| INFINITE | Infinite value |
| INFINITE64 | 64-bit infinite value |
| MAIL_JOB_BEGIN | Send mail when job begins |
| MAIL_JOB_END | Send mail when job ends |
| MAIL_JOB_FAIL | Send mail when job fails |
| MAIL_JOB_REQUEUE | Send mail when job requeues |
| MAIL_JOB_TIME100 | Send mail when job reaches 100% time |
| MAIL_JOB_TIME90 | Send mail when job reaches 90% time |
| MAIL_JOB_TIME80 | Send mail when job reaches 80% time |
| MAIL_JOB_TIME50 | Send mail when job reaches 50% time |
| MAIL_JOB_STAGE_OUT | Send mail when job stage ends |
| MEM_PER_CPU | Memory per CPU |
| NICE_OFFSET | Priority offset |
| JOB_SHARED_NONE | Job not shared |
| JOB_SHARED_OK | Job shared |
| JOB_SHARED_USER | User shared job |
| JOB_SHARED_MCS | MCS shared job |
| NO_VAL64 | 64-bit invalid value |
| NO_VAL | Invalid value |
| NO_VAL16 | 16-bit invalid value |
| NO_VAL8 | 8-bit invalid value |
| SHARED_FORCE | Force sharing |
Job Descriptor Bit Flags
| Field/Function | Description |
|---|---|
| GRES_DISABLE_BIND | Disable resource binding |
| GRES_ENFORCE_BIND | Enforce resource binding |
| KILL_INV_DEP | Kill invalid dependencies |
| NO_KILL_INV_DEP | Do not kill invalid dependencies |
| SPREAD_JOB | Spread job |
| USE_MIN_NODES | Use minimum nodes |