Skip to content

Policies & Priority

Exercises

  1. View priority breakdown for pending jobs

Use sprio to examine the multifactor priority components for all pending jobs. Identify which factor (Age, Fairshare, JobSize, Partition, QOS) is contributing the most to each job's priority score.

Hint / Solution
# Show priority breakdown for all pending jobs
sprio -l

# Show normalized (0.0-1.0) priority factors for easier comparison
sprio -n -l

# Show priority for a specific user's pending jobs
sprio -u jsmith -l

# Compare with sshare to see fairshare standings
sshare -a -l
Expected output: Validated 2026-04-15 on slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sprio -l
          JOBID PARTITION     USER  ACCOUNT   PRIORITY       SITE        AGE      ASSOC  FAIRSHARE    JOBSIZE  PARTITION    QOSNAME        QOS        NICE                 TRES

$ sprio -n -l
          JOBID PARTITION     USER  ACCOUNT PRIORITY   AGE        ASSOC      FAIRSHARE  JOBSIZE    PARTITION  QOSNAME    QOS        TRES                

$ sshare -a -l | head -10
Account                    User  RawShares  NormShares    RawUsage   NormUsage  EffectvUsage  FairShare    LevelFS                    GrpTRESMins                    TRESRunMins 
-------------------- ---------- ---------- ----------- ----------- ----------- ------------- ---------- ---------- ------------------------------ ------------------------------ 
root                                          0.000000        7187                  1.000000                                                      cpu=0,mem=0,energy=0,node=0,b+ 
 root                      root          1    0.006579           0    0.000000      0.000000   1.000000        inf                                cpu=0,mem=0,energy=0,node=0,b+ 
 pcdefault                               1    0.006579        6889    0.958455      0.958455              0.006864                                cpu=0,mem=0,energy=0,node=0,b+ 
  pcdefault            ec2-user          1    0.500000        6889    0.958455      1.000000   0.250000   0.500000                                cpu=0,mem=0,energy=0,node=0,b+ 
  pcdefault               slurm          1    0.500000           0    0.000000      0.000000   0.500000        inf                                cpu=0,mem=0,energy=0,node=0,b+ 
 research                               50    0.328947         298    0.041545      0.041545              7.917862                                cpu=0,mem=0,energy=0,node=0,b+ 
  research            testuser1          1    1.000000         298    0.041545      1.000000   0.750000   1.000000                                cpu=0,mem=0,energy=0,node=0,b+ 
 training                              100    0.657895           0    0.000000      0.000000                   inf                                cpu=0,mem=0,energy=0,node=0,b+ 
  1. Create a test reservation

Create a short maintenance reservation on a single node for 30 minutes starting 1 hour from now. Verify the reservation exists, then delete it when done.

Hint / Solution
# Create a 30-minute reservation starting 1 hour from now
scontrol create reservation ReservationName=maint_test \
    StartTime=now+3600 Duration=00:30:00 \
    Nodes=cpu001 Users=root Flags=MAINT,IGNORE_JOBS

# Verify the reservation
scontrol show reservation maint_test

# List all reservations
scontrol show reservations

# Clean up — delete the test reservation
scontrol delete ReservationName=maint_test
Expected output: Validated 2026-04-15 on slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sudo /opt/slurm/bin/scontrol create reservation ReservationName=val_pp_resv        StartTime=now+3600 Duration=00:30:00        Nodes=debug-dy-small-1 Users=ec2-user Flags=MAINT,IGNORE_JOBS
Reservation created: val_pp_resv

$ scontrol show reservation val_pp_resv
ReservationName=val_pp_resv StartTime=2026-04-15T03:01:06 EndTime=2026-04-15T03:31:06 Duration=00:30:00
   Nodes=debug-dy-small-1 NodeCnt=1 CoreCnt=2 Features=(null) PartitionName=(null) Flags=MAINT,IGNORE_JOBS,SPEC_NODES
   TRES=cpu=2
   AllowedPartitions=(null) QOS=(null)
   Users=ec2-user Groups=(null) Accounts=(null) Licenses=(null) State=INACTIVE BurstBuffer=(null)
   MaxStartDelay=(null)

$ sudo /opt/slurm/bin/scontrol delete ReservationName=val_pp_resv
  1. Check backfill scheduler status

Use sdiag to examine the scheduler's backfill statistics. Determine how many backfill cycles have run, the average cycle time, and whether any backfill cycles are taking too long (which can indicate configuration issues).

Hint / Solution
# Show full scheduler diagnostics
sdiag

# Key sections to look for:
#   Main schedule statistics — how often the main scheduler runs
#   Backfilling stats — cycle count, last cycle time, max cycle time
#
# Warning signs:
#   - Last cycle (usec) > 1,000,000 (1 second) — backfill is slow
#   - Backfilled jobs since start = 0 — backfill may be disabled
#   - Total backfilled jobs (since last stats cycle reset) growing slowly

# Reset statistics (useful after config changes)
sdiag -r
Expected output: Validated 2026-04-15 on slurm-training-val (Slurm 25.11.4, ParallelCluster 3.15.0).
$ sdiag | head -40
*******************************************************
sdiag output at Wed Apr 15 02:01:06 2026 (1776218466)
Data since      Wed Apr 15 02:01:02 2026 (1776218462)
*******************************************************
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: 1
Jobs started:   0
Jobs completed: 0
Jobs canceled:  1
Jobs failed:    0

Job states ts:  Wed Apr 15 02:01:02 2026 (1776218462)
Jobs pending:   0
Jobs running:   0

Main schedule statistics (microseconds):
 Last cycle:   9
 Max cycle:    16
 Total cycles: 2
 Mean cycle:   12
 Mean depth cycle:  0
 Last queue length: 0

Main scheduler exit:
 End of job queue: 2
 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

References