OleHolmNielsen/Slurm_tools

Using a default group for per user groups

Closed this issue · 3 comments

Hello,
first thank you for your useful tools.

I had to come up with a quick solution on my system for per user groups. It is on a "works for me" basis, but I hope it might be useful for someone else too. The way I chose to do it was, to replace the per user groups with a default group.
Here is the diff of the slurmusersettings file:

diff slurmusersettings.orig slurmusersettings.edited

33a34,35
> export defaultgroup="slurmuser"
> 
55c57
< export sacctmgr=/usr/bin/sacctmgr
---
> export sacctmgr=$(which sacctmgr)
148a151
>       defaultgroup    = ENVIRON["defaultgroup"]
348,350c351,355
<               print "### Ignoring users with per-user group: User=" u " group=" g
<               userinformation[u] = "IGNORE"
<               next
---
>               print "### user with per-user group: User=" u " group=" g
>               print "### setting default group to " defaultgroup
>               #userinformation[u] = "IGNORE"
>               #next
>               g = defaultgroup
467a473
>       if(isarray(setting[u][config]) && isarray(setting[u][current])) {
476c482,484
< 
---
> } else {
>       print "### config or current not arrays"
> }

Hi Hans,
Thanks for your suggestion. I guess I do not understand the reason why you need to introduce a defaultgroup concept?
At our site we have many UNIX groups for Slurm users, and we would never put Slurm users into a single defaultgroup.
Best regards,
Ole

Hello Ole,
I just recently started working with slurm, so it is very possible that I missed something.
The problem I ran into was, that my system creates new users with a usergroup (username=group) by default. I did not want to reconfigure that system. But your script ignores users with a usergroup. So the default group was the first thing that came to my mind to solve that problem.
An other option would have been to create a new account for every user (for every usergroup). I did not want to do that.

Thanks for your time,
Hans

I think I understand. The project https://github.com/OleHolmNielsen/Slurm_tools/tree/master/slurmaccounts says:

  • We do not support per-user UNIX groups where each username's primary UNIX group is the same as the username (groupname=username).
    The idea in my project is that you have many groups, and each group has many users. This is contrary to some Linux systems which create a personal group for each user (groupname=username).
    With a big, shared Linux cluster for a number of research groups it makes sense to gather each group of researchers into a UNIX group. Then we can do accounting for each group and administer resources on a group basis in stead of on a user basis.
    I hope this explanation makes sense to you?
    /Ole