- client: when we're making a scheduler RPC

for a reason other than work fetch,
    and we're deciding whether to piggyback a work request,
    skip the checks for hysteresis (buffer < min)
    and for per-resource backoff time.
    These checks are there only to limit the rate of RPCs,
    which is not relevant since we're doing one any.

    This fixes a bug where a project w/ sporadic jobs specifies
    a next_rpc_delay to ensure regular polling from clients.
    When these polls occur they should request work regardless of backoff.


svn path=/trunk/boinc/; revision=26002
This commit is contained in:
David Anderson 2012-08-10 18:29:00 +00:00
parent d49976d6c6
commit ff1a391ced
3 changed files with 50 additions and 12 deletions

View File

@ -5385,4 +5385,19 @@ Charlie 8 Aug 2012
clientgui/
DlgItemProperties.cpp
David 10 Aug 2012
- client: when we're making a scheduler RPC
for a reason other than work fetch,
and we're deciding whether to piggyback a work request,
skip the checks for hysteresis (buffer < min)
and for per-resource backoff time.
These checks are there only to limit the rate of RPCs,
which is not relevant since we're doing one any.
This fixes a bug where a project w/ sporadic jobs specifies
a next_rpc_delay to ensure regular polling from clients.
When these polls occur they should request work regardless of backoff.
client/
work_fetch.cpp,h

View File

@ -171,11 +171,13 @@ RSC_PROJECT_WORK_FETCH& RSC_WORK_FETCH::project_state(PROJECT* p) {
return p->rsc_pwf[rsc_type];
}
#if 0
bool RSC_WORK_FETCH::may_have_work(PROJECT* p) {
if (dont_fetch(p, rsc_type)) return false;
RSC_PROJECT_WORK_FETCH& w = project_state(p);
return (w.backoff_time < gstate.now);
}
#endif
void RSC_WORK_FETCH::rr_init() {
shortfall = 0;
@ -220,17 +222,37 @@ static bool wacky_dcf(PROJECT* p) {
// If this resource is below min buffer level,
// return the highest-priority project that may have jobs for it.
//
PROJECT* RSC_WORK_FETCH::choose_project_hyst(bool enforce_hyst) {
// If strict is true, enforce hysteresis and backoff rules
// (which are there to limit rate of scheduler RPCs).
// Otherwise, we're going to do a scheduler RPC anyway
// and we're deciding whether to piggyback a work request,
// so there is no reason to enforce these rules.
//
PROJECT* RSC_WORK_FETCH::choose_project_hyst(bool strict) {
PROJECT* pbest = NULL;
if (enforce_hyst) {
if (strict) {
if (saturated_time > gstate.work_buf_min()) return NULL;
}
if (saturated_time > gstate.work_buf_total()) return NULL;
for (unsigned i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
// check whether we can fetch work of any type from this project
//
if (p->pwf.cant_fetch_work_reason) continue;
if (!project_state(p).may_have_work) continue;
// check whether we can fetch work of this type
//
if (dont_fetch(p, rsc_type)) continue;
// if strict, check backoff
//
if (strict) {
if (project_state(p).backoff_time > gstate.now) {
continue;
}
}
// if project has zero resource share,
// only fetch work if a device is idle
@ -626,7 +648,7 @@ PROJECT* WORK_FETCH::non_cpu_intensive_project_needing_work() {
// choose a project to fetch work from,
// and set the request fields of resource objects
//
PROJECT* WORK_FETCH::choose_project(bool enforce_hyst) {
PROJECT* WORK_FETCH::choose_project(bool strict) {
PROJECT* p;
if (log_flags.work_fetch_debug) {
@ -659,12 +681,12 @@ PROJECT* WORK_FETCH::choose_project(bool enforce_hyst) {
if (use_hyst_fetch) {
if (gpus_usable) {
for (int i=1; i<coprocs.n_rsc; i++) {
p = rsc_work_fetch[i].choose_project_hyst(enforce_hyst);
p = rsc_work_fetch[i].choose_project_hyst(strict);
if (p) break;
}
}
if (!p) {
p = rsc_work_fetch[0].choose_project_hyst(enforce_hyst);
p = rsc_work_fetch[0].choose_project_hyst(strict);
}
} else {
if (gpus_usable) {

View File

@ -234,7 +234,7 @@ struct RSC_WORK_FETCH {
void accumulate_shortfall(double d_time);
void update_saturated_time(double dt);
void update_busy_time(double dur, double nused);
PROJECT* choose_project_hyst(bool enforce_hyst);
PROJECT* choose_project_hyst(bool strict);
PROJECT* choose_project(int);
void supplement(PROJECT*);
RSC_PROJECT_WORK_FETCH& project_state(PROJECT*);
@ -279,10 +279,11 @@ struct PROJECT_WORK_FETCH {
// global work fetch state
//
struct WORK_FETCH {
PROJECT* choose_project(bool enforce_hyst);
// find a project to ask for work
// if enforce_hystis false,
// consider requesting work even if buffer is above min level
PROJECT* choose_project(bool strict);
// Find a project to ask for work.
// If strict is false consider requesting work
// even if buffer is above min level
// or project is backed off for a resource type
PROJECT* non_cpu_intensive_project_needing_work();
void compute_work_request(PROJECT*);
// we're going to contact this project anyway;