client: don't fetch work if project has > max(2000, ncpus*100) runnable jobs

This commit is contained in:
David Anderson 2013-07-09 11:17:56 -07:00
parent a8485f3d3f
commit 782a11e22f
1 changed files with 4 additions and 2 deletions

View File

@ -665,11 +665,13 @@ void WORK_FETCH::setup() {
p->sched_priority -= rp->estimated_flops_remaining()/max_queued_flops;
}
// don't request work from projects w/ > 1000 runnable jobs
// don't request work from projects w/ > 100 runnable jobs per CPU
//
int job_limit = 100 * gstate.ncpus;
if (job_limit > 2000) job_limit = 2000;
for (unsigned int i=0; i<gstate.projects.size(); i++) {
PROJECT* p = gstate.projects[i];
if (p->pwf.n_runnable_jobs > 1000 && !p->pwf.cant_fetch_work_reason) {
if (p->pwf.n_runnable_jobs > job_limit && !p->pwf.cant_fetch_work_reason) {
p->pwf.cant_fetch_work_reason = CANT_FETCH_WORK_TOO_MANY_RUNNABLE;
}
}