troycomi / reportseff

Tabular seff

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Division by zero if elapsed time is 0 second

braffes opened this issue · comments

Hi,

I have an issue with a very quick job of 0 second.

Error processing entry: {'AdminComment': 'JS1:H4sIAI9pD2QC/52PQQ7CIBBF95yi6boapIjiZRpiiSEpxcCwqA13l9KFgk00spv3P28yM6riq2937+pLBdbLZiWj6eWC5jQmpIV0YM2uxbjNkpReV8W5yXE0d2BADJ2W2tjp42NqkYgp4ZSzE+EMZ4WwYfRO9l+FP2hADeohQJnxX01xGyP8QI8M7/FmD5SWi7II83NeCwN6W1koUHgCtwTT5LwBAAA=', 'AllocCPUS': '8', 'Elapsed': '00:00:00', 'JobID': '13421658', 'JobIDRaw': '13421658', 'MaxRSS': '', 'NNodes': '1', 'REQMEM': '60G', 'State': 'FAILED', 'Timelimit': '3-00:00:00', 'TotalCPU': '00:00.001'}
Traceback (most recent call last):
  File "/opt/hpc/slurm/current/bin/reportseff", line 8, in <module>
    sys.exit(main())
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/reportseff/console.py", line 124, in main
    output, entries = get_jobs(args)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/reportseff/console.py", line 184, in get_jobs
    raise error
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/reportseff/console.py", line 181, in get_jobs
    job_collection.process_entry(entry, add_job=add_jobs)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/reportseff/job_collection.py", line 220, in process_entry
    self.jobs[job_id].update(entry)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/reportseff/job.py", line 111, in update
    self._update_main_job(entry)
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/reportseff/job.py", line 169, in _update_main_job
    self._parse_admin_comment(entry["AdminComment"])
  File "/opt/hpc/slurm/current/libexec/venv/lib64/python3.8/site-packages/reportseff/job.py", line 200, in _parse_admin_comment
    "CPUEff": value["total_time"]
ZeroDivisionError: float division by zero

If you need more information/help feel free to ask.

Thanks for the report! Should be fixed in v2.7.2 which will release once the tests pass.

For you information, you forgot to remove a print :

print("are you here?")

And thanks for the quick fix !

Son of a... Thought I caught them all. Ran into poetry/nox problems and needed a sanity check.