[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [HTCondor-users] Job requirements with missing classads
- Date: Fri, 19 Jun 2020 12:08:21 -0500
- From: Todd Tannenbaum <tannenba@xxxxxxxxxxx>
- Subject: Re: [HTCondor-users] Job requirements with missing classads
On 6/19/2020 5:07 AM, jcaballero.hep@xxxxxxxxx wrote:
I feel this is a trivial question, but searching for undefined in the
documentation gives too many hits :)
So the question is what happen if you have something like this in your
set_Requirements = <other reqs> || (RemoteWallClockTime >
JobTimeLimit) || <other reqs>
but the jobs don't have classad JobTimeLimit?
Would that part of the logic just be evaluated as False?
Nope, the clause "(RemoteWallClockTime > JobTimeLimit)" would not evaluate to False, it would evaluate to Undefined.
If you want it to evaluate to false, there are several ways to explicitly express that, but my choice would be to
rewrite using the handy "?:" operator as:
( (RemoteWallClockTime > JobTimeLimit) ?: False )
When you have "expr1 ?: expr2" then, when expr1 is defined, that defined value is returned. Otherwise, when expr1
evaluated to UNDEFINED, the value of expr2 is evaluated and returned. This can be a convenient shortcut for writing what
would otherwise be a much longer classad expression.
Is there a link to documentation about this specific question where I
can educate myself?
Take a peek in the ClassAd Section of the Manual, specifically suggest here: