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

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



On 1/1/2018 8:45 AM, Mike Fienen wrote:
> Happy New Year HTCondor peoples!
> 
> I have a hopefully simple issue. I am trying to target a subset of 
> machines in a pool where the machines are numbered ARCWI-01.domain.gov 
> <http://ARCWI-01.domain.gov> through ARCWI-33.domain.gov 
> <http://ARCWI-33.domain.gov>. However, I only want to run on the 
> machines numbered ARCWI-16 or less.
> 
> Iâm using requirements to target them, and can make a requirement that 
> ensures only ARCWI machines are used, but I canât limit to the 16 or 
> less part.
[snip] 
> Anyone see what Iâm doing wrong? Also, is there a way to test these kind 
> of statements without running condor_submit?
> 

A good way to test your Requirements expression in your submit file is to use the "-constraint" flag to condor_status.  Just use your requirements expression as what you give to -constraint, and condor_status will limit (constrain) the output to just the machines where the expression evaluates to True.  Be careful to escape quotation marks so cmd.exe (on windows) or bash (on Linux/Mac) doesn't mess things up.

I think you can do what you want as follows by adding the following line to your submit file:

  requirements = substr(Machine,0,1)=="e" && int(substr(Machine,1,3)) <= 16

You can test it first with condor_status like so: 

  condor_status -cons "substr(Machine,0,1)==\"e\" && int(substr(Machine,1,3)) <= 16"
 
(note the quotation marks inside the expression are escaped with backslashes).

Note that the ClassAd function int() does exactly what you want... no need for $INT(), which actually is
something else.  The builtin ClassAd functions are documented in Section 4 of the HTCondor Manual
at URL http://tinyurl.com/ycausqo5 

happy new year and regards,
Todd