Ticket 8181

Summary: Resetting Raw Usage
Product: Slurm Reporter: ARC Admins <arc-slurm-admins>
Component: OtherAssignee: Ben Roberts <ben>
Status: RESOLVED INFOGIVEN QA Contact:
Severity: 4 - Minor Issue    
Priority: ---    
Version: 18.08.8   
Hardware: Linux   
OS: Linux   
Site: University of Michigan 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: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description ARC Admins 2019-12-04 09:12:29 MST
Hello,

Out of curiosity, what is the difference between using sacctmgr to reset raw usage 

e.g. 

```
sacctmgr -i modify account where name=support user=drhey set rawusage=0
```

and defining PriorityUsageResetPeriod in slurm.conf?

Best,

David
Comment 1 Ben Roberts 2019-12-04 13:18:51 MST
Hi David,

The two methods of resetting the raw usage do reset the UsageRaw attribute in the same way.  There is a difference in that using the PriorityUsageResetPeriod will also reset the GrpTRESMins and GrpWall attributes.  

When you define the PriorityUsageResetPeriod it will make a call to _reset_usage, which will reset the three attributes mentioned above for the qos and associations.  You can see this in the code here:
https://github.com/SchedMD/slurm/blob/master/src/plugins/priority/multifactor/priority_multifactor.c#L221-L260


When you use sacctmgr you can see that it resets the usage_raw attribute in the same way, but doesn't change the GrpTRESMins or GrpWall attributes.  Here are the places in the code where it does this for the associations and qos'.  
https://github.com/SchedMD/slurm/blob/master/src/sacctmgr/account_functions.c#L229-L239

https://github.com/SchedMD/slurm/blob/master/src/sacctmgr/qos_functions.c#L704-L712


Please let me know if you have any additional questions about this.

Thanks,
Ben
Comment 2 ARC Admins 2019-12-05 12:48:27 MST
Hi, Ben,

Thanks! How is reporting (sreport) impacted with usage being reset (in either method)?

Best,

David
Comment 3 Ben Roberts 2019-12-05 15:39:40 MST
The information you get from sreport isn't impacted by clearing the raw usage data.  The usage information is used to impose limits on how much of a particular resource a user can consume within a given time frame.  The sreport command doesn't take the usage information into account, but just uses the job and reservation records from the database for it's calculations.  

Thanks,
Ben
Comment 4 ARC Admins 2019-12-20 08:39:48 MST
Ben,

Thanks. I figured as much, but I wanted to be clear.

When you say "There is a difference in that using the PriorityUsageResetPeriod will also reset the GrpTRESMins and GrpWall attributes" Are you saying that a limit like GrpTRESMins=cpu=16 will actually be UNSET (akin to manually running something like GrpTRESMins=cpu=-1) or that the usage data for that limit will be cleared?

David
Comment 5 Ben Roberts 2019-12-20 09:17:42 MST
Hi David,

You're right, that was worded poorly.  Using the PriorityUsageResetPeriod parameter won't unset a defined limit, but will clear the usage data for those limits.  

Thanks,
Ben
Comment 6 ARC Admins 2019-12-20 11:08:54 MST
Hi, Ben,

Thanks! I just wanted to be certain as there's some discussion here on approaches to certain things and I wanted to make sure we wouldn't lose set limits or reporting on things.

I think we can call this one closed.

Best!

David