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

Re: [HTCondor-users] Logic Inside Argument?



On 2/23/2015 3:29 PM, Francisco Leite de Castro wrote:
Hello,

Is there anyway to put logic inside an argument?

For instance base your Xmx dinamically on the amount of memory you're
telling HTCondor to use?

Something like?

java_vm_args= "-Xmx" + ifthenelse( x, 1000, 2000) ) + "m"

Many thanks,
Francisco


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


--
Todd Tannenbaum <tannenba@xxxxxxxxxxx> University of Wisconsin-Madison
Center for High Throughput Computing   Department of Computer Sciences
HTCondor Technical Lead                1210 W. Dayton St. Rm #4257
Phone: (608) 263-7132                  Madison, WI 53706-1685