-
Notifications
You must be signed in to change notification settings - Fork 192
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SlurmScheduler
: Make detailed job info fields dynamic (#6270)
The `SlurmScheduler` plugin uses SLURM's `sacct` command to retrieve detailed information for a given job. The command allows to specify which fields should be projected using the `--format` option. The fields to use were hardcoded by the plugin. This approach made the plugin susceptible to breaking if the supported fields would change. This happened for example for SLURM v23.02, where the `Reserved` field was renamed to `Planned`, see this change log: https://github.com/SchedMD/slurm/blob/863ead570d450e25022f04cc5c9cfb379aa8ae4d/RELEASE_NOTES#L181C1-L182C40 This caused the `sacct` command to return an error and the detailed job info would not be retrieved. To make the plugin more robust with respect to these kinds of changes, the fields are no longer hardcoded, but they are determined dynamically by calling `sacct --helpformat` in a sub shell. This prints a table of the supported fields by the SLURM version that is interacted with. Using `tr`, this table is transformed into a single comma-delimited list, which is the format expected by `--format`. There is also the `--long` option that would provide a large number of fields, however, it is not complete and more than 50 fields are not included. So although it would be a more robust solution, we would be losing a lot of information, some of which could be important for later debugging and analysis, so we stick with the original solution.
- Loading branch information
Showing
2 changed files
with
15 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters