# slurm-workload-manager > Build, configure, run, and test the Slurm Workload Manager from this repository. Trigger when asked to compile Slurm, generate slurm.conf/slurmdbd.conf, start daemons locally, submit or debug jobs, run the test suite, or answer how to use Slurm commands and plugins. - Author: Siyu Liu - Repository: IntelligentMat/Materials-Science-Skills-For-LLM - Version: 20251221161123 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/IntelligentMat/Materials-Science-Skills-For-LLM - Web: https://mule.run/skillshub/@@IntelligentMat/Materials-Science-Skills-For-LLM~slurm-workload-manager:20251221161123 --- --- name: slurm-workload-manager description: Build, configure, run, and test the Slurm Workload Manager from this repository. Trigger when asked to compile Slurm, generate slurm.conf/slurmdbd.conf, start daemons locally, submit or debug jobs, run the test suite, or answer how to use Slurm commands and plugins. --- # Slurm Workload Manager Use this skill whenever working with this repo to build or operate Slurm locally for demos, dev, or docs lookups. ## Quick Entry Points - **Need the right guide?** See `references/doc-map.md` for which doc to open. - **Need a config quickly?** Start from `references/minimal-slurm.conf.md` and adjust hostnames/paths. - **Need commands?** `references/cli-cheatsheet.md` lists the common Slurm CLI patterns. ## Prereqs (dev box) - Linux host with `gcc`, `make`, `python3`, `munge` libs; install dev headers for optional plugins as needed. - Ensure consistent UID/GID across nodes if testing multi-node (see quickstart_admin.shtml). - For local single-node demo, you can run all daemons on one host. ## Build From Source (local, single prefix) 1) In repo root: `./configure --prefix=/usr/local --sysconfdir=/etc/slurm` (add plugin enables as needed). If reconfiguring, run `./configure` again; `autoreconf` only if Makefile.am changed. 2) Compile: `make -j$(nproc)`. 3) Optional quick unit tests: `make check` (uses Check; no daemons needed). 4) Install: `sudo make install` (or use DESTDIR for staging). ## Minimal Runtime Setup (single node) 1) Copy `etc/slurm.conf.example` to `/etc/slurm/slurm.conf`; trim partitions/nodes to your host; set `SlurmUser`, `StateSaveLocation`, `SlurmdSpoolDir`, `LogFile` paths that exist and are writable. 2) If using accounting, copy `etc/slurmdbd.conf.example` to `/etc/slurm/slurmdbd.conf`; set MySQL creds and `PidFile/LogFile` dirs. 3) Ensure `munge` is installed and `munged` running; same `munge.key` across nodes. 4) Create needed dirs (`/var/log/slurm`, `/var/spool/slurmctld`, `/var/spool/slurmd`, etc.) and chown to `SlurmUser`. 5) Start daemons (order): `slurmdbd` (if used), `slurmctld`, `slurmd`. For systemd, enable services from generated unit files in `etc/*.service.in` after install. ## Submitting and Inspecting Jobs - Allocate interactive shell: `salloc -N1 -n1 --time=5:00 bash` then run `srun hostname`. - Batch job: `sbatch job.sh` where script contains `#!/bin/bash` and `srun ...` lines. - Status: `sinfo` (nodes/partitions), `squeue` (jobs), `sacct` (history with accounting enabled). - Cancel: `scancel `. ## Debugging - Logs: see `LogFile` paths from configs; tail `slurmctld.log`, `slurmd.log`, `slurmdbd.log`. - Check daemon status: `scontrol ping`, `scontrol show daemons`, `scontrol show slurmd`. - Validate config: `scontrol reconfigure` after edits; `slurmctld -t` for dry-run parse. - Common issues: wrong `munge` state, mismatched `SlurmctldPort/SlurmdPort`, missing writable dirs, hostname mismatch with `NodeName`. ## Running Test Suites - Unit tests: `make check` in repo root (no install required). - Expect tests: install & start daemons, then `cd testsuite/expect` and run `./regression.py` or individual `testX.Y`. Set overrides in `testsuite/expect/globals.local` (e.g., `slurm_dir`, `slurm_conf`, account info). - Pytest harness: see `testsuite/pytest/README` if present; ensure daemons running and QA deps installed. ## When Editing Slurm Code - Follow Linux kernel C style (see programmer_guide.shtml#Source-Code). - After adding files, update relevant `Makefile.am` and run `autoreconf` then `./configure`. - For plugins, reference `doc/html/plugins.html` for required API hooks and registration macros. ## References Open only as needed: - `references/doc-map.md` – which repo docs cover what. - `references/minimal-slurm.conf.md` – trimmed single-node config skeleton. - `references/cli-cheatsheet.md` – top commands with examples.