Hi Stefan,

On 5/28/21 3:31 PM, Stefan Staeglich wrote:
for our monitoring system I want to query the account hierarchy. Is there a
better approach than to parse the output of

sacctmgr list account withasso -nP

One approach is to use the Slurm sreport tool which displays the account hierarchy tree:

$ sreport -t hourper --tres=cpu,gpu cluster AccountUtilizationByUser Start=0501 End=0528 format=Accounts,Login,Proper%30,TresName%9,Used tree

I think you could perhaps also be inspired by this example:

$ scontrol -o show assoc_mgr users=XXX account=camdvip flags=Assoc
Current Association Manager state
Association Records
ClusterName=niflheim Account=camdvip UserName= Partition= Priority=0 ID=25 SharesRaw/Norm/Level/Factor=2147483647/0.00/549/0.00 UsageRaw/Norm/Efctv=8677881859.88/0.18/0.18 ParentAccount=camd(16) Lft=1385 DefAssoc=No GrpJobs=N(109) GrpJobsAccrue=N(86) GrpSubmitJobs=N(678) GrpWall=N(2357791.66) GrpTRES=cpu=N(5176),mem=N(56741000),energy=N(0),node=N(179),billing=N(6788),fs/disk=N(0),vmem=N(0),pages=N(0) GrpTRESMins=cpu=N(110849595),mem=N(1098107088383),energy=N(0),node=N(4074184),billing=N(143938180),fs/disk=N(0),vmem=N(0),pages=N(0) GrpTRESRunMins=cpu=N(7715490),mem=N(85269922566),energy=N(0),node=N(272766),billing=N(9733605),fs/disk=N(0),vmem=N(0),pages=N(0) MaxJobs= MaxJobsAccrue= MaxSubmitJobs= MaxWallPJ= MaxTRESPJ= MaxTRESPN= MaxTRESMinsPJ= MinPrioThresh= ClusterName=niflheim Account=camdvip UserName=XXX(261375) Partition= Priority=0 ID=712 SharesRaw/Norm/Level/Factor=3/0.01/549/0.21 UsageRaw/Norm/Efctv=471217489.26/0.01/0.01 ParentAccount= Lft=1392 DefAssoc=Yes GrpJobs=N(6) GrpJobsAccrue=30(0) GrpSubmitJobs=N(12) GrpWall=N(116502.58) GrpTRES=cpu=1500(240),mem=N(2250000),energy=N(0),node=N(6),billing=N(396),fs/disk=N(0),vmem=N(0),pages=N(0) GrpTRESMins=cpu=N(4727973),mem=N(44203335956),energy=N(0),node=N(119926),billing=N(7763388),fs/disk=N(0),vmem=N(0),pages=N(0) GrpTRESRunMins=cpu=4000000(214620),mem=N(2012062500),energy=N(0),node=N(5365),billing=N(354123),fs/disk=N(0),vmem=N(0),pages=N(0) MaxJobs=500(6) MaxJobsAccrue=30(0) MaxSubmitJobs=1000(12) MaxWallPJ= MaxTRESPJ= MaxTRESPN= MaxTRESMinsPJ= MinPrioThresh=


The line with UserName= (empty string) is the parent account.

I'm using this approach to print user limits in my showuserlimits tool,
https://github.com/OleHolmNielsen/Slurm_tools/tree/master/showuserlimits

I hope this helps.

/Ole

Reply via email to