NordicHPC / slurm2sql

Dump slurm accounting database to sqlite3 database for easy analysis
MIT License
10 stars 6 forks source link

Get error for 'UNLIMITED' value in slurmtime type #5

Closed climby closed 4 years ago

climby commented 4 years ago

There is 'UNLIMITED' value when parsing slurmtime:

Traceback (most recent call last):
  File "slurm2sql.py", line 736, in <module>
    exit(main(sys.argv[1:]))
  File "slurm2sql.py", line 530, in main
    raw_sacct=raw_sacct)
  File "slurm2sql.py", line 594, in get_history
    raw_sacct=raw_sacct)
  File "slurm2sql.py", line 699, in slurm2sql
    for k in COLUMNS.keys()}
  File "slurm2sql.py", line 699, in <dictcomp>
    for k in COLUMNS.keys()}
  File "slurm2sql.py", line 79, in slurmtime
    if len(hms) >= 1:   seconds += 60   * int(hms[-2] if len(hms)>=2 else hms[-1])  # min
ValueError: invalid literal for int() with base 10: 'UNLIMITED'

I think the 'UNLIMITED' value is from 'TimeLimit' field:

sacct -X -j 951711  -o jobid,timelimit
       JobID  Timelimit
------------ ----------
951711        UNLIMITED