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

Re: [Condor-users] condor_q constraints based on job requirements

On Wednesday, 22 August, 2012 at 9:39 AM, Tim St Clair wrote:

condor_q -constraint <_expression_>
Was mulling this over this morning as I had typed an identical response and was about to hit send. The -constraint on condor_q isn't sufficient here AFAICT. It's a potentially a nasty _expression_ to write if your jobs don't have regular, well-formed requirements _expression_ strings. You'd need to find:

requirements = OpSys == "Linux"

which isn't so bad. But then also:

requirements = OpSys != Undefined


requirements = OpSys != "WINNT61"

which are fairly hard to write -constraint strings for.

Without evaluating the requirements _expression_ against the startd ads I think it's impossible to query accurately for "all jobs that target a particular OS".

Rob, you may have better luck answering the question "Can this job run on a Linux machine?" for a specific job than asking condor_q to show you all jobs that can run on Linux. In that case you'd extract the job's requirement _expression_, fill in the attributes it references from the job's ClassAd, and then run the resulting expanding _expression_ against your pool of machines using "condor_status -constraint". For example, if I had:

requirements = 

I'd first need to replace ImageSize with the value from the job's ad, which I could get with:

condor_q -f "%s\n" ImageSize <cluster>.<proc>

And then call:

condor_status -constraint 'OpSys == "Linux" && Disk > 0 && Memory > X'

to see what it matches.

It'd be nice if condor_q had the ability to do this. Most of the functionality is already there in the -better-analyze option. It'd just need to be extended to return a list of startd's that match the job's requirements _expression_.

Barring that, Rob, I'd suggest that you look at adding custom attributes to your jobs to make them easier to find. For example: if someone is submitting and they intend to run on Linux they should add:

+WantLinux = True

to their .sub file. If they wanted Windows:

+WantWindows = True

If they wanted either:

+WantLinux = True
+WantWindows = True

Now you can use the custom attributes to find jobs with a "condor_q -const" call that isn't nearly impossible to write.

- Ian

Ian Chesal

Cycle Computing, LLC
Leader in Open Compute Solutions for Clouds, Servers, and Desktops
Enterprise Condor Support and Management Tools