From 46d9e8f08741c83d3b6d995cc1db34d40de7e139 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Tue, 30 Jun 2009 20:22:54 +0000 Subject: [PATCH] - client: record the time results are received. Process non-EDF GPU jobs in this order. svn path=/trunk/boinc/; revision=18531 --- checkin_notes | 14 ++++++++++++++ client/client_types.cpp | 6 +++++- client/client_types.h | 3 ++- client/cpu_sched.cpp | 7 +++++-- client/cs_scheduler.cpp | 1 + clientgui/DlgItemProperties.cpp | 2 ++ lib/gui_rpc_client.h | 3 ++- lib/gui_rpc_client_ops.cpp | 3 ++- 8 files changed, 33 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index d92e56ce67..8449d1c9d6 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6118,3 +6118,17 @@ Rom 30 June 2009 lib/ gui_rpc_client.h gui_rpc_client_ops.cpp + +David 30 June 2009 + - client: record the time results are received. + Process non-EDF GPU jobs in this order. + + client/ + client_types.cpp,h + cpu_sched.cpp + cs_scheduler.cpp + clientgui/ + DltItemProperties.cpp + lib/ + gui_rpc_client_ops.cpp + gui_rpc_client.h diff --git a/client/client_types.cpp b/client/client_types.cpp index a02a6c9e36..df958f540b 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -1441,6 +1441,7 @@ void RESULT::clear() { strcpy(name, ""); strcpy(wu_name, ""); report_deadline = 0; + received_time = 0; output_files.clear(); _state = RESULT_NEW; ready_to_report = false; @@ -1518,6 +1519,7 @@ int RESULT::parse_state(MIOFILE& in) { } if (parse_str(buf, "", name, sizeof(name))) continue; if (parse_str(buf, "", wu_name, sizeof(wu_name))) continue; + if (parse_double(buf, "", received_time)) continue; if (parse_double(buf, "", report_deadline)) { continue; } @@ -1643,8 +1645,10 @@ int RESULT::write(MIOFILE& out, bool to_server) { out.printf( " %s\n" " %f\n", + " %f\n", wu_name, - report_deadline + report_deadline, + received_time ); for (i=0; irunnable()) continue; if (rp->project->non_cpu_intensive) continue; if (rp->already_selected) continue; if (!rp->uses_coprocs()) continue; - return rp; + if (!best || (rp->received_time < best->received_time)) { + best = rp; + } } - return NULL; + return best; } // Return earliest-deadline result. diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index f27669f560..adfad2a536 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -811,6 +811,7 @@ int CLIENT_STATE::handle_scheduler_reply(PROJECT* project, char* scheduler_url) continue; } rp->wup->version_num = rp->version_num; + rp->received_time = now; results.push_back(rp); new_results.push_back(rp); rp->set_state(RESULT_NEW, "handle_scheduler_reply"); diff --git a/clientgui/DlgItemProperties.cpp b/clientgui/DlgItemProperties.cpp index 29f21bff41..dc1f3e19ae 100755 --- a/clientgui/DlgItemProperties.cpp +++ b/clientgui/DlgItemProperties.cpp @@ -167,6 +167,8 @@ void CDlgItemProperties::renderInfos(RESULT* result) { addProperty(_("Application"), FormatApplicationName(result)); addProperty(_("Workunit name"),wxString(result->wu_name.c_str(),wxConvUTF8)); addProperty(_("State"), FormatStatus(result)); + dt.Set((time_t)result->received_time); + addProperty(_("Received"), dt.Format()); dt.Set((time_t)result->report_deadline); addProperty(_("Report deadline"), dt.Format()); if (result->resources.size()) { diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index d70d30ec6c..e0148bb25a 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -220,7 +220,8 @@ public: std::string project_url; int version_num; std::string plan_class; - int report_deadline; + double report_deadline; + double received_time; bool ready_to_report; bool got_server_ack; double final_cpu_time; diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index 88cb3535b9..90ba9c5275 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -421,7 +421,8 @@ int RESULT::parse(MIOFILE& in) { if (parse_int(buf, "", version_num)) continue; if (parse_str(buf, "", plan_class)) continue; if (parse_str(buf, "", project_url)) continue; - if (parse_int(buf, "", report_deadline)) continue; + if (parse_double(buf, "", report_deadline)) continue; + if (parse_double(buf, "", received_time)) continue; if (parse_bool(buf, "ready_to_report", ready_to_report)) continue; if (parse_bool(buf, "got_server_ack", got_server_ack)) continue; if (parse_bool(buf, "suspended_via_gui", suspended_via_gui)) continue;