Slurm logo

Slurm

Organization
AI-ModCon
slurm

Slurm workload manager for HPC batch job scheduling. Use when submitting batch or interactive jobs with sbatch/salloc/srun, monitoring with squeue/sacct/scontrol, cancelling with scancel, writing #SBATCH job scripts, working with job arrays, setting job dependencies, checking fair-share accounting with sacctmgr/sreport, or troubleshooting failed jobs on any Slurm cluster.

Overview

PublisherAI-ModCon
Repositorygenesis-skills
Skill nameslurm
Stars
37
Forks
16
Bundled files
6
LicenseBSD-2-Clause
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 6 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by AI-ModCon on GitHub. Read the source before you install it.

Installation

Install the Slurm AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/AI-ModCon/genesis-skills/tree/main/skills/hpc-skills/slurm
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AI-ModCon/genesis-skills.git /tmp/genesis-skills
mkdir -p .claude/skills
cp -r /tmp/genesis-skills/skills/hpc-skills/slurm .claude/skills/slurm
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Slurm in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Slurm on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Slurm is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Slurm Workload Manager

Slurm is the dominant HPC batch scheduler. Jobs are submitted to queues (partitions), allocated nodes, and run with full or partial node access.

Quick Command Reference

CommandPurpose
sbatch script.shSubmit a batch job script
sallocAllocate nodes for an interactive session
srunRun a parallel job step (inside or outside a batch job)
squeueView pending and running jobs
scontrol show job <id>Detailed job info
scancel <id>Cancel a job
scontrol hold/release <id>Hold or release a pending job
sinfoCluster partition and node status
sacctQuery completed job accounting records
sacctmgrManage accounts, QOS, and allocations

Job State Codes

CodeStateMeaning
PDPENDINGWaiting for resources
RRUNNINGCurrently executing
CGCOMPLETINGCleaning up after execution
CDCOMPLETEDFinished with exit code 0
CACANCELLEDCancelled by user or admin
FFAILEDNon-zero exit code
TOTIMEOUTExceeded time limit
OOMOUT_OF_MEMORYKilled by memory manager
PRPREEMPTEDPreempted by higher-priority job

Writing Job Scripts

Directives go at the top of the script as #SBATCH comments before any executable line.

Minimal working script:

bash
#!/bin/bash
#SBATCH --job-name=myjob
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=32
#SBATCH --time=01:00:00
#SBATCH --account=myproject
#SBATCH --output=myjob_%j.out
#SBATCH --error=myjob_%j.err

module load gcc openmpi
srun ./my_application

Key #SBATCH Directives

DirectiveExampleNotes
--job-namemyjobShown in squeue
--nodes / -N4Number of nodes
--ntasks-per-node128MPI ranks per node
--cpus-per-task / -c4Threads per MPI rank
--time / -t2-00:00:00D-HH:MM:SS or HH:MM:SS
--partition / -pgpuQueue to use
--account / -AmyprojectAllocation to charge
--output / -ojob_%j.outStdout path
--error / -ejob_%j.errStderr path
--gresgpu:4Generic resources (GPUs)
--mem64GMemory per node
--mem-per-cpu4GMemory per CPU core
--exclusive—Reserve entire node(s)
--dependencyafterok:12345Wait for another job
--array0-99Submit job array
--mail-typeEND,FAILEmail notifications
--mail-useruser@hostEmail address

Output Filename Tokens

TokenMeaning
%jJob ID
%AArray parent job ID
%aArray task index
%xJob name
%NFirst node name

Submitting Jobs

bash
# Batch submission
sbatch script.sh

# Override directives at submission
sbatch --nodes=8 --time=4:00:00 script.sh

# Interactive allocation (drops into a shell on allocated node)
salloc --nodes=2 --time=1:00:00 --partition=debug
srun ./my_app          # run within the allocation
exit                   # release allocation

# One-off parallel command (creates its own allocation)
srun --nodes=1 --ntasks=4 ./my_app

Monitoring Jobs

bash
# Your jobs
squeue -u $USER

# All jobs, long format
squeue -l

# Specific job
squeue -j 12345

# Estimated start times for pending jobs
squeue --start -u $USER

# Full detail (reason for pending, TRES, etc.)
scontrol show job 12345

# Live updates every 5 seconds
watch -n5 squeue -u $USER

Reading output files: Slurm writes stdout/stderr when the job finishes (or continuously if --output is to a path). Watch a running job's output:

bash
tail -f myjob_12345.out

After job completes:

bash
sacct -j 12345 --format=JobID,State,Elapsed,MaxRSS,ExitCode

Cancelling and Holding Jobs

bash
scancel 12345                      # cancel by job ID
scancel 12345_5                    # cancel one array element
scancel -u $USER --state=PENDING   # cancel all your pending jobs
scancel -n myjob                   # cancel by name

scontrol hold 12345                # hold a pending job
scontrol release 12345             # release held job

Job Arrays

Run many similar jobs from one submission. Each element gets a unique SLURM_ARRAY_TASK_ID.

bash
#SBATCH --array=0-99             # indices 0..99
#SBATCH --array=1-50:2           # odd indices 1,3,5,...,49
#SBATCH --array=0-999%20         # up to 20 running at once
#SBATCH --output=job_%A_%a.out   # %A=parent ID, %a=task index

Inside the script, use $SLURM_ARRAY_TASK_ID to select input:

bash
INPUT="data/input_${SLURM_ARRAY_TASK_ID}.txt"
srun ./process "$INPUT"

Array management:

bash
squeue -r -j 36           # show all elements
scancel 36                # cancel entire array
scancel 36_[1-5]          # cancel elements 1–5

Job Dependencies

Chain jobs so they start only when a predecessor finishes:

bash
JOB1=$(sbatch stage1.sh | awk '{print $4}')
sbatch --dependency=afterok:$JOB1 stage2.sh

# Common dependency types:
# afterok:<id>    — start only if <id> succeeds
# afterany:<id>   — start regardless of <id> outcome
# afternotok:<id> — start only if <id> fails
# singleton       — only one job with this name runs at a time

Common Environment Variables (Inside a Job)

VariableValue
$SLURM_JOB_IDJob ID
$SLURM_NODELISTList of allocated nodes
$SLURM_NTASKSTotal number of tasks
$SLURM_CPUS_PER_TASKCPUs per task
$SLURM_SUBMIT_DIRDirectory where sbatch was run
$SLURM_ARRAY_JOB_IDParent array job ID
$SLURM_ARRAY_TASK_IDThis element's index

Module System

bash
module avail              # list available modules
module spider <pkg>       # search for a package
module load gcc/12 openmpi/4.1
module list               # show loaded modules
module purge              # unload everything

Always load modules inside the job script, not just in your login shell.

Additional Resources

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Slurm AI skill do?

Slurm workload manager for HPC batch job scheduling. Use when submitting batch or interactive jobs with sbatch/salloc/srun, monitoring with squeue/sacct/scontrol, cancelling with scancel, writing #SBATCH job scripts, working with job arrays, setting job dependencies, checking fair-share accounting with sacctmgr/sreport, or troubleshooting failed jobs on any Slurm cluster.

Why use Slurm on TypingMind?

Because you install it once and use it with any model. Slurm is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Slurm in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/AI-ModCon/genesis-skills/tree/main/skills/hpc-skills/slurm. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Slurm?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Slurm?

As many as you like. As long as a model supports skills, you can use Slurm with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Slurm AI skill free?

Yes. It is published on GitHub by AI-ModCon under the BSD-2-Clause license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇