Skip to content

[Feature]: Push user filtering to squeue instead of fetching the whole cluster #33

Description

@fedonman

Feature Summary

build_args always passes --all --states=all and never --user, because user filtering is done client-side with a regex. So someone watching their own three jobs still pulls every job on the cluster from slurmctld every refresh, parses it, and throws almost all of it away.

Motivation / Use Case

Polling squeue --all --states=all in a loop is the specific pattern HPC admins ask users not to run, because slurmctld serialises the whole job list for every caller. One sqwatch user is nothing, a lab of twenty at the default 3 second interval is measurable load on a busy controller, and the tool has no way to know it is doing this.

The client pays too. On a 50,000-job cluster every refresh decodes 50,000 rows into a Vec<Job>, allocating a String per non-empty cell, retains them down to three, then rebuilds the mark and cursor mapping over the survivors, three times a minute, to display three rows.

Proposed Solution

The rule is to send a filter to the server whenever it is expressible there, and keep the regex path for when it is not. --partition, --qos, --nodelist and --states are already pushed server-side; only user and name_pattern are held back, and both for the same reason, that squeue --user takes a list of names rather than a pattern.

Push a plain username. When params.user contains no regex metacharacters, which covers the overwhelmingly common case of typing your own name, pass --user <name> and skip the client-side regex for that field. A pattern that might be a regex takes the slow path, which is honest and cheap to decide.

Default to the current user. login_user is already read from $USER and shown in the titlebar, but it never reaches the query. A first run that shows your own jobs is both a better default and a far smaller query. Keep a config key so a site that wants the cluster-wide view has it, and surface the setting in the sidebar so it is discoverable rather than mysterious.

Reconsider --states all. It is there so completed and failed jobs stay visible, which is genuinely useful, but it widens the query past squeue's own default of pending plus running, and it should be a visible choice rather than an invisible one.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendTouches the backend layer: squeue, scontrol, sinfo, scancel and their parsingenhancementNew feature or request

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions