Diagnose SLURM jobs not coming off queue
Sometimes jobs on the queue on SLURM take longer than expected to start. Here's
some things to check to see if the issue is due to low priority from running
many jobs previously.
# List what you're running
# jobid, name, state, time, time limit, cpus, min memo, nodelist(reason)
squeue -u $USER -o "%.12i %.24j %.2t %.10M %.10l %.4C %.8m %R"
# Counts by state
squeue -u $USER -h -o "%T %j" | awk '{print $1}' | sort | uniq -c
# How long recent jobs took and their peak memory
sacct -u $USER -S now-2hours -P -n -o JobID,State,Elapsed,MaxRSS | \
awk -F'|' '$2 == "COMPLETED" && $1 ~ /\./' | \
sort -t'|' -k3 -r | head
# The full request for one job (time limit, CPUs, memory, whether it can be requeued, log paths):
scontrol show job <jobid>
# Scheduler weights for queueing the next job
# default_queue_depth sets how many jobs are queued by priority, after
# that, SLURM backfills in jobs
# bf_interval is how often the backfill check runs in seconds
# bf_max_job_user is how many jobs per user is checked during the backfill check
scontrol show config | grep -E "SchedulerParameters|PriorityWeight"
# Check priority for a job
sprio -l -j <jobid>
# Check your fair-share standing
# 1.0 is maximum
sshare -l -U -u $USER
# See what jobs are ahead of me
squeue -p defq -t PD --sort=-p -o "%.10i %.8u %.10Q %.5C %.8m %.10l %R" | \
grep -E "\((Priority|Resources)\)" | head -15
# See what room is left
# %C: CPUs allocated, idle, other, total
# %N: node names
# %e: total free memory in MB
sinfo -p defq -o "%C"
sinfo -p defq -N -o "%N %C %e"
squeue reasons
- Priority
- Other people's jobs rank higher than mine
- Check priority and fair-share
- Resources
- My job is next but there's not enough resources
- Either wait or reduce request
- QOSMaxCpuPerUserLimit
- Per-user CPU cap hit
- Will need to free up cores
- JobArrayTaskLimit
- I set a throttle on an array
scontrol updated JobID=<jobid> ArrayTaskThrottle=N(0 removes limit)
- Dependency/DependencyNeverSatisfied
- Waiting on another job to finish
- Check/cancel upstream job