[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Condor-users] Starting a given user's jobs only during the night?

On 18 Apr 2007 15:03:01 +0100, Angel de Vicente <angelv@xxxxxx> wrote:
Hi all,

I have been looking at the manual and the list and cannot figure out an easy way
to do this, so before I try something a bit more cumbersome I thought of

What I want is to have a way in the submit file to specify that the jobs being
submitted should only attempt to start running during the night (say 6PM-9AM). I
know that I could use periodic_hold and periodic_release, but I'm not too
convinced about them. If a job starts running at 10PM and it is still running at
9AM I don't want to automatically put it on hold. I would like to give it a
chance to continue and finish, but if the job is evicted at 11AM, then it is not
worthwile to start it again until 6PM.

Also, keep in mind that this should not be a configuration for the machines in
the pool. These are able to run jobs all day. This should only apply to a
particular cluster of jobs (and therefore best if it can be done by
configuration in the submit file).

It is much better to apply it to the machines in the pool which would
run the jobs* - simply mark any jobs with this criteria* with an
attribute like

+OnlyRunOverNight = true

# from my own config but with some tweaks:

# work between 8am and 8pm Monday to Friday
AllowJobOverrun = True
HappyToRunAlways = False
OnHoliday = False
WorkHours = (( (ClockMin >= 480 && ClockMin < 1200) && (ClockDay > 0
&& ClockDay < 6) ) && ( $(OnHoliday) == False ))
TargetJobIsOverNightOnly = (TARGET.OnlyRunOverNight  =!= UNDEFINED &&
TARGET.OnlyRunOverNight  == true)

# Assuming your machines have their own start requirenments you can
allow these to still
# remain in place by placing this into condor_config.local or by
placing them in a config directory in the correct lexical ordering

START = $(START) && ( $(TargetJobIsOverNightOnly) && (
$(HappyToRunAlways) || $(WorkHours) == False ))
PREEMPT= $(PREEMPT) || ( $(TargetJobIsOverNightOnly) && (
($(HappyToRunAlways) == False ) && ( $(AllowJobOverrun) == False) &&
$(WorkHours) ))

This assumes identical start and preempt times - you could easily
change that requirement with a minor difference in the $(WorkHours)
macro for start and preempt.

Note that this example was intented work workstations of users who are
aware of condor being on their machines and willing to indicate that
they are on holiday. You may not need this flexibility. It also jumps
through some hoops so that jobs which don't mark themselves as
overnight only are assume not to be overnight only (changing this left
as excersie for reader)

Also I just altered the real config slightly with no syntax/sanity
checking so test this before you use it - I rarely get my code
compiling first time without syntax highlighting :)


* If this is impossible because you don't control the config of you
pool machines then it is much more hassle and would be best controlled
by an external sceduler (which can be run on the schedd itself as a
scheduler universe in smiilar fashion to the dagman ones). I suggest
the solution above because it is much simpler and less error prone
within the limitations of a static config and good suer submit