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.
Feature Summary
build_argsalways passes--all --states=alland 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=allin 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 aStringper 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,--nodelistand--statesare already pushed server-side; onlyuserandname_patternare held back, and both for the same reason, thatsqueue --usertakes a list of names rather than a pattern.Push a plain username. When
params.usercontains 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_useris already read from$USERand 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.