Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slurm collector: Add more options to select jobs in sacct command #472

Closed
QuantumDancer opened this issue Sep 21, 2023 · 0 comments · Fixed by #511
Closed

Slurm collector: Add more options to select jobs in sacct command #472

QuantumDancer opened this issue Sep 21, 2023 · 0 comments · Fixed by #511

Comments

@QuantumDancer
Copy link
Contributor

When calling sacct, we currently can only select jobs based on the job state.

let args = vec![
"-a".to_string(),
"--format".to_string(),
KEYS.iter().map(|k| k.name.clone()).join(","),
"--noconvert".to_string(),
"--noheader".to_string(),
"-S".to_string(),
format!("{}", lastcheck.format("%Y-%m-%dT%H:%M:%S")),
"-E".to_string(),
"now".to_string(),
"-s".to_string(),
CONFIG.job_status.join(","),
"-P".to_string(),
];

To reduce the load on the slurm database, we should also provide the functionality to filter on additional fields, like the partition, user, group, and account.

Relevant lines of the current config look like this

job_status:  # A list of acceptable job states
  - "completed"
  - "failed"
  - "node_fail"

I propose that we change the format of the config slightly, collecting all filter options in one section:

job_filter:
  status:
    - "completed"
    - "failed"
    - "node_fail"
  partition:
    - "partition1"
    - "partition2"
  user:
    - "user1"
    - "user1"
  group:
    - "group1"
    - "group2"
  account:
    - "account1"
    - "account2"

The status filter should remain mandatory (as we always want to filter out pending and running jobs). The other filters should be optional.

The filters should then be translated to the corresponding options for the sacct command:

-r, --partition
          Comma separated list of partitions to select jobs and job steps from. The default is all partitions.
-A, --accounts=<account_list>
          Displays jobs when a comma separated list of accounts are given as the argument.
-u, --uid=, --user=<uid_or_user_list>
          Use this comma separated list of UIDs or user names to select jobs to display.  By default, the running user's UID is used.
-g, --gid=, --group=<gid_or_group_list>
          Displays the statistics only for the jobs started with the GID or the GROUP specified by the gid_list or the group_list operand, which is a comma-separated list.  Space characters are not allowed.  Default is no restrictions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant