From 29c1751898ef6dc7a64c1d21ba98c93af1ba6f34 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 31 Aug 2009 03:42:01 +0000 Subject: [PATCH] - client: if project is anonymous platform, set the overall work req to the max of the requests for different resource types. Otherwise projects with old schedulers won't send us work. svn path=/trunk/boinc/; revision=18945 --- checkin_notes | 9 +++++++++ client/cs_scheduler.cpp | 2 +- client/work_fetch.cpp | 18 ++++++++++++++++-- client/work_fetch.h | 2 +- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/checkin_notes b/checkin_notes index 558c0e33e6..b6c8d5ad8a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7317,3 +7317,12 @@ David 29 Aug 2009 client/ cpu_sched.cpp gui_rpc_server_ops.cpp + +David 30 Aug 2009 + - client: if project is anonymous platform, set the overall work req + to the max of the requests for different resource types. + Otherwise projects with old schedulers won't send us work. + + client/ + cs_scheduler.cpp + work_fetch.cpp,h diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index 9e42c1d985..42bca0f1e3 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -132,7 +132,7 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { p->duration_correction_factor, g_use_sandbox?1:0 ); - work_fetch.write_request(f); + work_fetch.write_request(f, p->anonymous_platform); // write client capabilities // diff --git a/client/work_fetch.cpp b/client/work_fetch.cpp index 1374e5ccf7..f7c4938c5d 100644 --- a/client/work_fetch.cpp +++ b/client/work_fetch.cpp @@ -745,13 +745,27 @@ bool RSC_PROJECT_WORK_FETCH::debt_eligible(PROJECT* p, RSC_WORK_FETCH& rwf) { return true; } -void WORK_FETCH::write_request(FILE* f) { +void WORK_FETCH::write_request(FILE* f, bool anonymous_platform) { + double work_req = cpu_work_fetch.req_secs; + + // if project is anonymous platform, set the overall work req + // to the max of the requests for different resource types. + // Otherwise projects with old schedulers won't send us work. + // + if (anonymous_platform) { + if (coproc_cuda && cuda_work_fetch.req_secs > work_req) { + work_req = cuda_work_fetch.req_secs; + } + if (coproc_ati && ati_work_fetch.req_secs > work_req) { + work_req = ati_work_fetch.req_secs; + } + } fprintf(f, " %f\n" " %f\n" " %d\n" " %f\n", - cpu_work_fetch.req_secs, + work_req, cpu_work_fetch.req_secs, cpu_work_fetch.req_instances, cpu_work_fetch.req_secs?cpu_work_fetch.busy_time:0 diff --git a/client/work_fetch.h b/client/work_fetch.h index 17de9423dd..cd023929b5 100644 --- a/client/work_fetch.h +++ b/client/work_fetch.h @@ -170,7 +170,7 @@ struct WORK_FETCH { // we're going to contact this project anyway; // decide how much work to task for void accumulate_inst_sec(ACTIVE_TASK*, double dt); - void write_request(FILE*); + void write_request(FILE*, bool anonymous_platform); void handle_reply(PROJECT*, std::vectornew_results); void set_initial_work_request(); void set_shortfall_requests(PROJECT*);