/clio-hpc-skills:slurm-scriptfrom clio-hpc-skills
Helps prepare Slurm resource requests, arrays, and dependencies, and diagnose pending jobs. Covers batch script structure, memory and time settings, MPI/OpenMP task configuration, and job array syntax.
Ships in clio-hpc-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This is about what goes in the request and how to read what comes back. For
running a Spack package through JARVIS instead of a hand-written script, see
cluster-run.
Look before guessing. clio-node-hardware:get_cpu_info gives core counts,
get_memory_info gives RAM, get_gpu_info gives GPUs. Then
clio-slurm:slurm_cluster gives the partitions and their limits.
Hardware tools describe the MCP host, not necessarily the allocated compute nodes. Use the target partition/node records as the scheduling authority. Invalid requests may be rejected at submission or remain pending; inspect the actual scheduler reason instead of assuming one outcome.
#!/bin/bash
#SBATCH --job-name=run1
#SBATCH --partition=<from slurm_cluster>
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=16
#SBATCH --cpus-per-task=1
#SBATCH --mem=32G
#SBATCH --time=02:00:00
#SBATCH --output=run1-%j.out
#SBATCH --error=run1-%j.err
srun ./my_binary
Points that matter more than they look:
--time is a hard kill, not an estimate. The job is terminated at the
limit, mid-write if necessary. But a shorter limit schedules sooner, because
it fits in backfill gaps. Ask for what the run needs plus margin, not the
partition maximum.--ntasks vs --cpus-per-task. Tasks are MPI ranks; cpus-per-task is
threads within a rank. An MPI+OpenMP code that sets both wrong runs at a
fraction of its speed while looking healthy.--mem is per node; --mem-per-cpu is per allocated CPU. Setting both is
an error. Getting --mem wrong is the most common cause of a job killed
partway through with no obvious message.%j in output paths expands to the job ID. For arrays use %A_%a
(array job ID and task index), for example run1-%A_%a.out.srun inside the script, not a bare call. It inherits the allocation;
running the binary directly gets you one rank on one node regardless of what
was requested.An array submits many similar jobs under one ID. Use it instead of a submit loop — the scheduler can manage the collection efficiently. Array tasks still count against applicable job limits; check site policy and throttle concurrency.
#SBATCH --array=0-99%10 # 100 tasks, at most 10 running at once
$SLURM_ARRAY_TASK_ID selects the per-task input. The %10 throttle matters on
a shared cluster: without it, one array can occupy the queue.
Pass array to clio-slurm:slurm_submit only for an array submission — setting
it on an ordinary job changes what is submitted.
#SBATCH --dependency=afterok:<jobid>
afterok runs only if the prior job succeeded; afterany runs regardless. Use
afterok for a real chain — afterany on a post-processing step means it will
happily process the output of a job that crashed.
A dependency on a job that never succeeds leaves the dependent job pending
forever with reason DependencyNeverSatisfied. That is a terminal state
dressed as a waiting one.
clio-slurm:slurm_describe gives the lifecycle state, whether it is terminal,
and optional bounded stdout/stderr tails. The pending reason is the useful field:
Resources — the request is legal, the machine is busy. Waiting is correct.Priority — legal, but other jobs are ahead. Also waiting.PartitionNodeLimit, PartitionTimeLimit — the request exceeds what the
partition allows. This will never start. Fix the request and resubmit.QOSMaxJobsPerUserLimit — you are at your own limit; earlier jobs must finish.DependencyNeverSatisfied — the dependency cannot be satisfied. Inspect
the failed predecessor and report recovery options; cancel only when requested.clio-slurm:slurm_list filters by user, state and partition, and reports
explicit truncation — a truncated list is not the whole queue, so do not draw
conclusions about totals from it.
clio-slurm:slurm_cancel requires confirm_job_id to repeat job_id exactly.
A missing or mismatched confirmation is rejected before scancel is called at
all. This is deliberate: cancellation is not recoverable, and the echo is what
stops a wrong ID from ending someone else's run.
srun.slurm_list as a complete picture of the queue.Names such as clio-hdf5:open_file identify a server and its tool in this
guide. Your agent may expose a different prefix. Match the server and tool
against its live MCP inventory, then use the advertised name and input schema.
If a required server is unavailable, report it before attempting the workflow.
Check target partition limits, working directory, executable, task/thread layout and output paths. For submitted work, report native job ID, state/reason, exit status and expected output. Resolve cancellation targets explicitly; only cancel when requested.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub iowarp/clio-kit --plugin clio-hpc-skills3 skills in this plugin
/cluster-runUse when resolving Spack software, configuring a JARVIS pipeline and following its execution. Triggers on "run this on the cluster", "JARVIS pipeline", "install and run". Not for handwritten batch scripts; use slurm-script./software-environmentUse when checking installed Spack packages and available or saved module environments. Triggers on "module avail", "which MPI", "is this installed". Not for executing a workload; use cluster-run.Other plugins' skills for the same job