From ee889ac9ddaa864fd006836c629e674c2cb89377 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 27 Jan 2010 19:14:29 +0000 Subject: [PATCH] svn path=/trunk/boinc/; revision=20284 --- checkin_notes | 11 +++++++++++ client/work_fetch.cpp | 16 ++++++++-------- client/work_fetch.h | 2 +- lib/gui_rpc_client_ops.cpp | 6 +++++- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8c19c893d8..16f79730c1 100644 --- a/checkin_notes +++ b/checkin_notes @@ -741,3 +741,14 @@ David 27 Jan 2010 client/ work_fetch.cpp + +David 27 Jan 2010 + - client: fix work fetch bug that prevented getting work + from an overworked project, + even if idle instance or major shortfall. + - GUI RPC: finish the notice-duplication thing + + client/ + work_fetch.cpp,h + lib/ + gui_rpc_client_ops.cpp diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index d60d0eb6b8..7093c5f9a1 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -313,11 +313,11 @@ PROJECT* RSC_WORK_FETCH::choose_project(int criterion) { work_fetch.clear_request(); switch (criterion) { case FETCH_IF_IDLE_INSTANCE: - set_request(pbest); - break; case FETCH_IF_MAJOR_SHORTFALL: + set_request(pbest, true); + break; case FETCH_IF_PROJECT_STARVED: - set_request(pbest); + set_request(pbest, false); break; case FETCH_IF_MINOR_SHORTFALL: // in this case, potentially request work for all resources @@ -351,10 +351,10 @@ PROJECT* RSC_WORK_FETCH::choose_project(int criterion) { // request this project's share of shortfall and instances. // don't request anything if project is overworked or backed off. // -void RSC_WORK_FETCH::set_request(PROJECT* p) { +void RSC_WORK_FETCH::set_request(PROJECT* p, bool allow_overworked) { RSC_PROJECT_WORK_FETCH& w = project_state(p); if (!w.may_have_work) return; - if (w.overworked()) return; + if (!allow_overworked && w.overworked()) return; if (shortfall) { if (wacky_dcf(p)) { // if project's DCF is too big or small, @@ -652,12 +652,12 @@ void WORK_FETCH::rr_init() { } void WORK_FETCH::set_all_requests(PROJECT* p) { - cpu_work_fetch.set_request(p); + cpu_work_fetch.set_request(p, false); if (coproc_cuda && gpus_usable) { - cuda_work_fetch.set_request(p); + cuda_work_fetch.set_request(p, false); } if (coproc_ati && gpus_usable) { - ati_work_fetch.set_request(p); + ati_work_fetch.set_request(p, false); } } diff --git a/client/work_fetch.h b/client/work_fetch.h index df2c522723..a42f2dd87b 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -209,7 +209,7 @@ struct RSC_WORK_FETCH { void update_short_term_debts(); void print_state(const char*); void clear_request(); - void set_request(PROJECT*); + void set_request(PROJECT*, bool allow_overworked); bool may_have_work(PROJECT*); RSC_WORK_FETCH() { memset(this, 0, sizeof(*this)); diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index bf6330b872..4a2cba0ba8 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -2310,7 +2310,11 @@ static int parse_notices(MIOFILE& fin, NOTICES& notices) { NOTICE* np = new NOTICE(); retval = np->parse(xp); if (!retval) { - notices.notices.insert(notices.notices.begin(), np); + if (np->seqno == -1) { + notices.notices.clear(); + } else { + notices.notices.insert(notices.notices.begin(), np); + } } else { delete np; }