How To Disable Preemption

How to disable preemption

Known to work with HTCondor version: 7.0

There is a good section in the HTCondor Manual describing this topic here . Also see How to suspend jobs instead of killing them .

Here is an example drawn from real life that is slightly more complicated than what is in the manual section on preemption policy.

MaxJobRetirementTime = (IsDesktop =!= True && User =!= "glidein@hep.wisc.edu") * \
                       ( (OSG_VO =?= "uscms") * 3600*24  + \
                         (User == "osg_cmsprod@hep.wisc.edu") * 3600*24*3 )

# In case of graceful restart when HTCondor is being upgraded, wait for as
# long as the largest possible value of MaxJobRetirementTime before switching
# to a fast restart (which results in hard-kill signals).
# 3600 * 24 * 4
SHUTDOWN_GRACEFUL_TIMEOUT = 345600

This example assumes that desktop machines advertise a ClassAd attribute IsDesktop=True. On such machines, when jobs need to be preempted (e.g. by the machine user), they are preempted immediately. Jobs belonging to a glidein user are also preempted immediately, because unless they are sent a kill signal, they will always run indefinitely, not just until the current job finishes. Jobs belonging to the USCMS virtual organization are given 1 day to finish (from the time the job started) before preemption results in kill signals being sent. Jobs belonging to the osg_cmsprod user are given 3 days to finish (plus 1 day because they also belong to the "USCMS" virtual organization).