I use the following horrible little shell function to give me a reasonable list of currently pending jobs in a partition, and the order they’re likely to run in (as well as individual
users’ priorities):
_users_waiting() {
squeue "$@" -t PD -h -O UserName | sort -u | tr -d ' ' | tr '\012' ',' | sed 's/,$//'
}
priority_in_queue() {
local users=$(_users_waiting "$@")
echo "User Fairshare"
echo "=============="
sshare -U -u "$users"
echo
echo "Pending Job Priorities"
echo "======================"
sprio "$@" -S "-y" -u "$users" -o "%.8i %9r %.8u %.8o %.8Y %.6A %.10F %.10J %.9P %.7n %.6Q %.30T"
}
Tim Cutts
Scientific Computing Platform Lead
AstraZeneca
Find out more about R&D IT Data, Analytics & AI and how we can support you by visiting our Service
Catalogue |
From:
Paul Edmon via slurm-users <slurm-users@lists.schedmd.com>
Date: Tuesday, 29 October 2024 at 2:09 PM
To: slurm-users@lists.schedmd.com <slurm-users@lists.schedmd.com>
Subject: [slurm-users] Re: Slurm Job Sched Priority
If you are looking to use the C API for this then showq may be a good guide:
https://github.com/fasrc/slurm_showq The -o option orders the pending queue in priority order.
If you are looking at native slurm commands, sprio can print out the current priority breakdown of any job and filter by partition, then you can reorder based on that. squeue also can print out current priority. You might also look at the --priority option:
https://slurm.schedmd.com/squeue.html#OPT_priority
-Paul Edmon-
On 10/29/24 9:33 AM, Bhaskar Chakraborty via slurm-users wrote:
Is there any DS in slurmctld which portrays the dynamic relative priority of pending jobs?
We are trying to use slurm for developing a scheduling solution and 1 of the problems we face at the outset is how to determine
the order of scheduling for pending jobs.
One option is to find scheduling iteration window begin & close pointers & cache the job ids as seen in order & then make them the priority order at that point of time.
( This means for 500 pending jobs, say, if we can find which are the slurmctld calls which mark the beginning & end of a sched iteration then we can use the scheduling order
of jobs as the relative priority order for that period of time, of course it may change depending on fairshare, user initiated priority modification etc. )
A concrete existing data structure showing the dynamic priority itself from slurmctld would be handy.
AstraZeneca UK Limited is a company incorporated in England and Wales with registered number:03674842 and its registered office at 1 Francis Crick Avenue, Cambridge Biomedical Campus, Cambridge,
CB2 0AA.
This e-mail and its attachments are intended for the above named recipient only and may contain confidential and privileged information. If they have come to you in error, you must not
copy or show them to anyone; instead, please reply to this e-mail, highlighting the error to the sender and then immediately delete the message. For information about how AstraZeneca UK Limited and its affiliates may process information, personal data and
monitor communications, please see our privacy notice at
www.astrazeneca.com