Last active
August 29, 2015 13:58
-
-
Save dberzano/9995356 to your computer and use it in GitHub Desktop.
HTCondor: per-user "quotas" using match making
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# "Quotas" per user | |
# | |
# Our requirements contain an expression that changes at every accepted job. We | |
# cannot therefore optimize matchmaking by caching the results for a specific | |
# "requirements" string, but we will need to evaluate it per job. | |
NEGOTIATOR_MATCHLIST_CACHING = False | |
# The following two variables are set to enforce these "quotas" on setups with | |
# non-static slots (partitions). First we are turning off the ability for schedd | |
# to claim leftover resources, so that our requirements rule will still work; | |
# then we re-enable using leftovers by letting HTCondor match more than one job | |
# to a machine per negotiator cycle. | |
# | |
# See https://htcondor-wiki.cs.wisc.edu/index.cgi/wiki?p=ConsumptionPolicies for | |
# more information. | |
# | |
# Please note that this approach makes use of "leftovers" less efficient, but it | |
# is the only way to make our Requirements expression work. | |
# Turn off claiming leftover resources by schedd: Requirements should then work | |
CLAIM_PARTITIONABLE_LEFTOVERS = False | |
# Optionally turn on consumption_policy mechanism so more than one job can be | |
# matched per negotiation cycle to a machine, considering that | |
# CLAIM_PARTITIONABLE_LEFTOVERS has been disabled | |
# Turn on Consumption Policy: match more than one job per negotiator to a host | |
CONSUMPTION_POLICY = True | |
# We define for convenience a variable with the default maximum jobs per user. | |
# This variable will be evaluated against the SubmitterUserResourcesInUse | |
# expression in the negotiator, which is a float as it is weighted by taking | |
# SlotWeight into account. | |
# | |
# NOTE: Ideally it is sufficient to change the following three variables | |
# without touching the Requirements expression. | |
MAX_RUNNING_JOBS_PER_NORMAL_USER = 1 | |
MAX_RUNNING_JOBS_PER_POWER_USER = 24 | |
POWER_USERS = dberzano, svallero | |
# Per user quota implementation is done by enforcing the following Requirements | |
# string. Note: the expression takes into account that some variables are | |
# available to the negotiator only. | |
APPEND_REQUIREMENTS = ( \ | |
isUndefined(SubmitterUserResourcesInUse) || \ | |
( stringListMember( Owner, "$(POWER_USERS)" ) && (SubmitterUserResourcesInUse <= ($(MAX_RUNNING_JOBS_PER_POWER_USER)-1.0)) ) || \ | |
(SubmitterUserResourcesInUse <= ($(MAX_RUNNING_JOBS_PER_NORMAL_USER)-1.0)) ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Contains information on the Consumption Policy posted by Todd Tannenbaum on this thread on HTCondor-Users.
Documentation on Consumption Policy is available on the official documentation.