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

Re: [Condor-users] Preferring a machine for special jobs using RANK



> I currently have a pool of several machines, of which only one
> has a particular piece of software installed.  I've already got
> it set up so that jobs that need this software -- call it
> SpecialSoft -- only run on the machine that provides it, so
> that's working great.  But, I'd also like jobs that don't require
> this software to stay off that particular machine unless it's the
> only one available.  I can't figure out how to do this.

I'll be really pedantic about answering this so there's a complete solution in the archives.

Lets advertise the fact that this machine has SpecialSoft using the ClassAd for the machine. In the condor_config.local file for this machine add:

	MyHasSpecialSoftware = True
	STARTD_EXPRS = $(STARTD_EXPRS), MyHasSpecialSoftware

This makes your startd's advertise the fact that they have your software installed. This next part you've figured out already, but to keep it all in one email in the archives, here's how you'd tell a job that it _must_ run on a machine with the special software. In your submission ticket add:

	requirements = MyHasSpecialSoftware
	+MyNeedsSpecialSoftware = True

We're not only constraining the job to use only machines that have the special software, we're also advertising in the job's classad that the job requires the special software by pushing a custom advert "MyNeedsSpecialSoftware".

So you're question is how do you tell the jobs that don't need the special software to use other machines before they use this machine? On your machine that has the special software we want to prefer jobs that need the special software so we say:

	RANK = TARGET.MyNeedsSpecialSoftware * 10

If a job does not need the special software the above expression evaluates to 0. Even if your users forget to set MyNeedsSpecialSoftware to "False" this expression will evaluate to 0 because "False" is the default for an undefined boolean.

And on the machines that _do not_ have the special software you can say:

	RANK = 1

So these machines prefer all jobs equally. 

Now you just need to tell your jobs to start first on machines that prefer them more than other machines. This is done in your job's submission ticket like so:

	rank = TARGET.Rank

The rank expression steers the jobs towards machines that prefer the jobs first. So your non-special software needing jobs will eat up the non-special machines first before they claim the special machine.
Hope that helps!

- Ian