Ticket 15753

Summary: "sreport user topuser" reporting somewhat inaccurate user count
Product: Slurm Reporter: DRW GridOps <gridadm>
Component: User CommandsAssignee: Director of Support <support>
Status: RESOLVED INFOGIVEN QA Contact:
Severity: 4 - Minor Issue    
Priority: ---    
Version: 22.05.6   
Hardware: Linux   
OS: Linux   
Site: DRW Trading Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: 23.02.0rc1 Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---
Attachments: slurm.conf

Description DRW GridOps 2023-01-06 15:22:21 MST
Created attachment 28374 [details]
slurm.conf

cseraphine@LAPTOP-16:19:54-/Users/cseraphine$ sacctmgr -n show users |wc -l
75
cseraphine@LAPTOP-16:20:00-/Users/cseraphine$  sreport user topuser "topcount=-1" "format=login%-20,proper%-24,account%-32,used" | head -3
--------------------------------------------------------------------------------
Top 4294967295 Users 2023-01-05T00:00:00 - 2023-01-05T23:59:59 (86400 secs)
Usage reported in CPU Minutes


I suspect that the user count in the second command is high by around 4,294,967,220 users.  (That, or the number means something very different from what it reads like it should mean.)

Not causing any production pain, just makes the reports I pass onto the accounting folks seem less trustworthy.
Comment 1 DRW GridOps 2023-01-06 15:24:04 MST
All silliness aside, it's obviously reading the topcount as an unsigned int instead of counting the rows of output.
Comment 3 Caden Ellis 2023-01-11 09:36:33 MST
Internally, all negative numbers for "topcount" are currently being represented by a uint. Anything negative gets our representation of INFINITE, which you are seeing. If you are worried about your reports for the time being you can set topcount=75 if that is how many users you have. 
I am looking into how to make this scenario better.
Comment 4 Caden Ellis 2023-01-11 10:40:26 MST
Commit 7da8867f5c on master will now print "Top ALL Users" when topcount = -1,
hopefully making the accounting folks more confident in your report.
Comment 5 DRW GridOps 2023-01-12 07:43:55 MST
Thank you!  That's an excellent solution.
Comment 6 Caden Ellis 2023-01-12 10:50:27 MST
If there are no further related questions, I'll go ahead and close. 

Caden