Re: [slurm-users] Parent accounts

2021-05-31 Thread Ole Holm Nielsen

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

?

Something like

sacctmgr list account parent=bla withasso -nP

doesn't work.


Here is another suggestion:

$ sacctmgr -P list account camdvip withassoc 
format=User,Account,ParentName,Org,Cluster,Share

User|Account|Par Name|Org|Cluster|Share
|camdvip|camd|camd|niflheim|parent
user1|camdvip||camd|niflheim|1
user2|camdvip||camd|niflheim|3

The first output line "|camdvip|camd|camd|niflheim|parent" shows that the 
parent of account "camdvip" is "camd" in the ParentName column.


The following lines displays each user in the account under the User column.

So all the information is really there!  The question is only which data 
you're asking for?


Best regards,
Ole




Re: [slurm-users] Parent accounts

2021-05-28 Thread Ole Holm Nielsen

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(225),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=400(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



[slurm-users] Parent accounts

2021-05-28 Thread Stefan Staeglich
Hi,

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

?

Something like

sacctmgr list account parent=bla withasso -nP

doesn't work.

Best,
Stefan
-- 
Stefan Stäglich,  Universität Freiburg,  Institut für Informatik
Georges-Köhler-Allee,  Geb.52,   79110 Freiburg,Germany

E-Mail : staeg...@informatik.uni-freiburg.de
WWW: gki.informatik.uni-freiburg.de
Telefon: +49 761 203-8223
Fax: +49 761 203-8222