Monitoring & Accounting
Exercises¶
- Generate a cluster utilization report
Use sreport to produce an overall cluster utilization report for the current month. Identify the percentage of CPU time that was allocated vs. idle.
Hint / Solution
# Overall cluster utilization
sreport cluster utilization start=2026-04-01
# Output shows columns: Allocated, Down, PLND Down (planned), Idle, Reserved, Reported
# Allocated / Reported = utilization percentage
# Break down by partition
sreport cluster utilization start=2026-04-01 -t percent
slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sreport cluster utilization start=now-7days
--------------------------------------------------------------------------------
Cluster Utilization 2026-04-08T02:00:00 - 2026-04-15T00:59:59
Usage reported in CPU Minutes
--------------------------------------------------------------------------------
Cluster Allocate Down PLND Dow Idle Planned Reported
--------- -------- -------- -------- -------- -------- --------
slurm-tr+ 286 410 109206 7404 505 117811
- Find the top 5 users by CPU hours
Generate a report showing the five heaviest CPU consumers this month. Include both their CPU hours and the account they charged to.
Hint / Solution
sreport user TopUsage start=2026-04-01 --tres=cpu TopCount=5
# For GPU hours instead:
sreport user TopUsage start=2026-04-01 --tres=gres/gpu TopCount=5
# For a specific account's users only:
sreport user TopUsage start=2026-04-01 --tres=cpu TopCount=5 Accounts=smith_lab
slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sreport user TopUsage start=now-7days --tres=cpu TopCount=5
--------------------------------------------------------------------------------
Top 5 Users 2026-04-08T02:00:00 - 2026-04-15T00:59:59 (601200 secs)
Usage reported in TRES Minutes
--------------------------------------------------------------------------------
Cluster Login Proper Name Account TRES Name Used
--------- --------- --------------- --------------- -------------- --------
slurm-tr+ ec2-user AWS ParallelCl+ pcdefault cpu 281
slurm-tr+ testuser1 research cpu 5
- Check scheduler health with sdiag
Run sdiag and assess the scheduler's performance. Determine the mean scheduling cycle time, how many jobs have been backfilled, and whether the agent queue is healthy.
Hint / Solution
sdiag
# Key things to check:
# 1. "Mean cycle" under "Main schedule statistics" -- should be well under 1,000,000 us (1 second)
# 2. "Total backfilled jobs" -- a healthy number indicates backfill is working
# 3. "Agent queue size" -- should be 0 or near 0; high values mean communication delays
# 4. "Last cycle" timestamp -- should be very recent
# Reset stats to track from a known point:
sdiag --reset
slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sdiag
*******************************************************
sdiag output at Wed Apr 15 02:00:43 2026 (1776218443)
Data since Wed Apr 15 02:00:38 2026 (1776218438)
*******************************************************
Server thread count: 1
RPC queue enabled: 0
Agent queue size: 0
Agent count: 0
Agent thread count: 0
DBD Agent queue size: 0
Jobs submitted: 0
Jobs started: 0
Jobs completed: 0
Jobs canceled: 0
Jobs failed: 0
Job states ts: Wed Apr 15 02:00:38 2026 (1776218438)
Jobs pending: 0
Jobs running: 0
Main schedule statistics (microseconds):
Last cycle: 14
Max cycle: 14
Total cycles: 1
Mean cycle: 14
Mean depth cycle: 0
Last queue length: 0
Main scheduler exit:
End of job queue: 1
Hit default_queue_depth: 0
Hit sched_max_job_start: 0
Blocked on licenses: 0
Hit max_rpc_cnt: 0
Timeout (max_sched_time): 0
Backfilling stats
Total backfilled jobs (since last slurm start): 0
Total backfilled jobs (since last stats cycle start): 0
Total backfilled heterogeneous job components: 0
Total cycles: 0
Last cycle when: Wed Apr 15 01:50:33 2026 (1776217833)
Last cycle: 0
Max cycle: 0
Last depth cycle: 0
Last depth cycle (try sched): 0
Last queue length: 0
Last table size: 0
Backfill exit
End of job queue: 0
Hit bf_max_job_start: 0
Hit bf_max_job_test: 0
System state changed: 0
Hit table size limit (bf_node_space_size): 0
Timeout (bf_max_time): 0
Latency for 1000 calls to gettimeofday(): 29 microseconds
Remote Procedure Call statistics by message type
REQUEST_PARTITION_INFO ( 2009) count:12 ave_time:63 total_time:760
REQUEST_NODE_INFO ( 2007) count:11 ave_time:177 total_time:1948
REQUEST_UPDATE_NODE ( 3002) count:4 ave_time:133 total_time:532
MESSAGE_NODE_REGISTRATION_STATUS ( 1002) count:3 ave_time:147 total_time:443
REQUEST_PING ( 1008) count:3 ave_time:45 total_time:136
REQUEST_BUILD_INFO ( 2001) count:2 ave_time:130 total_time:261
Remote Procedure Call statistics by user
ec2-user ( 1000) count:17 ave_time:92 total_time:1570
root ( 0) count:10 ave_time:126 total_time:1261
pcluster-admin ( 400) count:8 ave_time:156 total_time:1249
Pending RPC statistics
No pending RPCs
- Find jobs that exceeded their memory request
Use sacct to find completed jobs from the past 7 days where the actual peak memory usage (MaxRSS) was close to or exceeded the requested memory. Identify jobs that were killed by OOM.
Hint / Solution
# Find jobs killed by OOM directly
sacct --starttime=now-7days --state=OUT_OF_MEMORY \
--format=JobID,User,JobName,ReqMem,MaxRSS,Elapsed,State,ExitCode
# Find completed jobs where MaxRSS was high relative to request
# (look for jobs where MaxRSS approaches ReqMem)
sacct --starttime=now-7days --state=COMPLETED \
--format=JobID%-12,User%-10,JobName%-20,ReqMem,MaxRSS,Elapsed \
| sort -k5 -h | tail -20
# Find jobs killed by signal 9 (SIGKILL -- often OOM even if not tagged)
sacct --starttime=now-7days \
--format=JobID,User,JobName,State,ExitCode | grep "0:9"
slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sacct --starttime=now-7days --state=OUT_OF_MEMORY --format=JobID,User,JobName,ReqMem,MaxRSS,Elapsed,State,ExitCode
JobID User JobName ReqMem MaxRSS Elapsed State ExitCode
------------ --------- ---------- ---------- ---------- ---------- ---------- --------
$ sacct --starttime=now-7days --state=COMPLETED --format=JobID%-12,User%-10,JobName%-20,ReqMem,MaxRSS,Elapsed | head -10
JobID User JobName ReqMem MaxRSS Elapsed
------------ ---------- -------------------- ---------- ---------- ----------