Files
cheatsheet-tldr/tldr/srun
2025-10-04 00:17:43 +00:00

30 lines
597 B
Plaintext

---
syntax: markdown
tags: [tldr, common]
source: https://github.com/tldr-pages/tldr.git
---
# srun
> Run a command under the Slurm workload manager.
> More information: <https://slurm.schedmd.com/srun.html>.
- Run a simple command interactively:
`srun hostname`
- Run a job with 4 tasks (CPUs):
`srun {{[-n|--ntasks]}} 4 {{path/to/program}}`
- Allocate 8 GB of memory:
`srun --mem 8G {{path/to/program}}`
- Run a job on a specific partition:
`srun {{[-p|--partition]}} gpu {{path/to/program}}`
- Run a job and save the output to a file:
`srun {{path/to/program}} > {{path/to/output}}`