NordicHPC / slurm2sql

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

GRES not supported in new slurm version 20.11 #7

Closed antoniomarcum closed 3 years ago

antoniomarcum commented 3 years ago

I received the error 'slurm acct: GRES deprecated' after slurm was updated to version 20.11 Slurm deprecated the use of GRES in the recent release notes.

COMMAND CHANGES (see man pages for details) -- sacct - AllocGres and ReqGres were removed. Alloc/ReqTres should be used instead.

I edited the main script and replaced the some lines with gres for tres and the string search from gpu: to gpu=

# GPU stuff
class slurmReqGPU(linefunc):
    @staticmethod
    def calc(row):
        tres = row['ReqTRES']
        if not tres:  return None
        m = re.search(r'gpu=(\d+)', tres)
        if m:
            return int(m.group(1))
rkdarst commented 3 years ago

Thanks for making this issue! It is always good to catch these things early. I just made a update in pull request #9, which should fix this for newer Slurm without breaking it for older Slurm. But, since I don't have a newer slurm I can't test myself.

Can you give it a try and see if it works? If you need help let me know. (I might leave that pull request open for a bit to see if anyone finds other bugs in it).

antoniomarcum commented 3 years ago

Yes, seems to be working well for me! Thanks!