Hi Ole,

Your script is a nice piece of scripting but I think you missed the point, if I 
read your script correctly!
You read limits with:

scontrol -o show assoc_mgr users=$username $selectedaccount flags=Assoc

In our case the limits are declared in a QoS and not in the association and 
hence will not be picked up and shown in the output.
The purpose of having them in a QoS, which you could read with:

scontrol -o show assoc_mgr users=$username $selectedaccount flags=QoS

Is to apply the nodecay flag and hence not influence fair share and priorities.

We have a sbank code what output balances and statments to users:

[root@slurmdb ~]# sbank balance 

-------------------------------------------------------------------------------------------
|             |                   CPU (hours)       |                   GPU 
(hours)       |
-------------------------------------------------------------------------------------------
|     Account |       Limit       Usage   Available |       Limit       Usage   
Available |
-------------------------------------------------------------------------------------------
|       staff |          ND      729881          ND |          ND          18   
       ND |
-------------------------------------------------------------------------------------------
[root@slurmdb ~]# sbank statement

-----------------------------------------------------------------------------------------------------------------------
|                             |                       CPU (hours)         |     
                  GPU (hours)         |
-----------------------------------------------------------------------------------------------------------------------
|      Username       Account |         Limit         Usage     Available |     
    Limit         Usage     Available |
-----------------------------------------------------------------------------------------------------------------------
|      bandrade         staff |            ND           182            ND |     
       ND            --            ND |
|     easybuild         staff |            ND         13210            ND |     
       ND            --            ND |
|     moliveira         staff |            ND          1875            ND |     
       ND            --            ND |
|      palberto         staff |            ND        720538            ND |     
       ND            --            ND |
|          root         staff |            ND       7949386            ND |     
       ND            --            ND |
|    ----------         staff |            ND        729881            ND |     
       ND            18            ND |
-----------------------------------------------------------------------------------------------------------------------

Best Regards,

MAO

> On 23 Jun 2022, at 20:47, Ole Holm Nielsen <ole.h.niel...@fysik.dtu.dk> wrote:
> 
> On 23-06-2022 19:19, Miguel Oliveira wrote:
>> We use a python wrapper to do this but the basic command to retrieved 
>> account minutes is:
>> 'scontrol -o show assoc_mgr | grep "^QOS='+account+’"'
>> You then have to parse the output for "GrpTRESMins=“. The output will be two 
>> numbers. The first is the limit, or N for no limit, while the next one in 
>> parenthesis is the consumed.
> 
> You may perhaps find it easier to use my showuserlimits script from 
> https://github.com/OleHolmNielsen/Slurm_tools/tree/master/showuserlimits
> 
> /Ole
> 

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to