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

Re: [HTCondor-users] Classifying job on the basis of cpu time request



On 6/22/2015 8:16 AM, mohammad kashif wrote:
Hi

I want to classify job on the basis of requested cputime and add a
JobType to the class add. I am adding request_cputime like this to job
submission script

Universe = vanilla
  Executable = hello_world.sh
input = /dev/null output = hello.out
error = hello.error
request_memory = 100
+request_cputime = 10

# configuration at SCHEDD

JobType = \
ifThenElse(request_cputime <= 2, "short",\
ifThenElse((request_cputime > 2) && (request_cputime <= 12), "medium",\
ifThenElse(request_cputime > 12, "long",\
ifThenElse(request_cputime =?= undefined, "long",\
  "long"))))
  SUBMIT_EXPRS = $(SUBMIT_EXPRS) JobType request_cputime

It works if '+request_cputime' is defined in job submission script, but
I also want to make sure that if 'request_cputime' is not defined in the
job submission script then it should default to long. This bit is not
working. Any suggestion will be very helpful.

Thanks

Just a quick guess, but I'd try making the comparison to UNDEFINED be the _first_ comparison you do in your nested ifThenElse expressions. What is likely happening is your first comparison above (request_cputime <= 2) is evaluating to undefined, which via short circuiting results in JobType going to undefined instead of long.

Another quick idea would be to put "request_cputime=24" in your condor_config, and also add request_cputime to the SUBMIT_EXPRS in your condor_config (looks like you alraedy did). This results in request_cputime in the job ad defaulting to 24 if the user does not specify it, which would be considered a long job.

regards,
Todd