diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 63dd0c4908..7dc8e8a4d5 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -340,22 +340,13 @@ void PROJECT_WORK_FETCH::reset(PROJECT* p) { /////////////// WORK_FETCH /////////////// -// mark the projects from which we can fetch work -// -void WORK_FETCH::compute_cant_fetch_work_reason() { - for (unsigned int i=0; ipwf.cant_fetch_work_reason = p->pwf.compute_cant_fetch_work_reason(p); - } -} - void WORK_FETCH::rr_init() { for (int i=0; ipwf.cant_fetch_work_reason = p->pwf.compute_cant_fetch_work_reason(p); p->pwf.n_runnable_jobs = 0; for (int j=0; jrsc_pwf[j].rr_init(p, j); @@ -363,72 +354,6 @@ void WORK_FETCH::rr_init() { } } -#if 0 -// if the given project is highest-priority among the projects -// eligible for the resource, set request fields -// -void RSC_WORK_FETCH::supplement(PROJECT* pp) { - double x = pp->sched_priority; - for (unsigned i=0; ipwf.cant_fetch_work_reason) continue; - if (!project_state(p).may_have_work) continue; - RSC_PROJECT_WORK_FETCH& rpwf = project_state(p); - if (rpwf.anon_skip) continue; - if (p->sched_priority > x) { - if (log_flags.work_fetch_debug) { - msg_printf(pp, MSG_INFO, - "[work_fetch]: not requesting work for %s: %s has higher priority", - rsc_name_long(rsc_type), p->get_project_name() - ); - } - return; - } - } - // didn't find a better project; ask for work - // - set_request(pp); -} - -// we're going to ask the given project for work of the given type. -// (or -1 if none) -// Set requests for this type and perhaps other types -// -void WORK_FETCH::set_all_requests_hyst(PROJECT* p, int rsc_type) { - for (int i=0; i gstate.work_buf_total()) { - continue; - } - - // don't fetch work if backup project and no idle instances - // - if (p->resource_share==0 && rsc_work_fetch[i].nidle_now==0) { - continue; - } - - if (i>0 && !gpus_usable) { - continue; - } - rsc_work_fetch[i].supplement(p); - } - } -} - -void WORK_FETCH::set_all_requests(PROJECT* p) { - for (int i=0; ianonymous_platform) continue; for (int k=0; krsc_pwf[k].anon_skip = true; + p->rsc_pwf[k].anonymous_platform_no_apps = true; } for (j=0; jproject != p) continue; - p->rsc_pwf[avp->gpu_usage.rsc_type].anon_skip = false; + p->rsc_pwf[avp->gpu_usage.rsc_type].anonymous_platform_no_apps = false; } } } diff --git a/client/work_fetch.h b/client/work_fetch.h index a2d0e23561..8b2fb7c75e 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -27,7 +27,7 @@ #define RSC_TYPE_ANY -1 #define RSC_TYPE_CPU 0 -// reasons for not fetching work +// reasons for not fetching work from a project // #define CANT_FETCH_WORK_NON_CPU_INTENSIVE 1 #define CANT_FETCH_WORK_SUSPENDED_VIA_GUI 2 @@ -74,7 +74,7 @@ struct RSC_PROJECT_WORK_FETCH { } double queue_est; // an estimate of instance-secs of queued work; - bool anon_skip; + bool anonymous_platform_no_apps; // set if this project is anonymous platform // and it has no app version that uses this resource double fetchable_share; @@ -101,7 +101,7 @@ struct RSC_PROJECT_WORK_FETCH { backoff_interval = 0; secs_this_rec_interval = 0; queue_est = 0; - anon_skip = false; + anonymous_platform_no_apps = false; fetchable_share = 0; n_runnable_jobs = 0; sim_nused = 0; @@ -305,7 +305,6 @@ struct WORK_FETCH { void set_all_requests_hyst(PROJECT*, int rsc_type); void print_state(); void init(); - void compute_cant_fetch_work_reason(); void rr_init(); void clear_request(); void compute_shares();