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

Re: [HTCondor-users] Implementing non-uniform random choice of RANK expression



This is very clever. I love it :)

Thanks very much!

Vlad

On 04/06/2017 02:25 PM, John M Knoeller wrote:
Another way to do this in HTCondor 8.6 is to make use of the fact that the include statement in a config file is evaluated at parse time.
so  (assuming you don't need to support windows) you can do something like this

include command : /bin/echo RANDVAL=$RANDOM_INTEGER(0,10)

Since $RANDOM_INTEGER() has to be evaluated before the config parser runs the command, this ends up freezing the value until
the next time config is loaded (i.e. until the next reconfig)

Then just use $(RANDVAL) to set the rank as you tried to do originally.

-tj


-----Original Message-----
From: HTCondor-users [mailto:htcondor-users-bounces@xxxxxxxxxxx] On Behalf Of Vladimir Brik
Sent: Wednesday, April 5, 2017 1:13 PM
To: HTCondor-Users Mail List <htcondor-users@xxxxxxxxxxx>
Subject: [HTCondor-users] Implementing non-uniform random choice of RANK expression

Hello.

I'd like to configure worker nodes to randomly pick a non-uniform random
RANK expression on start-up. For example, given 3 choices of RANK, I
want, say, 70% of nodes pick the first one, 20% the second one, and 10%
the third one, or, in pseudo-code:

r=random()
if r < .7:
     RANK=rank1
else if r < .9:
     RANK=rank2
else:
     RANK=rank2

I am not sure how to do this in Condor's configuration language. If I do
something like the following, it seems that a new random number is used
in each clause:

r=random()
RANK=ifthenelse($(r) < 0.7, $(rank1), ifthenelse($(r) < 0.9, $(rank2), ...

How can I tell condor to assign a random number to variable "r" and then
reference its value instead of interpolating it? Or, maybe there is a
better way to do what I am trying to do?


Thanks,

Vlad
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/
_______________________________________________
HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting
https://lists.cs.wisc.edu/mailman/listinfo/htcondor-users

The archives can be found at:
https://lists.cs.wisc.edu/archive/htcondor-users/