[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



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 I could then do something like

"""
AccountingGroup =?= slot1_AccountingGroup && slot1_Activity == "Busy") 
"""




ïOn 11/21/18, 5:47 PM, "Todd Tannenbaum" <tannenba@xxxxxxxxxxx> wrote:

    On 11/19/2018 1:38 PM, Boris Sadkhin wrote:
    >Hi Todd,
    >Thanks for the reply.
    >It is currently set to static slots, but may be partitionable in the future.
    
    
    So one way you can enforce a policy of max one job per user on a given server is via startd policy, i.e. by setting a fancy START expression. See this section of the HTCondor Manual for details: http://tinyurl.com/y983qnmx.  This is actually quite a bit more complicated to do with static slots than with partitionable slots :(, but since you are currently using static slots here is a recipe for doing this with static slots. 
    
    On your large memory resource, append the following to your HTCondor configuration since we want to configure the condor_startd on that machine:
    
    
      # Set this to be how many slots each user can have on this machine
      MAX_SLOTS_PER_USER = 1
    
      # Tell the startd to cross-advertise RemoteUser and Activity into each
      # slot, so every slot will have slot1_RemoteUser, slot2_RemoteUser, etc.
      STARTD_SLOT_ATTRS = $(STARTD_SLOT_ATTRS) RemoteUser Activity
    
      # You will unfortunately need to extend this expression if you have more
      # than five slots... just follow the pattern.
      SLOTS_SERVING_THIS_USER = ( \
       (User =?= slot1_RemoteUser && slot1_Activity == "Busy") + \
       (User =?= slot2_RemoteUser && slot2_Activity == "Busy") + \
       (User =?= slot3_RemoteUser && slot3_Activity == "Busy") + \
       (User =?= slot4_RemoteUser && slot4_Activity == "Busy") + \
       (User =?= slot5_RemoteUser && slot5_Activity == "Busy") + \
       0 )
    
      # Append to Start expression to only start jobs if this user is under 
      # the limit for this machine.
      START = $(START) && ( $(SLOTS_SERVING_THIS_USER) < $(MAX_SLOTS_PER_USER) )
    
    If/when you someday switch to partitionable slots on this machine, you will
    need to change the above :(.
    
    Hope the above helps.  
    regards,
    Todd
    
    
    
    >ïOn 11/19/18, 1:34 PM, "Todd Tannenbaum" <tannenba@xxxxxxxxxxx> wrote:
    >      On 11/19/2018 1:27 PM, Boris Sadkhin wrote:
    >      > Hi,
    >      >
    >      > I have a large memory resource with 5 slots that I would like to set
    >      > limits on. I would like to enforce the policy of one job per user on
    >      > this resource.  Is this possible to do with concurrency limits or quotas
    >      > or some other mechanism?
    >      >
    >      > Thank you,
    >      >
    >      > Boris
    >      >
    >      >
    >      
    >      Hi Boris,
    >      
    >      Is your large memory machine setup with static slots or partitionable slots?
    >      
    >      regards,
    >      Todd
    >      
    
    
    -- 
    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