svn path=/trunk/boinc/; revision=20284

This commit is contained in:
David Anderson 2010-01-27 19:14:29 +00:00
parent d1a3243f57
commit ee889ac9dd
4 changed files with 25 additions and 10 deletions

View File

@ -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

View File

@ -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);
}
}

View File

@ -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));

View File

@ -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;
}