Hi Rémy,

I’m not sure how to do this using only sacctmgr, but to achieve something similar we added user to the output and then used grep to remove the lines without a user. This way, only the lines corresponding to accounts are kept:

sacctmgr list accounts --assoc format=Account,User,Clusters,[…] -n -P | grep -P "^\w+\|\|.*"

Hope it helps,
Guillaume


De: "Rémy Dernat via slurm-users" <slurm-users@lists.schedmd.com>
À: slurm-users@lists.schedmd.com
Envoyé: Mercredi 3 Septembre 2025 16:48:31
Objet: [slurm-users] sacctmgr output with and without associations

Hi,

I have a stupid issue about sacctmgr output and associations.

I would like to retrieve my accounts with all the following data :

"Account","Clusters","DefaultQOS","Description","Fairshare","Flags","GrpTRESMins","GrpTRES","GrpJobs","GrpSubmitJob",GrpWall", "MaxTRESMins","MaxTRES","MaxJobs","MaxNodes","MaxSubmitJobs","MaxWall","Organization","ParentName","Priority","QosLevel"

So my command is the following :

sacctmgr list accounts --assoc format="Account","Clusters","DefaultQOS","Description","Fairshare","Flags","GrpTRESMins","GrpTRES","GrpJobs","GrpSubmitJob","GrpWall","MaxTRESMins","MaxTRES","MaxJobs","MaxNodes","MaxSubmitJobs","MaxWall","Organization","ParentName","Priority","QosLevel" -n -P

However, I have a lot of outputs corresponding to each User association entry. That would be fine if a basic `|uniq` would remove everything I don't need, but I am stuck with grptres, which can be seen in the main account, but not in the children associations with the Users. On the opposite, if I remove `--assoc`, I don't have anymore grptres, ParentName, or related Qos values.

I had to add `where User=""` to my first command to just retrieve my main accounts, without User associations.

I dont' know if that is clear enough; is there something I missed with the sacctmgr output ?


Thanks,
Best regards,

Rémy



--
slurm-users mailing list -- slurm-users@lists.schedmd.com
To unsubscribe send an email to slurm-users-leave@lists.schedmd.com