- client, work fetch policy:

adjust project REC by the amount of work queued, to increase variety
    NOTE: at some point I think I had a reason to not do this,
    but I can't remember what it is.
- client, job scheduling policy: fix how project REC is adjusted


svn path=/trunk/boinc/; revision=23838
This commit is contained in:
David Anderson 2011-07-13 19:46:03 +00:00
parent f44c9910e7
commit 8ca24cbbab
8 changed files with 46 additions and 16 deletions

View File

@ -4078,3 +4078,19 @@ David 12 July 2011
sched/
credit.cpp
David 13 July 2011
- client, work fetch policy:
adjust project REC by the amount of work queued, to increase variety
NOTE: at some point I think I had a reason to not do this,
but I can't remember what it is.
- client, job scheduling policy: fix how project REC is adjusted
client/
work_fetch.cpp,h
cpu_sched.cpp
lib/
common_defs.h
sched/
credit.cpp,h
trickle_credit.cpp

View File

@ -539,7 +539,7 @@ static void update_rec() {
for (int j=0; j<coprocs.n_rsc; j++) {
x += p->rsc_pwf[j].secs_this_debt_interval * f * rsc_work_fetch[j].relative_speed;
}
x /= 1e9;
x *= COBBLESTONE_SCALE;
double old = p->pwf.rec;
// start averages at zero
@ -619,12 +619,24 @@ double project_priority(PROJECT* p) {
return x;
}
// we plan to run this job.
// bump the project's REC accordingly
// called from the scheduler's job-selection loop;
// we plan to run this job;
// bump the project's temp REC by the amount credit for 1 scheduling period.
// This encourages a mixture jobs from different projects.
//
void adjust_rec_temp(RESULT* rp) {
void adjust_rec_sched(RESULT* rp) {
PROJECT* p = rp->project;
p->pwf.rec_temp += peak_flops(rp->avp)/86400;
double f = peak_flops(rp->avp)*gstate.global_prefs.cpu_scheduling_period();
p->pwf.rec_temp += f*COBBLESTONE_SCALE;
}
// called from work fetch initialization;
// bump the project's temp REC by the amount of credit
// projected for the rest of the job.
//
void adjust_rec_work_fetch(RESULT* rp) {
PROJECT* p = rp->project;
p->pwf.rec_temp += rp->estimated_flops_remaining()*COBBLESTONE_SCALE;
}
// adjust project debts (short, long-term) or REC
@ -744,7 +756,7 @@ static bool schedule_if_possible(
proc_rsc.schedule(rp, atp);
if (use_rec) {
adjust_rec_temp(rp);
adjust_rec_sched(rp);
} else {
// project STD at end of time slice
//

View File

@ -898,6 +898,10 @@ PROJECT* WORK_FETCH::choose_project() {
compute_shares();
if (use_rec) {
project_priority_init();
for (unsigned int i=0; i<gstate.results.size(); i++) {
RESULT* rp = gstate.results[i];
adjust_rec_work_fetch(rp);
}
} else {
set_overall_debts();
}

View File

@ -306,7 +306,8 @@ extern WORK_FETCH work_fetch;
//#ifdef USE_REC
void project_priority_init();
double project_priority(PROJECT*);
void adjust_rec_temp(RESULT*);
void adjust_rec_sched(RESULT*);
void adjust_rec_work_fetch(RESULT*);
//#endif
#endif

View File

@ -25,6 +25,9 @@
#define GUI_RPC_PORT 31416
#define COBBLESTONE_SCALE 200/86400e9
// multiply normalized PFC by this to get Cobblestones
// run modes for CPU, GPU, network,
// controlled by Activity menu and snooze button
//

View File

@ -35,9 +35,8 @@
#include "credit.h"
// TODO: delete
double fpops_to_credit(double fpops) {
return (fpops/1e9)*COBBLESTONE_FACTOR/SECONDS_PER_DAY;
return fpops*COBBLESTONE_SCALE;
}
double cpu_time_to_credit(double cpu_time, HOST& host) {

View File

@ -19,10 +19,6 @@
#include "boinc_db.h"
// Historical note: named after Jeff Cobb
//
#define COBBLESTONE_FACTOR 100.0
#define ERROR_RATE_INIT 0.1
// the initial error rate of a host or app version
@ -30,8 +26,6 @@
// use host scaling only if have this many samples for host
#define MIN_VERSION_SAMPLES 100
// update a version's scale only if it has this many samples
#define COBBLESTONE_SCALE 200/86400e9
// multiply normalized PFC by this to get Cobblestones
// parameters for maintaining averages.
// per-host averages respond faster to change

View File

@ -21,7 +21,8 @@
//
// <cpu_time>x</cpu_time>
//
// NOTE: there is no cheat-prevention mechanism here.
// NOTE: there is no cheat-prevention mechanism here; add your own.
// NOTE: doesn't work for GPU apps
#include "error_numbers.h"
#include "util.h"