Skip to content

Commit

Permalink
flux-resource: use expandable formats in flux resource list
Browse files Browse the repository at this point in the history
Problem: The fixed width of the queue field in `flux resource list`
causes confusion for users with overlapping queues because the queues
are joined into a comma separated list and truncation could cause
some queues to be completely left out of the field.

Now that the OutputFormat class supports "expandable" fields, use this
with the `queue` field in `flux resource list` so that no truncation
is guaranteed without using a large width by default.

Also apply the expandable field to ngpus to save some horizontal
space in the common case.
  • Loading branch information
grondo committed Sep 15, 2024
1 parent bc648ca commit f33efbf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/cmd/flux-resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,15 @@ class FluxResourceConfig(UtilConfig):
"default": {
"description": "Default flux-resource list format string",
"format": (
"{state:>10} ?:{queue:<10.10} ?:{propertiesx:<10.10+} {nnodes:>6} "
"{ncores:>8} ?:{ngpus:>8} {nodelist}"
"{state:>10} ?+:{queue:<5} ?:{propertiesx:<10.10+} {nnodes:>6} "
"+:{ncores:>6} ?+:{ngpus:>5} {nodelist}"
),
},
"rlist": {
"description": "Format including resource list details",
"format": (
"{state:>10} ?:{queue:<8.8} ?:{propertiesx:<10.10+} {nnodes:>6} "
"{ncores:>8} {ngpus:>8} {rlist}"
"{state:>10} ?+:{queue:<5} ?:{propertiesx:<10.10+} {nnodes:>6} "
"+:{ncores:>6} ?:+{ngpus:>5} {rlist}"
),
},
}
Expand Down

0 comments on commit f33efbf

Please sign in to comment.