Mailing List Archives
Authenticated access
|
|
|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[HTCondor-users] Implementing non-uniform random choice of RANK expression
- Date: Wed, 05 Apr 2017 13:12:55 -0500
- From: Vladimir Brik <vladimir.brik@xxxxxxxxxxxxxxxx>
- 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