원클릭으로
slurm
Manage Slurm cluster jobs - submit (sbatch), monitor (squeue), cancel (scancel), check nodes (sinfo), and view logs. Cluster-agnostic.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Manage Slurm cluster jobs - submit (sbatch), monitor (squeue), cancel (scancel), check nodes (sinfo), and view logs. Cluster-agnostic.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | slurm |
| description | Manage Slurm cluster jobs - submit (sbatch), monitor (squeue), cancel (scancel), check nodes (sinfo), and view logs. Cluster-agnostic. |
| disable-model-invocation | true |
| argument-hint | [submit|status|cancel|nodes|logs|cpu|unblock] [args...] |
| allowed-tools | ["Read","Grep","Glob","Write","Bash(sbatch *)","Bash(squeue *)","Bash(scancel *)","Bash(scontrol show *)","Bash(scontrol hold *)","Bash(scontrol release *)","Bash(sprio *)","Bash(sshare *)","Bash(sinfo *)","Bash(sacctmgr show *)","Bash(cat *)","Bash(tail *)","Bash(head *)","Bash(ls *)","Bash(mkdir *)","Bash(mktemp *)","Bash(rm /tmp/slurm_job_*)","Bash(cp *)","Bash(chmod *)"] |
You manage Slurm cluster jobs. Parse $ARGUMENTS to determine which action to perform. This skill contains generic Slurm knowledge only — it has no cluster-specific partitions, accounts, GPU types, or node names baked in. If the project provides a cluster-specific overlay skill with partition configs, prefer those; otherwise gather parameters from the user.
From the user's request, determine:
| Parameter | Required | Default |
|---|---|---|
Partition (--partition) | Yes | Ask if not specified |
Account (--account) | Cluster-dependent | Ask if the cluster requires it |
Time limit (--time) | Yes | Ask — Slurm rejects jobs without one on most clusters |
Number of GPUs (--gres=gpu:N) | If GPU job | 1 |
| GPU type/constraint | No | None; use --constraint=<gpu_feature> if targeting a specific model |
| CPUs per GPU / per task | No | 4 (GPU) or 1 (CPU) |
Memory (--mem-per-gpu or --mem) | No | Ask if unsure |
| Job name | No | Derive from the command |
| Conda env / module / venv activation | No | Ask if the user expects one |
| Working directory | No | Current directory |
| Command to run | Yes | Ask if not specified |
| Extra env exports | No | None |
Requeue (--requeue) | No | Only if the partition is preemptable |
If any required parameter is missing, ask the user. Use sinfo / sacctmgr show assoc user=$USER to discover what partitions and accounts are available on this cluster if the user is unsure.
Generate this sbatch script, filling in the values from Step 1:
#!/bin/bash
#SBATCH --job-name=<JOB_NAME>
#SBATCH --output=logs/%j_%x.out
#SBATCH --error=logs/%j_%x.err
#SBATCH --partition=<PARTITION>
#SBATCH --time=<TIME>
#SBATCH --nodes=1
# --- GPU directives (omit if CPU-only) ---
#SBATCH --gres=gpu:<N_GPUS>
#SBATCH --cpus-per-gpu=<CPUS_PER_GPU>
#SBATCH --mem-per-gpu=<MEM_PER_GPU>
# --- CPU-only alternative ---
# #SBATCH --cpus-per-task=<N_CPUS>
# #SBATCH --mem=<MEM>
# --- Optional ---
# #SBATCH --account=<ACCOUNT>
# #SBATCH --constraint=<FEATURE>
# #SBATCH --requeue
# Clear stale AMD GPU visibility vars (harmless on NVIDIA nodes)
unset ROCR_VISIBLE_DEVICES
unset HIP_VISIBLE_DEVICES
# Activate environment (replace with `module load ...` or `source venv/bin/activate` if needed)
source ~/.bashrc && conda activate <CONDA_ENV>
set -x
<EXTRA_EXPORTS_IF_ANY>
cd <WORKING_DIR>
<USER_COMMAND>
mkdir -p logs in the working directory./tmp/slurm_job_XXXXXX.sh using mktemp.sbatch <tmpfile>.logs/<job_id>_<job_name>.sbatch for records.Submitted <JOB_NAME> -> Job <JOB_ID>.squeue -u $USER — all your queued/running jobs.squeue -j <JOB_ID> for a one-line view; scontrol show job <JOB_ID> for full detail (state, reason, priority, accrue time, start time estimate, node list).squeue -p <PARTITION>.squeue -u $USER -t PENDING -o "%.10i %.12j %.8T %.10r %.10Q %b".Format output clearly.
scancel <JOB_ID>, then squeue -u $USER to confirm.squeue -u $USER first, ask "Cancel ALL these jobs?", then scancel -u $USER.scancel --name=<JOB_NAME>.scancel -u $USER -p <PARTITION>.scancel -u $USER -t PENDING (only cancel pending, keep running).Always confirm by running squeue -u $USER after.
sinfo -o "%P %a %l %D %t %N" — partition, availability, time limit, node count, state, nodelist.sinfo -N -o "%N %P %G %C %m %t" — node, partition, generic resources (GPU), CPUs (alloc/idle/other/total), memory, state.sinfo -t idle -o "%N %P %G".sinfo -o "%N %f".scontrol show node <NODE_NAME>.When summarizing, highlight which partitions have idle GPUs and the total vs available resources by GPU type (read GPU type from the Gres column or --constraint features).
logs/<JOB_ID>*.out and logs/<JOB_ID>*.err.ls -t logs/*.out | head -1.tail -100..err) if the user is debugging errors.tail -f logs/<JOB_ID>*.out.Read and present ${CLAUDE_SKILL_DIR}/cpu-groups.md. It covers:
--constraint and --prefer syntax (& for AND, | for OR).sinfo -o "%N %f").If the user asks which constraint to use, first check which features exist on this cluster (sinfo -o "%N %f" | sort -u -k2), then help them pick based on their needs.
Read and follow ${CLAUDE_SKILL_DIR}/unblock-backfill.md.
This handles the scenario where a low-priority pending job is stuck at Priority=1 with AccrueTime=Unknown because the user's own higher-priority jobs in the same partition are consuming the single per-user-per-partition backfill/accrue slot. The fix is to temporarily scontrol hold the blocker jobs until the starved job starts, then scontrol release them.
Before applying the hold, confirm:
Reason=Priority, Priority=1, and AccrueTime=Unknown (via scontrol show job).scontrol show config | grep -iE "bf_max_job_user|SchedulerParameters" and sacctmgr show qos format=Name,MaxJobsAccruePU).Then follow the Procedure section of that file. After holding, wait at least PriorityCalcPeriod + bf_interval (typically ~90s) and re-check scontrol show job <starved_id> — success is JobState=RUNNING or AccrueTime=<timestamp>. Always remind the user to scontrol release the held jobs once the starved job is running.