From 7e48057f4436343b0f5d885945d8b8f15ef432bc Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 8 Feb 2012 01:39:01 +0000 Subject: [PATCH] - client/Manager/GUI RPC: clean up RPC stuff involving resource-specific backoff and exclusion Old: client writes in GUI RPC entries for projects. Manager (GUI RPC client): PROJECT struct has cpu_backoff_time cpu_backoff_interval ... cuda, ati no_cpu_pref ... cuda, ati and it parses tags of these names. In other words, no information is being conveyed from client to Manager. New: manager parses both forms svn path=/trunk/boinc/; revision=25217 --- checkin_notes | 30 ++++++++++ clientgui/DlgItemProperties.cpp | 54 +++++++++++++---- doc/projects.inc | 8 +++ lib/gui_rpc_client.h | 74 ++++++++++------------- lib/gui_rpc_client_ops.cpp | 100 ++++++++++++++++++++++++++------ 5 files changed, 192 insertions(+), 74 deletions(-) diff --git a/checkin_notes b/checkin_notes index 7d08a7c235..f0f7e96c2b 100644 --- a/checkin_notes +++ b/checkin_notes @@ -1461,3 +1461,33 @@ Charlie 7 Feb 2012 client/ coproc_detect.cpp + +David 7 Feb 2012 + - client/Manager/GUI RPC: clean up RPC stuff involving + resource-specific backoff and exclusion + + Old: client writes + + + + + + in GUI RPC entries for projects. + Manager (GUI RPC client): PROJECT struct has + cpu_backoff_time + cpu_backoff_interval + ... cuda, ati + no_cpu_pref + ... cuda, ati + and it parses tags of these names. + In other words, no information is being conveyed + from client to Manager. + + New: + manager parses both forms + + clientgui/ + DlgItemProperties.cpp + lib/ + gui_rpc_client_ops.cpp + gui_rpc_client.h diff --git a/clientgui/DlgItemProperties.cpp b/clientgui/DlgItemProperties.cpp index aa50c157a0..dd59ec2e89 100644 --- a/clientgui/DlgItemProperties.cpp +++ b/clientgui/DlgItemProperties.cpp @@ -257,31 +257,61 @@ void CDlgItemProperties::renderInfos(PROJECT* project_in) { if (!project->non_cpu_intensive) { addSection(_("Scheduling")); - if (project->no_cpu_pref) { - addProperty(_("Project preference"), _("Don't fetch CPU tasks")); + if (project->rsc_desc_cpu.no_rsc_pref) { + addProperty(_("Don't fetch CPU tasks"), _("Project preference")); + } + if (project->rsc_desc_cpu.no_rsc_ams) { + addProperty(_("Don't fetch CPU tasks"), _("Account manager preference")); + } + if (project->rsc_desc_cpu.no_rsc_apps) { + addProperty(_("Don't fetch CPU tasks"), _("Project has no CPU apps")); } addProperty(_("Scheduling priority"),wxString::Format(wxT("%0.2f"), project->sched_priority)); - double x = project->cpu_backoff_time - dtime(); + double x = project->rsc_desc_cpu.backoff_time - dtime(); if (x<0) x = 0; addProperty(_("CPU work fetch deferred for"), FormatTime(x)); - addProperty(_("CPU work fetch deferral interval"), FormatTime(project->cpu_backoff_interval)); + addProperty(_("CPU work fetch deferral interval"), FormatTime(project->rsc_desc_cpu.backoff_interval)); if (pDoc->state.have_nvidia) { - if (project->no_cuda_pref) { - addProperty(_("Project preference"), _("Don't fetch NVIDIA GPU tasks")); + if (project->rsc_desc_nvidia.no_rsc_pref) { + addProperty( + _("Don't fetch NVIDIA GPU tasks"), _("Project preference") + ); } - x = project->cuda_backoff_time - dtime(); + if (project->rsc_desc_nvidia.no_rsc_ams) { + addProperty( + _("Don't fetch NVIDIA GPU tasks"), _("Account manager preference") + ); + } + if (project->rsc_desc_nvidia.no_rsc_pref) { + addProperty( + _("Don't fetch NVIDIA GPU tasks"), _("Project preference") + ); + } + x = project->rsc_desc_nvidia.backoff_time - dtime(); if (x<0) x = 0; addProperty(_("NVIDIA GPU work fetch deferred for"), FormatTime(x)); - addProperty(_("NVIDIA GPU work fetch deferral interval"), FormatTime(project->cuda_backoff_interval)); + addProperty(_("NVIDIA GPU work fetch deferral interval"), FormatTime(project->rsc_desc_nvidia.backoff_interval)); } if (pDoc->state.have_ati) { - if (project->no_ati_pref) { - addProperty(_("Project preference"), _("Don't fetch ATI GPU tasks")); + if (project->rsc_desc_ati.no_rsc_pref) { + addProperty( + _("Don't fetch ATI GPU tasks"), _("Project preference") + ); } - x = project->ati_backoff_time - dtime(); + if (project->rsc_desc_ati.no_rsc_ams) { + addProperty( + _("Don't fetch ATI GPU tasks"), _("Account manager preference") + ); + } + if (project->rsc_desc_ati.no_rsc_pref) { + addProperty( + _("Don't fetch ATI GPU tasks"), _("Project preference") + ); + } + x = project->rsc_desc_ati.backoff_time - dtime(); if (x<0) x = 0; addProperty(_("ATI GPU work fetch deferred for"), FormatTime(x)); - addProperty(_("ATI GPU work fetch deferral interval"), FormatTime(project->ati_backoff_interval)); + addProperty(_("ATI GPU work fetch deferral interval"), FormatTime(project->rsc_desc_ati.backoff_interval)); } addProperty(_("Duration correction factor"),wxString::Format(wxT("%0.4f"), project->duration_correction_factor)); } diff --git a/doc/projects.inc b/doc/projects.inc index d9212714c9..8546e16fbd 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -284,6 +284,14 @@ $mixed = array( $math = array( tra("Mathematics, computing, and games"), array( + array( + "SAT@home", + "http://sat.isa.ru/pdsat", + "Institute for Systems Analysis, Russian Academy of Sciences", + "Computer Science", + "Solve hard and practically important problems (discrete functions inversion problems, discrete optimization, bioinformatics, etc.) that can be effectively reduced to Boolean satisfiability problem.", + "sat_logo.png" + ), array( "Mersenne@home", "http://mersenneathome.net/", diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index a2e5242372..c754e3a1f9 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -62,8 +62,7 @@ struct DAILY_STATS { }; -class PROJECT_LIST_ENTRY { -public: +struct PROJECT_LIST_ENTRY { std::string name; std::string url; std::string general_area; @@ -81,8 +80,7 @@ public: void clear(); }; -class AM_LIST_ENTRY { -public: +struct AM_LIST_ENTRY { std::string name; std::string url; std::string description; @@ -95,8 +93,7 @@ public: void clear(); }; -class ALL_PROJECTS_LIST { -public: +struct ALL_PROJECTS_LIST { std::vector projects; std::vector account_managers; @@ -107,8 +104,17 @@ public: void shuffle(); }; -class PROJECT { -public: +struct RSC_DESC { + double backoff_time; + double backoff_interval; + bool no_rsc_ams; + bool no_rsc_apps; + bool no_rsc_pref; + + void clear(); +}; + +struct PROJECT { char master_url[256]; double resource_share; std::string project_name; @@ -128,14 +134,12 @@ public: double download_backoff; double upload_backoff; + RSC_DESC rsc_desc_cpu; + RSC_DESC rsc_desc_nvidia; + RSC_DESC rsc_desc_ati; + double sched_priority; - double cpu_backoff_time; - double cpu_backoff_interval; - double cuda_backoff_time; - double cuda_backoff_interval; - double ati_backoff_time; - double ati_backoff_interval; double duration_correction_factor; bool anonymous_platform; @@ -156,9 +160,6 @@ public: double last_rpc_time; // when the last successful scheduler RPC finished std::vector statistics; // credit data over the last x days - bool no_cpu_pref; - bool no_cuda_pref; - bool no_ati_pref; char venue[256]; // NOTE: if you add any data items above, @@ -177,8 +178,7 @@ public: bool flag_for_delete; }; -class APP { -public: +struct APP { char name[256]; char user_friendly_name[256]; PROJECT* project; @@ -191,8 +191,7 @@ public: void clear(); }; -class APP_VERSION { -public: +struct APP_VERSION { char app_name[256]; int version_num; char platform[64]; @@ -214,8 +213,7 @@ public: void clear(); }; -class WORKUNIT { -public: +struct WORKUNIT { char name[256]; char app_name[256]; int version_num; // backwards compat @@ -234,8 +232,7 @@ public: void clear(); }; -class RESULT { -public: +struct RESULT { char name[256]; char wu_name[256]; char project_url[256]; @@ -295,8 +292,7 @@ public: void clear(); }; -class FILE_TRANSFER { -public: +struct FILE_TRANSFER { std::string name; std::string project_url; std::string project_name; @@ -327,8 +323,7 @@ public: void clear(); }; -class MESSAGE { -public: +struct MESSAGE { std::string project; int priority; int seqno; @@ -343,8 +338,7 @@ public: void clear(); }; -class GR_PROXY_INFO { -public: +struct GR_PROXY_INFO { bool use_http_proxy; bool use_socks_proxy; bool use_http_authentication; @@ -367,8 +361,7 @@ public: void clear(); }; -class CC_STATE { -public: +struct CC_STATE { std::vector projects; std::vector apps; std::vector app_versions; @@ -399,8 +392,7 @@ public: int parse(XML_PARSER&); }; -class PROJECTS { -public: +struct PROJECTS { std::vector projects; PROJECTS(){} @@ -424,8 +416,7 @@ struct DISK_USAGE { void clear(); }; -class RESULTS { -public: +struct RESULTS { std::vector results; RESULTS(){} @@ -435,8 +426,7 @@ public: void clear(); }; -class FILE_TRANSFERS { -public: +struct FILE_TRANSFERS { std::vector file_transfers; FILE_TRANSFERS(); @@ -446,8 +436,7 @@ public: void clear(); }; -class MESSAGES { -public: +struct MESSAGES { std::vector messages; MESSAGES(); @@ -457,8 +446,7 @@ public: void clear(); }; -class NOTICES { -public: +struct NOTICES { bool complete; // whether vector contains all notices, or just new ones std::vector notices; diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index f2dcfddc2a..aa505c296c 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -246,6 +246,7 @@ void PROJECT::get_name(std::string& s) { int PROJECT::parse(XML_PARSER& xp) { int retval; + char buf[256]; while (!xp.get_tag()) { if (xp.match_tag("/project")) return 0; @@ -272,12 +273,74 @@ int PROJECT::parse(XML_PARSER& xp) { if (xp.parse_double("download_backoff", download_backoff)) continue; if (xp.parse_double("upload_backoff", upload_backoff)) continue; if (xp.parse_double("sched_priority", sched_priority)) continue; - if (xp.parse_double("cpu_backoff_time", cpu_backoff_time)) continue; - if (xp.parse_double("cpu_backoff_interval", cpu_backoff_interval)) continue; - if (xp.parse_double("cuda_backoff_time", cuda_backoff_time)) continue; - if (xp.parse_double("cuda_backoff_interval", cuda_backoff_interval)) continue; - if (xp.parse_double("ati_backoff_time", ati_backoff_time)) continue; - if (xp.parse_double("ati_backoff_interval", ati_backoff_interval)) continue; + + // resource-specific stuff, old format + // + if (xp.parse_double("cpu_backoff_time", rsc_desc_cpu.backoff_time)) continue; + if (xp.parse_double("cpu_backoff_interval", rsc_desc_cpu.backoff_interval)) continue; + if (xp.parse_double("cuda_backoff_time", rsc_desc_nvidia.backoff_time)) continue; + if (xp.parse_double("cuda_backoff_interval", rsc_desc_nvidia.backoff_interval)) continue; + if (xp.parse_double("ati_backoff_time", rsc_desc_ati.backoff_time)) continue; + if (xp.parse_double("ati_backoff_interval", rsc_desc_ati.backoff_interval)) continue; + if (xp.parse_double("last_rpc_time", last_rpc_time)) continue; + if (xp.parse_bool("no_cpu_pref", rsc_desc_cpu.no_rsc_pref)) continue; + if (xp.parse_bool("no_cuda_pref", rsc_desc_cpu.no_rsc_pref)) continue; + + // resource-specific stuff, new format + // + if (xp.match_tag("rsc_backoff_time")) { + double value = 0; + while (!xp.get_tag()) { + if (xp.match_tag("/rsc_backoff_time")) { + if (!strcmp(buf, "CPU")) { + rsc_desc_cpu.backoff_time = value; + } else if (!strcmp(buf, "NVIDIA")) { + rsc_desc_nvidia.backoff_time = value; + } else if (!strcmp(buf, "ATI")) { + rsc_desc_ati.backoff_time = value; + } + } + if (xp.parse_str("name", buf, sizeof(buf))) continue; + if (xp.parse_double("value", value)) continue; + } + continue; + } + if (xp.match_tag("rsc_backoff_interval")) { + double value = 0; + while (!xp.get_tag()) { + if (xp.match_tag("/rsc_backoff_interval")) { + if (!strcmp(buf, "CPU")) { + rsc_desc_cpu.backoff_interval = value; + } else if (!strcmp(buf, "NVIDIA")) { + rsc_desc_nvidia.backoff_interval = value; + } else if (!strcmp(buf, "ATI")) { + rsc_desc_ati.backoff_interval = value; + } + } + if (xp.parse_str("name", buf, sizeof(buf))) continue; + if (xp.parse_double("value", value)) continue; + } + continue; + } + if (xp.parse_str("no_rsc_ams", buf, sizeof(buf))) { + if (!strcmp(buf, "CPU")) rsc_desc_cpu.no_rsc_ams = true; + else if (!strcmp(buf, "NVIDIA")) rsc_desc_nvidia.no_rsc_ams = true; + else if (!strcmp(buf, "ATI")) rsc_desc_ati.no_rsc_ams = true; + continue; + } + if (xp.parse_str("no_rsc_apps", buf, sizeof(buf))) { + if (!strcmp(buf, "CPU")) rsc_desc_cpu.no_rsc_apps = true; + else if (!strcmp(buf, "NVIDIA")) rsc_desc_nvidia.no_rsc_apps = true; + else if (!strcmp(buf, "ATI")) rsc_desc_ati.no_rsc_apps = true; + continue; + } + if (xp.parse_str("no_rsc_pref", buf, sizeof(buf))) { + if (!strcmp(buf, "cpu")) rsc_desc_cpu.no_rsc_pref = true; + else if (!strcmp(buf, "nvidia")) rsc_desc_nvidia.no_rsc_pref = true; + else if (!strcmp(buf, "ati")) rsc_desc_ati.no_rsc_pref = true; + continue; + } + if (xp.parse_double("duration_correction_factor", duration_correction_factor)) continue; if (xp.parse_bool("anonymous_platform", anonymous_platform)) continue; if (xp.parse_bool("master_url_fetch_pending", master_url_fetch_pending)) continue; @@ -304,15 +367,20 @@ int PROJECT::parse(XML_PARSER& xp) { continue; } if (xp.parse_double("project_files_downloaded_time", project_files_downloaded_time)) continue; - if (xp.parse_double("last_rpc_time", last_rpc_time)) continue; - if (xp.parse_bool("no_cpu_pref", no_cpu_pref)) continue; - if (xp.parse_bool("no_cuda_pref", no_cuda_pref)) continue; - if (xp.parse_bool("no_ati_pref", no_ati_pref)) continue; + if (xp.parse_bool("no_ati_pref", rsc_desc_cpu.no_rsc_pref)) continue; if (xp.parse_str("venue", venue, sizeof(venue))) continue; } return ERR_XML_PARSE; } +void RSC_DESC::clear() { + backoff_time = 0; + backoff_interval = 0; + no_rsc_ams = false; + no_rsc_apps = false; + no_rsc_pref = false; +} + void PROJECT::clear() { strcpy(master_url, ""); resource_share = 0; @@ -329,12 +397,9 @@ void PROJECT::clear() { min_rpc_time = 0; download_backoff = 0; upload_backoff = 0; - cpu_backoff_time = 0; - cpu_backoff_interval = 0; - cuda_backoff_time = 0; - cuda_backoff_interval = 0; - ati_backoff_time = 0; - ati_backoff_interval = 0; + rsc_desc_cpu.clear(); + rsc_desc_nvidia.clear(); + rsc_desc_ati.clear(); duration_correction_factor = 0; anonymous_platform = false; master_url_fetch_pending = false; @@ -351,9 +416,6 @@ void PROJECT::clear() { last_rpc_time = 0; gui_urls.clear(); statistics.clear(); - no_cpu_pref = false; - no_cuda_pref = false; - no_ati_pref = false; strcpy(venue, ""); }