Understanding resource usage
This lecture helps you to optimize your resource
usage in CSC’s HPC environment.
One resource type will be a bottleneck
- A single node can host many jobs from different users
- Different jobs need different resources
- Typically, the cores run out before the memory does
- Sometimes a job uses only one core, but will consume all memory
- No further jobs will fit in the node
- If the job is not using the memory (just reserving it),
resources are wasted
Slurm accounting: batch job resource usage 1/2
- Resource usage can be queried with
seff <slurm jobid>
- Points to pay attention to:
- Low CPU Efficiency:
- Too many cores requested?
- Cores waiting for other processes?
- Cores waiting for data from disk?
- Cores spread over too many nodes?
- Low Memory Efficiency:
- Too much memory requested?
- Lots of caveats here
- Low GPU efficiency:
- Better to use CPUs? Disk I/O?
Slurm accounting: batch job resource usage 2/2
- Not all usage is captured by Slurm accounting
- If CPU efficiency seems too low, look at the completion time
- Some applications also print timing data in log files
- Jobs launched without
srun don’t record properly
(e.g. orterun)
- More detailed queries can be tailored with
sacct
sacct -j <slurm jobid> -o jobid,partition,state,elapsed,start,end
sacct -S 2025-01-01 will show all jobs started after
that date
- Note! Querying data from the Slurm accounting database with
sacct can be a very heavy operation
- Don’t query long time intervals or run
sacct in a loop/using watch as this will
degrade the performance of the system for all users
Billing Units
- CPU time and storage space consume CPU and Storage Billing Units,
respectively
- BUs are a property of computing projects, not users
- Monitor the BU usage of your project(s) from the command-line with
csc-projects
- For help/options, try
csc-projects -h
- Batch job billing scheme:
- Amount of resources allocated: All requested resources are billed,
i.e. number of cores, amount of memory, NVMe, …
- Time allocated: Resources are billed based on the actual (wall)
time a job has used, not the reserved maximum
time
Applying for Billing Units
BUs are also a metric for comparing usage efficiency
- Different resources have different rates
- 1 CPU core hour on Roihu equals 0.75 CPU BU
- 1 GPU card hour on Roihu equals 200 GPU BU
- 1 CPU node hour on Roihu equals 288 CPU BU
- 1 GiB hour of Memory on Roihu equals 0.375 CPU BU
- 1 TiB hour of disk quota (
/scratch) on Roihu equals 6
Storage BU
- 1 used TiB hour in Allas equals 1.05 Storage BU (i.e. 1 TiB of data
consumes 9198 Storage BU per year)
- This and other
service billing information in Docs CSC
Before starting large-scale calculations
- Check how the software and your actual input performs
- Common job errors are caused by typos in batch/input scripts
- Use short runs in the queue
--partition=test to check
that the input works and that the resource requests are interpreted
correctly
- Check the output of the
seff command to ensure that CPU
and memory efficiencies are as high as possible
- It’s OK if a job is (occasionally) killed due to insufficient
resource requests: just adjust and rerun/restart
- It’s much worse to always run with excessively large
requests “just in case”
Parallelizing your workflow
- There are multiple ways to parallelize your workflow
- Maybe several smaller jobs are better than one large (task
farming)?
- Is there a more efficient code or algorithm?
- Is the file I/O slowing you down (lots of read/write
operations)?
- Optimize usage considering single job wall-time, overall used CPU
time, I/O
- Docs
CSC: Guidelines for high-throughput computing
Reserving and optimizing batch job resources
- Important resource requests that should be monitored with
seff are:
seff examples
- Left: GPU usage ok! (for this example other metrics also
ok)
- Bottom: CPU usage way too low, memory usage too high, job
killed