Ticket 9569

Summary: squeue: sorting jobs by partition doesn't work
Product: Slurm Reporter: Luke Yeager <lyeager>
Component: User CommandsAssignee: Director of Support <support>
Status: RESOLVED FIXED QA Contact:
Severity: 4 - Minor Issue    
Priority: --- CC: CPonder, mcmullan
Version: 20.02.4   
Hardware: Linux   
OS: Linux   
Site: NVIDIA (PSLA) Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 20.02.6 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Luke Yeager 2020-08-11 16:28:21 MDT
I'm running these commands to look at the resources consumed by running jobs:

> FORMAT_ACTIVE="jobid:8,userid:14,timelimit:14,timeused:12,partition:13"
> squeue -t R -a -S u -O $FORMAT_ACTIVE    # Sorts by user, to show the hogs.
> squeue -t R -a -S M -O $FORMAT_ACTIVE    # Sorts by time consumed, just for illustration.
> squeue -t R -a -S P -O $FORMAT_ACTIVE    # Sorts by partition name, showing degree of saturation.

The third form doesn't do what it's supposed to, though, it's sorting by time (the same as "-S M") instead of partition name:

    JOBID   UID   TIME_LIMIT TIME    PARTITION
    471890  20016 2:00:00    0:38    interactive
    471834  10007 2:00:00    3:35    backfill
    471868  10030 30:00      3:36    ci-manual
    471822  10030 1:40:00    14:54   ci-manual
    471711  10062 2:00:00    32:31   backfill
    471808  10007 2:00:00    46:29   admin
    471800  10023 4:00:00    57:08   admin
    471676  10062 2:00:00    1:11:26 backfill
    471766  10062 2:00:00    1:16:10 backfill
    471765  10062 2:00:00    1:16:40 backfill
    471767  20022 2:00:00    1:16:40 interactive
    471759  10062 2:00:00    1:23:04 backfill
Comment 1 Colby Ashley 2020-08-12 10:08:18 MDT
Hey Luke,

I may have already found a solution for this one. Let me run some more tests and max sure this fix works.

~Colby
Comment 8 Carl Ponder 2020-11-04 16:20:56 MST
I ran into the same problem trying to sort by JobID:

      squeue -h -S  J -j846819,847010,854468,861880,862137,862139,863129,863148,863234 -O jobid:8
      squeue -h -S +J -j846819,847010,854468,861880,862137,862139,863129,863148,863234 -O jobid:8
      squeue -h -S -J -j846819,847010,854468,861880,862137,862139,863129,863148,863234 -O jobid:8

where the list isn't monotonic up or down.
Also, I would have expected this form

      squeue -h -t PD -j846819,847010,854468,861880,862137,862139,863129,863148,863234 -O jobid:8

to print the information in the same order that I specified in the -j parameter, but it doesn't come out that way.
Comment 9 Colby Ashley 2020-11-05 13:18:33 MST
Hey Carl,

Could you create a new bug. You can just copy paste what you put as your comment in here.

~Colby
Comment 10 Carl Ponder 2020-11-05 14:14:47 MST
Ok opened this bug

      https://bugs.schedmd.com/show_bug.cgi?id=10164

I suspect, though, that the -S problem stems from the same cause as this bug.
Comment 11 Luke Yeager 2020-11-16 17:52:34 MST
Fix confirmed in 20.02.6, thanks.