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

Re: [HTCondor-users] $INT conversion failing in submit file



Hereʼs my requirements line:

( substr(Machine,0,5)=="ARCWI") && ($INT(substr(Machine,7,9),'%d') <= 16))

If I only use the first statement, only ARCWI machines are matched, but I also need to limit to number 16 or less.

As I understand it, $INT() is a macro and not a parsed function cal. That means the literal text of everything to the left of the first comma inside the parentheses must be a valid macro (reference), and everything to the right of it must be a valid format string. (I'm not sure if $INT() even properly nests parentheses, but based on the error message you posted, I'm guessing it doesn't.) Something like the following in your submit file should work:

+MachineNumber = substr(Machine,7,2)
Requirements = ... ($INT(MachineNumber) <= 16) ...

However, as ToddT noted, pretty much anywhere you can use the ClassAd function int() you should prefer it to the $INT() macro (which is intended for configuration files).

- ToddM