- client: add a <dont_throttle/> flag to APP_VERSION.

If set, the app does its own CPU throttling
    so the client doesn't have to.


svn path=/trunk/boinc/; revision=23748
This commit is contained in:
David Anderson 2011-06-17 19:16:07 +00:00
parent 3965d0b1f4
commit 16fd2b2070
5 changed files with 27 additions and 3 deletions

View File

@ -3609,3 +3609,12 @@ Rom 17 Jun 2011
clientgui/
ProjectInfoPage.cpp, .h
David 17 Jun 2011
- client: add a <dont_throttle/> flag to APP_VERSION.
If set, the app does its own CPU throttling
so the client doesn't have to.
client/
client_types.cpp,h
app_control.cpp

View File

@ -952,7 +952,7 @@ void ACTIVE_TASK_SET::suspend_all(int reason) {
// if we're doing CPU throttling, don't bother suspending apps
// that don't use a full CPU
//
if (atp->result->non_cpu_intensive()) continue;
if (atp->result->dont_throttle()) continue;
if (atp->app_version->avg_ncpus < 1) continue;
atp->preempt(REMOVE_NEVER);
break;

View File

@ -1301,6 +1301,7 @@ int APP_VERSION::parse(MIOFILE& in) {
flops = gstate.host_info.p_fpops;
missing_coproc = false;
strcpy(missing_coproc_name, "");
dont_throttle = false;
while (in.fgets(buf, 256)) {
if (match_tag(buf, "</app_version>")) return 0;
@ -1337,6 +1338,7 @@ int APP_VERSION::parse(MIOFILE& in) {
}
continue;
}
if (parse_bool(buf, "dont_throttle", dont_throttle)) continue;
if (log_flags.unparsed_xml) {
msg_printf(0, MSG_INFO,
"[unparsed_xml] APP_VERSION::parse(): unrecognized: %s\n", buf
@ -1406,6 +1408,11 @@ int APP_VERSION::write(MIOFILE& out, bool write_file_info) {
gpu_ram
);
}
if (dont_throttle) {
out.printf(
" <dont_throttle/>\n"
);
}
out.printf(
"</app_version>\n"

View File

@ -541,6 +541,7 @@ struct APP_VERSION {
bool missing_coproc;
double missing_coproc_usage;
char missing_coproc_name[256];
bool dont_throttle;
int index; // temp var for make_scheduler_request()
#ifdef SIM
@ -699,7 +700,14 @@ struct RESULT {
return avp->gpu_usage.rsc_type;
}
inline bool non_cpu_intensive() {
return project->non_cpu_intensive || app->non_cpu_intensive;
if (project->non_cpu_intensive) return true;
if (app->non_cpu_intensive) return true;
return false;
}
inline bool dont_throttle() {
if (non_cpu_intensive()) return true;
if (avp->dont_throttle) return true;
return false;
}
// temporaries used in CLIENT_STATE::rr_simulation():

View File

@ -46,7 +46,7 @@ foreach($proj_list as $p) {
<url>$p->url</url>
<general_area>$p->general_area</general_area>
<specific_area>$p->specific_area</specific_area>
<description>$p->description</description>
<description><![CDATA[$p->description]]></description>
<home>$p->home</home>
";
$platforms = get_platforms_cached($p->web_url);