diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index 82fc9e6ddd..9ac10c217e 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -711,21 +711,19 @@ void CLIENT_STATE::print_global_prefs() { // not in use // msg_printf(NULL, MSG_INFO, - "- When computer is not in use (defaults: same as in use)" + "- When computer is not in use" ); p = global_prefs.niu_max_ncpus_pct; - if (p) { - int n = (int)((host_info.p_ncpus * p)/100); - msg_printf(NULL, MSG_INFO, - "- max CPUs used: %d", n - ); - } - if (global_prefs.niu_cpu_usage_limit) { - msg_printf(NULL, MSG_INFO, - "- Use at most %.0f%% of the CPU time", - global_prefs.niu_cpu_usage_limit - ); - } + int n = (int)((host_info.p_ncpus * p)/100); + msg_printf(NULL, MSG_INFO, + "- max CPUs used: %d", n + ); + + msg_printf(NULL, MSG_INFO, + "- Use at most %.0f%% of the CPU time", + global_prefs.niu_cpu_usage_limit + ); + if (global_prefs.niu_suspend_cpu_usage > 0) { msg_printf(NULL, MSG_INFO, "- suspend if non-BOINC CPU load exceeds %.0f%%", diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index b5c4938eaf..8e03f9252d 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -327,12 +327,14 @@ void CDlgAdvPreferences::ReadPreferenceSettings() { // 0 means "no restriction" but we don't use a checkbox here if (prefs.max_ncpus_pct == 0.0) prefs.max_ncpus_pct = 100.0; DisplayValue(prefs.max_ncpus_pct, m_txtProcUseProcessors); + if (prefs.niu_max_ncpus_pct == 0.0) prefs.niu_max_ncpus_pct = 100.0; DisplayValue(prefs.niu_max_ncpus_pct, m_txtProcUseProcessorsNotInUse); // cpu limit // 0 means "no restriction" but we don't use a checkbox here if (prefs.cpu_usage_limit == 0.0) prefs.cpu_usage_limit = 100.0; DisplayValue(prefs.cpu_usage_limit, m_txtProcUseCPUTime); + if (prefs.niu_cpu_usage_limit == 0.0) prefs.niu_cpu_usage_limit = 100.0; DisplayValue(prefs.niu_cpu_usage_limit, m_txtProcUseCPUTimeNotInUse); // on batteries diff --git a/lib/prefs.cpp b/lib/prefs.cpp index ab060cea4a..6a781e18e1 100644 --- a/lib/prefs.cpp +++ b/lib/prefs.cpp @@ -537,7 +537,7 @@ int GLOBAL_PREFS::parse_override( continue; } if (xp.parse_double("niu_max_ncpus_pct", niu_max_ncpus_pct)) { - if (niu_max_ncpus_pct < 0) niu_max_ncpus_pct = 0; + if (niu_max_ncpus_pct <= 0) niu_max_ncpus_pct = 100; if (niu_max_ncpus_pct > 100) niu_max_ncpus_pct = 100; mask.niu_max_ncpus_pct = true; continue; @@ -604,10 +604,10 @@ int GLOBAL_PREFS::parse_override( continue; } if (xp.parse_double("niu_cpu_usage_limit", dtemp)) { - if (dtemp > 0 && dtemp <= 100) { - niu_cpu_usage_limit = dtemp; - mask.niu_cpu_usage_limit = true; - } + if (dtemp <= 0) dtemp = 100; + if (dtemp > 100) dtemp = 100; + niu_cpu_usage_limit = dtemp; + mask.niu_cpu_usage_limit = true; continue; } if (xp.parse_double("daily_xfer_limit_mb", dtemp)) {