martius-lab / cluster_utils

https://martius-lab.github.io/cluster_utils/
Other
8 stars 0 forks source link

Refactor sacct output parsing and add unit test #98

Closed luator closed 4 months ago

luator commented 5 months ago

Re-creation of #96 (apparently I can't re-open the old one after a force push...)

Move the parsing of the output of sacct to a separate function, so it can be unit-tested.

I also found out that by adding -X I can limit the output to only the cumulative statistics of each job, omitting the intermediate results (*.batch, etc.) which were skipped in the parsing anyway.

Note: I started this as I initially thought parsing of the sacct output would need to get more complex in order to address https://github.com/martius-lab/cluster_utils/issues/87, so I wanted to be able to add unit tests. It turned out that there is a better, much easier fix for that issue but I think testability of the parsing is good to have anyway, so I'm still submitting this PR.