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

Unable to convert memory-per-core figures (e.g. ReqMem = 8000Mc) #17

Open
megatron-uk opened this issue Nov 4, 2024 · 1 comment
Open

Comments

@megatron-uk
Copy link

On my older Slurm system (sacct -V reports 20.11.8), when attempting to dump any amount of records, for example:

slurm2sql.py --history-days=7 -a slurm.sqlite3

The convert() code in slurm2sql.py does not seem to be handling memory-per-core values as recorded by Slurm:

Traceback (most recent call last):
  File "slurm2sql/slurm2sql.py", line 1204, in <module>
    exit(main(sys.argv[1:]))
         ^^^^^^^^^^^^^^^^^^
  File "slurm2sql/slurm2sql.py", line 688, in main
    errors = get_history(db, sacct_filter=sacct_filter,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "slurm2sql/slurm2sql.py", line 763, in get_history
    errors += slurm2sql(db, sacct_filter=new_filter, update=True, jobs_only=jobs_only,
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "slurm2sql/slurm2sql.py", line 927, in slurm2sql
    processed_row = {k.strip('_'): (columns[k](row[k])
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "slurm2sql/slurm2sql.py", line 927, in <dictcomp>
    processed_row = {k.strip('_'): (columns[k](row[k])
                                    ^^^^^^^^^^^^^^^^^^
  File "slurm2sql/slurm2sql.py", line 147, in float_bytes
    return convert(x)
           ^^^^^^^^^^
ValueError: could not convert string to float: '2500Mc'

I can see the function slurmmem() does some parsing of these type of values for fields which are mapped to that function on line 927, but it doesn't appear to be getting called on this field (it's ReqMem in the above case).

@megatron-uk
Copy link
Author

Thinking about this further, I think the issue stems from the fact that the defined mapper function for 'ReqMem' fields is float_bytes. If the mapper is changed to slurmmem() then the export of fields succeeds.

Is float_bytes() the default for ReqMem for a reason, or is this a bug?

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