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

Re: [HTCondor-users] Logic Inside Argument?



Dear Todd,

Works like a charm.Â
Many thanks for the help, you just saved me countless hours.

Francisco


On Mon, 23 Feb 2015 17:44:40 -0600, Todd Tannenbaum wrote:
Yes, you can... take a look at the "Macros" section of the condor_submit man page here

 http://research.cs.wisc.edu/htcondor/manual/current/condor_submit.html
where you will find a very similar example.

So, for instance, if you wanted to pass a command argument
 -XmYm

where Y equals the amount of RAM in megabytes on the slot where the job is going to run, you could use $(..) in your submit file like:

 arguments = -Xm$(Memory)m

Now lets say you wanted the same thing, but you wanted to multiply by 0.9 (to account of overhead etc), you can insert the result of an arbitrary ClassAd _expression_ using $([..]) like so :

 arguments = -Xm$([Memory * 0.9])m

Or use conditionals like:

 arguments = -Xm$([ifthenelse(Memory > 10000, 10000, Memory * 0.9)])m

Hope the above helps
Todd


----