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

Re: [HTCondor-users] job transform: change requirement condition?

DiskUsage is an integer value, not a string, so its use as the second argument of regexps() like this is an error.


    EVALMACRO tmp.MyReq = regexps("25",DiskUsage,"33")


Also, unfortunately the return value of regexps() here is just the output â33â when there is a match.  You can see this by using condor_status to test.


   condor_status -limit 1 -af âregexps(â25â, â250000â, â33â)



   condor_status -limit 1 -af âregexps(â25(.*)â, â250000â, â33\1â)



I had forgotten that reqxps works that way, so my original suggestion needed a different regexps _expression_. To do a substitution in place, you need to use capture groups to preserve text before and after.  So this works


  EVALMACRO tmp.MyReq = regexps("(.*)25(.*)",unparse(DiskUsage),"\\133\\2")

  SET Requirements $(tmp.MyReq)


Producing this output from condor_transform_ads -verbose


EVALMACRO tmp.MyReq to regexps("(.*)25(.*)",unparse(DiskUsage),"\\133\\2")

          tmp.MyReq = 3300000

SET Requirements to 3300000

DiskUsage = 2500000

Requirements = 3300000

ResidentSetSize = 500


By the way, I think it is a bug that you have to double up the \ for EVALMACRO, when testing the reqexps()  _expression_ in condor_status. I only used a single \, but condor_transform_ads required \\ which means that is parsing those expressions using ânew classadsâ syntax, which is wrong.




From: HTCondor-users <htcondor-users-bounces@xxxxxxxxxxx> On Behalf Of Collin Mehring
Sent: Monday, October 15, 2018 12:15 PM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: Re: [HTCondor-users] job transform: change requirement condition?


Hi Thomas,


You can include the rest of the original value using capture groups. For example: regexps("^25(\d+)",unparse(DiskUsage),"33\1")


Also, it looks like you're overriding the entire Requirements _expression_ in that last example instead of DiskUsage.


Hope this helps,



On Mon, Oct 15, 2018 at 8:17 AM Thomas Hartmann <thomas.hartmann@xxxxxxx> wrote:

Hi all,

unfortunately, I have to bother you again about all the transforms...

I am still trying to get my head around the regexp{s} - in the attached
transform rule I am trying to re/set DiskUsage (as example)
  DiskUsage = 2500000
to something else ~~> 3300000
so I assume that
  EVALMACRO tmp.MyReq = regexps("25",unparse(DiskUsage),"33")
would first take the value of 'DiskUsage' and replace '25' by '33' -
however, if I run the rule on the classad [1] the 'whole value' 2500000
get's replaced as 33.
Is there a way to go just for
  '25'00000 --> '33'00000

Cheers and thanks,

> condor_transform_ads -verbose -rules example.rule example.classad
EVALMACRO tmp.MyReq to regexps("25",unparse(DiskUsage),"33")
          tmp.MyReq = 33
SET Requirements to 33
DiskUsage = 2500000
Requirements = 33
ResidentSetSize = 500

one thing I noted, that condor_transform_ads -verbose exits without any
message and exit code 0 if the input 'class ads' use something dynamic as
  output  = /OUT/PATH/mypayload_$(Cluster)_$(Process).out
i.e., when trying a submission set directly - which in hindsight is
comprehensible but irritated me for a minute ;)

probably, condor_transform_ads could throw an error, if it encounters
something unparsable in the context?
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting

The archives can be found at:



Collin Mehring | PE-JoSE - Software Engineer

Image removed by sender.