/knowledge/notes/running-jobs-on-spartan
Concept note · Cluster & Cloud
Running Jobs on Spartan
HPC Job Submission
- Studied
- Cluster and Cloud ComputingCOMP90024
- When
- 2023 S1
- Applied in
- Assignment 1
- Read / Refreshed
- ~5 min read2026-10-15
Spartan is the University of Melbourne's HPC cluster. Jobs are submitted as scripts describing resources, duration, and the command to run. This note covers the minimal knowledge to write a working SLURM script and understand queue behaviour.
01
The idea
Spartan uses SLURM (Simple Linux Utility for Resource Management) to schedule jobs. You write a shell script with resource directives (lines starting with #SBATCH) that tell the scheduler how many cores, how much memory, and how long you need. You submit it with sbatch script.sh, and it waits in a queue until enough resources are free.
The three most important directives are #SBATCH --nodes (how many physical nodes), #SBATCH --ntasks-per-node (how many processes on each node), and #SBATCH --cpus-per-task (how many cores per process). Their product is your total parallelism.
Understanding the difference between tasks and CPUs matters for hybrid parallelism (e.g., MPI + OpenMP). A job with 4 nodes, 2 tasks per node, and 8 CPUs per task runs 8 processes across 4 nodes, each with 8 threads, using 64 cores total.
02
The maths
This section is not about formulas, but about resource counting. If you request:
--nodes=N--ntasks-per-node=T--cpus-per-task=C
Then SLURM allocates N × T processes, each with access to C CPU cores. Total cores used: N × T × C. If your job is serial (no MPI, no threads), set T=1 and C=1. If you are using OpenMP with 16 threads, set C=16.
03
Try it
The widget below builds a SLURM script. Move the sliders to change nodes, tasks, and CPUs, and the total core count updates instantly. The generated script is ready to copy and submit.
#!/bin/bash #SBATCH --nodes=1 #SBATCH --ntasks-per-node=4 #SBATCH --cpus-per-task=2 #SBATCH --time=60:00 module load python python my_script.py
- For a serial job on one core: 1 node, 1 task, 1 CPU.
- For OpenMP with 16 threads: 1 node, 1 task, 16 CPUs.
- For MPI with 32 processes on 4 nodes: 4 nodes, 8 tasks per node, 1 CPU each.
04
Where I used it
05
Easy to get wrong
06
Sources
- Spartan DocumentationUniversity of Melbourne HPCOfficial Spartan documentation with job submission, resource allocation, and queue information.
- SLURM sbatch ReferenceSchedMDComplete reference for all SLURM sbatch directives and options.
First drafted in 2023, rewritten in 2026.