Ticket 5353 - sinfo/squeue: display parseable output with configurable delimiter
Summary: sinfo/squeue: display parseable output with configurable delimiter
Status: OPEN
Alias: None
Product: Slurm
Classification: Unclassified
Component: User Commands (show other tickets)
Version: 17.11.7
Hardware: Linux Linux
: 5 - Enhancement
Assignee: Unassigned Developer
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2018-06-26 08:40 MDT by Jeff Frey
Modified: 2019-01-04 14:01 MST (History)
1 user (show)

See Also:
Site: -Other-
Slinky Site: ---
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
Google sites: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed:
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments
"git diff master" against the change branch (18.94 KB, patch)
2018-06-26 08:40 MDT, Jeff Frey
Details | Diff

Note You need to log in before you can comment on or make changes to this ticket.
Description Jeff Frey 2018-06-26 08:40:38 MDT
Created attachment 7187 [details]
"git diff master" against the change branch

When requesting node/queue/job information using the sinfo and squeue utilities, the fixed-width display of the information is undesirable for machine-parsed cases (see also the primary request in bug 1804). For long-format arguments, using zero-width runs the fields together:

    $ sinfo --Format="nodeaddr:0,cpus:0"
    NODE_ADDRCPUS
    r00n0236
    r00n0336
       :

Using short --format would work, but not every data point available via long-format tags are available in the short format.

This patch implements two new CLI flags to the sinfo and squeue utilities that can be used to produce machine-parseable output.

  - added -D/--delimiter=<DELIM>
    - print a static string between each field displayed
  - added --parseable
    - all fields zero width (print entire thing)
    - w/o explicit -D/--delimiter, a "|" delimiter is implied
  - augmented long-format field name parsing to allow trailing suffixes
    - <field-name>[:[.][<width>][<suffix>]]
    - Example: --Format="nodeaddr:0|,features:0:,cpus:0"

    $ sinfo --Format="nodeaddr:0|,features:0:,cpus:0"
    NODE_ADDR|AVAIL_FEATURES:CPUS
    r00n02|E5-2695,E5-2695v4:36
    r00n03|E5-2695,E5-2695v4:36
       :

  - miscellaneous other fixes
    - addressed leaking list iterators in print functions (early return on error)