Skip to content

Commit

Permalink
client: add separate config item for process priority of GPU/NCI/wrap…
Browse files Browse the repository at this point in the history
…per jobs
  • Loading branch information
davidpanderson committed Sep 30, 2015
1 parent 3d6e1e5 commit 517cc53
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 12 deletions.
5 changes: 3 additions & 2 deletions client/app_start.cpp
Expand Up @@ -512,8 +512,9 @@ int ACTIVE_TASK::copy_output_files() {
}

static int get_priority(bool is_high_priority) {
int p = is_high_priority?cc_config.process_priority_special:cc_config.process_priority;
#ifdef _WIN32
switch (cc_config.default_process_priority) {
switch (p) {
case 0: return IDLE_PRIORITY_CLASS;
case 1: return BELOW_NORMAL_PRIORITY_CLASS;
case 2: return NORMAL_PRIORITY_CLASS;
Expand All @@ -523,7 +524,7 @@ static int get_priority(bool is_high_priority) {
}
return is_high_priority ? BELOW_NORMAL_PRIORITY_CLASS : IDLE_PRIORITY_CLASS;
#else
switch (cc_config.default_process_priority) {
switch (p) {
case 0: return PROCESS_IDLE_PRIORITY;
case 1: return PROCESS_MEDIUM_PRIORITY;
case 2: return PROCESS_NORMAL_PRIORITY;
Expand Down
3 changes: 2 additions & 1 deletion client/log_flags.cpp
Expand Up @@ -417,6 +417,8 @@ int CC_CONFIG::parse_options_client(XML_PARSER& xp) {
if (xp.parse_bool("no_info_fetch", no_info_fetch)) continue;
if (xp.parse_bool("no_priority_change", no_priority_change)) continue;
if (xp.parse_bool("os_random_only", os_random_only)) continue;
if (xp.parse_int("process_priority", process_priority)) continue;
if (xp.parse_int("process_priority_special", process_priority_special)) continue;
#ifndef SIM
if (xp.match_tag("proxy_info")) {
retval = proxy_info.parse_config(xp);
Expand Down Expand Up @@ -446,7 +448,6 @@ int CC_CONFIG::parse_options_client(XML_PARSER& xp) {
if (xp.parse_bool("use_certs", use_certs)) continue;
if (xp.parse_bool("use_certs_only", use_certs_only)) continue;
if (xp.parse_bool("vbox_window", vbox_window)) continue;
if (xp.parse_int("default_process_priority", default_process_priority)) continue;

msg_printf_notice(NULL, false,
"http://boinc.berkeley.edu/manager_links.php?target=notice&controlid=config",
Expand Down
20 changes: 12 additions & 8 deletions lib/cc_config.cpp
Expand Up @@ -238,6 +238,8 @@ void CC_CONFIG::defaults() {
no_info_fetch = false;
no_priority_change = false;
os_random_only = false;
process_priority = -1;
process_priority_special = -1;
proxy_info.clear();
rec_half_life = 10*86400;
#ifdef ANDROID
Expand All @@ -257,7 +259,6 @@ void CC_CONFIG::defaults() {
use_certs = false;
use_certs_only = false;
vbox_window = false;
default_process_priority = -1;
}

int EXCLUDE_GPU::parse(XML_PARSER& xp) {
Expand Down Expand Up @@ -406,6 +407,8 @@ int CC_CONFIG::parse_options(XML_PARSER& xp) {
if (xp.parse_bool("no_info_fetch", no_info_fetch)) continue;
if (xp.parse_bool("no_priority_change", no_priority_change)) continue;
if (xp.parse_bool("os_random_only", os_random_only)) continue;
if (xp.parse_int("process_priority", process_priority)) continue;
if (xp.parse_int("process_priority_special", process_priority_special)) continue;
#ifndef SIM
if (xp.match_tag("proxy_info")) {
proxy_info.parse_config(xp);
Expand All @@ -430,7 +433,6 @@ int CC_CONFIG::parse_options(XML_PARSER& xp) {
if (xp.parse_bool("use_certs", use_certs)) continue;
if (xp.parse_bool("use_certs_only", use_certs_only)) continue;
if (xp.parse_bool("vbox_window", vbox_window)) continue;
if (xp.parse_int("default_process_priority", default_process_priority)) continue;

xp.skip_unexpected(true, "CC_CONFIG::parse_options");
}
Expand Down Expand Up @@ -627,7 +629,9 @@ int CC_CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) {
" <no_gpus>%d</no_gpus>\n"
" <no_info_fetch>%d</no_info_fetch>\n"
" <no_priority_change>%d</no_priority_change>\n"
" <os_random_only>%d</os_random_only>\n",
" <os_random_only>%d</os_random_only>\n"
" <process_priority>%d</process_priority>\n"
" <process_priority_special>%d</process_priority_special>\n",
max_event_log_lines,
max_file_xfers,
max_file_xfers_per_project,
Expand All @@ -640,7 +644,9 @@ int CC_CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) {
no_gpus,
no_info_fetch,
no_priority_change,
os_random_only
os_random_only,
process_priority,
process_priority_special
);

proxy_info.write(out);
Expand All @@ -659,8 +665,7 @@ int CC_CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) {
" <use_all_gpus>%d</use_all_gpus>\n"
" <use_certs>%d</use_certs>\n"
" <use_certs_only>%d</use_certs_only>\n"
" <vbox_window>%d</vbox_window>\n"
" <default_process_priority>%d</default_process_priority>\n",
" <vbox_window>%d</vbox_window>\n",
rec_half_life/86400,
report_results_immediately,
run_apps_manually,
Expand All @@ -674,8 +679,7 @@ int CC_CONFIG::write(MIOFILE& out, LOG_FLAGS& log_flags) {
use_all_gpus,
use_certs,
use_certs_only,
vbox_window,
default_process_priority
vbox_window
);

out.printf(" </options>\n</cc_config>\n");
Expand Down
3 changes: 2 additions & 1 deletion lib/cc_config.h
Expand Up @@ -177,6 +177,8 @@ struct CC_CONFIG {
bool no_info_fetch;
bool no_priority_change;
bool os_random_only;
int process_priority;
int process_priority_special;
PROXY_INFO proxy_info;
double rec_half_life;
bool report_results_immediately;
Expand All @@ -193,7 +195,6 @@ struct CC_CONFIG {
bool use_certs_only;
// overrides use_certs
bool vbox_window;
int default_process_priority;

CC_CONFIG();
void defaults();
Expand Down

0 comments on commit 517cc53

Please sign in to comment.