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

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



Thanks a lot Todd and Brian.

Brian, Time was just a random example here. The question was more generic.

And yes, it is for the CE. In this case, the ARC-CE creates the condor
submit file, with a non-fixed Requirements expression, out of my
control.
Sometimes it may not be good for us.
So I was investigating how to override it via Schedd configuration.
But in such a way that I can write the most generic one, that does not
blow up when some of the classads are not part of the job definition.

The " ?: False "  seems to be what I was looking for.

Cheers,
Jose

El vie., 19 jun. 2020 a las 18:08, Todd Tannenbaum
(<tannenba@xxxxxxxxxxx>) escribiÃ:
>
> 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
>