slurm_submit
Submit a SLURM batch job from a command string and auto-register completion notifications, including array-task tallies and dependency chaining, to avoid SSH polling loops.
Instructions
Submit a SLURM batch job built from a command string. Auto-registers a completion watch: when the job (or, for arrays, EVERY task) finishes, a notification with an ok/failed tally is prepended to your next tool result — never poll with ssh loops. For many independent chunks use array (e.g. "1-20" or "1-100%10"; each task reads $SLURM_ARRAY_TASK_ID; logs go to slurm__.out). Chain jobs with dependency (e.g. "afterok:12345"). Checks past resource usage, and appends ⚠️ hints (non-blocking) when the partition has a per-user cap that will serialize your jobs or reject the request (gpus/mem/time over the cap).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"script": "<script>"
},
"name": "slurm_submit"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mem | No | Memory, e.g. 4G / 512M (default: 4G) | |
| gpus | No | Number of GPUs (default: 1; 0 = no --gres line). Some sites reject 0 (every job must request ≥1 GPU). | |
| time | No | Time limit: M, M:S, H:M:S, D-H, D-H:M or D-H:M:S (default: 00:15:00) | |
| array | No | SLURM array spec: "1-10", "1,3,5-7", "1-100%5" (%N = max concurrent tasks). Each task gets $SLURM_ARRAY_TASK_ID. | |
| script | Yes | Main command(s) to run inside the job | |
| job_name | No | Job name, [A-Za-z0-9_.-]{1,64} (default: slurm-job) | |
| preamble | No | Include HPC_PREAMBLE (module loads/conda env) in the job script. Set false for generic jobs that do not need the project environment. | |
| template | No | Name of saved template to use as defaults (see template_list); unknown names are an error | |
| partition | No | Partition (default: batch). Use cluster_info to see per-user caps; small debug partitions often allow 1 job at a time — for parallel chunks pick a partition without a per-user cap. | |
| dependency | No | SLURM dependency, e.g. "afterok:12345", "afterany:12345_2", "singleton" | |
| output_dir | No | Log output dir (default: results/logs, under the workdir if set). Avoid /tmp — it is node-local. | |
| cpus_per_task | No |