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

Re: [HTCondor-users] More job transform questions



Hi Antonio

Thank you for this!  The documentation is misleading on this point :


Number max([ List l ])

The elements of l are evaluated, producing a list l of values. Undefined values are removed. If the resulting l is composed only of numbers, the result is the maximum of the values, as a Real if any value is Real, and as an Integer otherwise. If the list is empty, the result is UNDEFINED. In other cases, the result is ERROR.

Seeing [ List l ] and not having earlier experience with ClassAd lists, I assumed that (just like in Python) lists must be enclosed in square brackets. I couldnât easily find the syntax for lists on the readthedocs page.
 
JT


On 5 Feb 2025, at 14:21, Antonio Delgado Peris via HTCondor-users <htcondor-users@xxxxxxxxxxx> wrote:

Hi Jeff,
 
I think that the problem is that a list must be enclosed in curly brackets. Can be seen e.g. with:
 
$ classad_eval 's="a, b"' 'split(s)'
[ s = "a, b" ]
{ "a","b" }
 
As for the transform debugging, here is an example for your case:
 
$ cat /tmp/ad
RequestCpus = 4
RequestMemory = 5000
 
$ cat /tmp/rules
CLCoreEquiv = max({ MY.RequestCpus, int(MY.RequestMemory / 4096) })
EVALSET Arlo $(CLCoreEquiv)
 
$ condor_transform_ads -rules /tmp/rules /tmp/ad
Arlo = 4
RequestCpus = 4
RequestMemory = 5000
 
 
Hope this helps.
 
Cheers,
    Antonio
 
 
From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of Jeff Templon
Sent: Wednesday, 5 February 2025 13:32
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] More job transform questions
 
Hi,
 
Why does this not work, inside a job transform?
 
# these don't work like I'd expect
CLCoreEquiv = max([ MY.RequestCpus, int(MY.RequestMemory / 4096) ])
EVALSET Arlo $(CLCoreEquiv)
 
 
The name âArloâ has no significance, itâs a result of trying to boil the problem down to the smallest reproducible bit.  I saw elsewhere, int used as $INT, Iâve never seen âmaxâ used in the docs for the transform, however âjoinâ works fine, which would lead me to expect that âmaxâ would work and âintâ as well.  The documentation is ârather sketchyâ on these details AFAICT.
 
Iâd appreciate any pointers, as well as a concrete, working example of how to use the transform debugging tool (the docs are rather sketchy on those details as well).
 
J âWhereâs SketchUp Pro when you need itâ T
 
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe

The archives can be found at: https://www-auth.cs.wisc.edu/lists/htcondor-users/