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

Re: [HTCondor-users] Job requirements with missing classads



On 6/19/2020 5:07 AM, jcaballero.hep@xxxxxxxxx wrote:
Hi,

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
schedd config

    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:

https://htcondor.readthedocs.io/en/latest/misc-concepts/classad-mechanism.html#classad-operators

best regards,
Todd