mirror of https://github.com/BOINC/boinc.git
- scheduler: in some cases the system may have a too-low estimate
of the performance of an app version on a host. It will then stop using that app version, so the estimate never has a chance to converge to its correct value. Fix: multiply by a random factor (mean 1, stddev .1) when comparing the FLOPS estimates of app versions. svn path=/trunk/boinc/; revision=22837
This commit is contained in:
parent
0a85852465
commit
864ee7e3a3
|
@ -8682,3 +8682,18 @@ David 8 Dec 2010
|
|||
|
||||
api/
|
||||
ttffont.cpp,h
|
||||
|
||||
David 8 Dec 2010
|
||||
- scheduler: in some cases the system may have a too-low estimate
|
||||
of the performance of an app version on a host.
|
||||
It will then stop using that app version,
|
||||
so the estimate never has a chance to converge to its correct value.
|
||||
Fix: multiply by a random factor (mean 1, stddev .1)
|
||||
when comparing the FLOPS estimates of app versions.
|
||||
|
||||
client/
|
||||
sim_util.cpp
|
||||
lib/
|
||||
util.cpp,h
|
||||
sched/
|
||||
sched_version.cpp
|
||||
|
|
|
@ -124,30 +124,9 @@ int ACTIVE_TASK::init(RESULT* rp) {
|
|||
|
||||
//////////////// OTHER
|
||||
|
||||
// http://www.cs.wm.edu/~va/software/park/rvgs.c
|
||||
double NORMAL_DIST::sample() {
|
||||
if (!std_dev) return mean;
|
||||
|
||||
const double p0 = 0.322232431088; const double q0 = 0.099348462606;
|
||||
const double p1 = 1.0; const double q1 = 0.588581570495;
|
||||
const double p2 = 0.342242088547; const double q2 = 0.531103462366;
|
||||
const double p3 = 0.204231210245e-1; const double q3 = 0.103537752850;
|
||||
const double p4 = 0.453642210148e-4; const double q4 = 0.385607006340e-2;
|
||||
double u, t, p, q, z;
|
||||
|
||||
u = drand();
|
||||
if (u < 0.5)
|
||||
t = sqrt(-2.0 * log(u));
|
||||
else
|
||||
t = sqrt(-2.0 * log(1.0 - u));
|
||||
p = p0 + t * (p1 + t * (p2 + t * (p3 + t * p4)));
|
||||
q = q0 + t * (q1 + t * (q2 + t * (q3 + t * q4)));
|
||||
if (u < 0.5)
|
||||
z = (p / q) - t;
|
||||
else
|
||||
z = t - (p / q);
|
||||
return (mean + std_dev * z);
|
||||
|
||||
return (mean + std_dev * rand_normal());
|
||||
}
|
||||
|
||||
inline double exponential(double mean) {
|
||||
|
|
19
lib/util.cpp
19
lib/util.cpp
|
@ -551,3 +551,22 @@ bool boinc_is_finite(double x) {
|
|||
#endif
|
||||
}
|
||||
|
||||
#define PI2 (2*3.1415926)
|
||||
|
||||
// generate normal random numbers using Box-Muller.
|
||||
// this generates 2 at a time, so cache the other one
|
||||
//
|
||||
double rand_normal() {
|
||||
static bool cached;
|
||||
static double cached_value;
|
||||
if (cached) {
|
||||
cached = false;
|
||||
return cached_value;
|
||||
}
|
||||
double u1 = drand();
|
||||
double u2 = drand();
|
||||
double z = sqrt(-2*log(u1));
|
||||
cached_value = z*sin(PI2*u2);
|
||||
cached = true;
|
||||
return z*cos(PI2*u2);
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ extern void push_unique(std::string, std::vector<std::string>&);
|
|||
static inline double drand() {
|
||||
return (double)rand()/(double)RAND_MAX;
|
||||
}
|
||||
extern double rand_normal();
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
|
|
|
@ -659,9 +659,11 @@ BEST_APP_VERSION* get_app_version(
|
|||
|
||||
estimate_flops(host_usage, av);
|
||||
|
||||
// pick the fastest version
|
||||
// pick the fastest version.
|
||||
// Throw in a random factor in case the estimates are off.
|
||||
//
|
||||
if (host_usage.projected_flops > bavp->host_usage.projected_flops) {
|
||||
double r = 1 + .1*rand_normal();
|
||||
if (r*host_usage.projected_flops > bavp->host_usage.projected_flops) {
|
||||
bavp->host_usage = host_usage;
|
||||
bavp->avp = &av;
|
||||
bavp->reliable = app_version_is_reliable(av.id);
|
||||
|
|
Loading…
Reference in New Issue