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

[HTCondor-users] Python bindings: ExprTree vs classad.eval

Hi all,

two Python binding questions here:


I tried to use the classad.ExprTree on an ad, but only got the un-evaluated string - I implicitly assumed, that it would be evaluated as calling the ad's eval()

E.g., I have got an ad coming from the CondorCE to the Condor Sched
RequestCpus = "ifThenElse(WantWholeNode is true, !isUndefined(TotalCpus) ? TotalCpus : JobCpus,OriginalCpus)"

that I tried to evaluate like
  >>> pprint.pprint( classad.ExprTree( myjob["RequestCpus"] )  )

but which gave me the expression string
  >>> "ifThenElse..."

So, asking the ad directly
  >>> pprint.pprint(ajob.eval("RequestCpus") )
  >>> 8L
worked fine

I had assumed, that calling the ExprTree() function on an ad would be the same as the eval() function of the ad itself - but apparently not?



and somewhat related(?):

I had assumed, that I would have to query all a job's class ads, that are part of a more complex ad schedd.query('',["TotalCpus", "OriginalCpus", "RequestCpus",'WantWholeNode','JobCpus, ...etc.... ] )

but then I noted, that it seems not to be necessary to query all involved ads explicitly (actually, I noticed, that I forgot one ad).

Question: When querying a compound ad - are all involved ads automatically queried? which would be really neat, as I would not attempt anymore to count all involved ads in advance ;)

Cheers and thanks,

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature