[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HTCondor-users] Enforcing the policy of one job per user on a specific resource
- Date: Thu, 29 Nov 2018 12:26:40 -0600
- From: Boris Sadkhin <bsadkhin.anl@xxxxxxxxx>
- Subject: Re: [HTCondor-users] Enforcing the policy of one job per user on a specific resource
Thank you very much, that recipe works great. I appreciate your help.
If you happen to have a moment could you provide a hint as to what would need to be changed in the start expression to achieve similar behavior for partionable slots?
ïOn 11/26/18, 5:18 PM, "Todd Tannenbaum" <tannenba@xxxxxxxxxxx> wrote:
On 11/26/2018 12:55 PM, Boris Sadkhin wrote:
> Hi Todd,
> Thanks again for the reply and the recipe.
> So we actually submit all jobs as the "condor_pool" user, and then set the AccountingGroup per job in lieu of actual users.
> Is there a way to get the formula to use the accounting group instead of the user?
So you are saying your submit files look like:
executable = foo.exe
+AccountingGroup = "something"
If so, indeed we just need to tweak the formula a bit. The startd already should be advertising the AccountingGroup of the running job in each slot, but it appends the UID_DOMAIN as well. So I suggest trying a condor_config like so :
# Set this to be how many slots each user can have on this machine
MAX_SLOTS_PER_ACCTGRP = 1
# Tell the startd to cross-advertise AccountingGroup and Activity into each
# slot, so every slot will have slot1_AccountingGroup, slot2_AccountingGroup, etc.
STARTD_SLOT_ATTRS = $(STARTD_SLOT_ATTRS) AccountingGroup Activity
# You will unfortunately need to extend this expression if you have more
# than five slots... just follow the pattern.
SLOTS_SERVING_THIS_ACCTGRP = ( \
(TARGET.AccountingGroup =?= splitUserName(slot1_AccountingGroup) && slot1_Activity == "Busy") + \
(TARGET.AccountingGroup =?= splitUserName(slot2_AccountingGroup) && slot2_Activity == "Busy") + \
(TARGET.AccountingGroup =?= splitUserName(slot3_AccountingGroup) && slot3_Activity == "Busy") + \
(TARGET.AccountingGroup =?= splitUserName(slot4_AccountingGroup) && slot4_Activity == "Busy") + \
(TARGET.AccountingGroup =?= splitUserName(slot5_AccountingGroup) && slot5_Activity == "Busy") + \
# Append to Start expression to only start jobs if this user is under
# the limit for this machine.
START = $(START) && ( $(SLOTS_SERVING_THIS_ACCTGRP) < $(MAX_SLOTS_PER_ACCTGRP) )
Hope the above helps.
p.s. for an explanation of the classad function splitUserName() see the Manual at http://tinyurl.com/y7tcb5ed
Todd Tannenbaum <tannenba@xxxxxxxxxxx> University of Wisconsin-Madison
Center for High Throughput Computing Department of Computer Sciences
HTCondor Technical Lead 1210 W. Dayton St. Rm #4257
Phone: (608) 263-7132 Madison, WI 53706-1685