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

common.getSeconds does not handle empty argument #21

Open
bhmevik opened this issue Oct 18, 2017 · 2 comments
Open

common.getSeconds does not handle empty argument #21

bhmevik opened this issue Oct 18, 2017 · 2 comments

Comments

@bhmevik
Copy link
Contributor

bhmevik commented Oct 18, 2017

With Slurm, the UserCPU output of sacct can be empty, for instance if a job got cancelled while it was pending. In such cases, common.getSeconds() will log an error and return -1.
Perhaps a better action is to silently return 0.
If that is not acceptable, then a test for this case should be added in createUsageRecord() in slurm.py, so it circumvents getSeconds() if the value is empty (or calls getSeconds() with '00:00').
If one wants to be more secure, one could do this only when Start and End times are the same (or Elapsed is '00:00:00'), and allow getSeconds() to log an error otherwise.

@bhmevik
Copy link
Contributor Author

bhmevik commented Oct 18, 2017

Actually, perhaps it is better just to filter out all job records where End == Start (or Elapsed == '00:00:00'), since all jobs that are cancelled while pending, look like this. And accounting jobs of zero run time is perhaps not so interesting.

@bhmevik
Copy link
Contributor Author

bhmevik commented Oct 25, 2017

Just checking for elapsed == 00:00:00 was not enough; there are jobs with elapsed > 0 but with missing UserCPU. I've created a pull request that skips jobs with zero elapsed, and which uses 00:00:00 when UserCPU field is missing: #26

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

No branches or pull requests

1 participant