diff --git a/checkin_notes b/checkin_notes
index 61e424dada..6da3fcd071 100644
--- a/checkin_notes
+++ b/checkin_notes
@@ -8563,3 +8563,18 @@ David 22 Oct 2008
html/inc/
uotd.inc
boinc_db.inc
+
+David 22 Oct 2008
+ - client: restore support for max_ncpus preference.
+ This and max_ncpus_pct can both be specified.
+ If both are specified, we take the min.
+
+ client/
+ cpu_sched.cpp
+ html/
+ ops/
+ index.php
+ project.sample/
+ project.inc
+ lib/
+ prefs.cpp,h
diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp
index d6938966b3..6ef1f69f62 100644
--- a/client/cpu_sched.cpp
+++ b/client/cpu_sched.cpp
@@ -1631,12 +1631,19 @@ void CLIENT_STATE::set_ncpus() {
if (config.ncpus>0) {
ncpus = config.ncpus;
} else if (host_info.p_ncpus>0) {
- ncpus = (int)((host_info.p_ncpus * global_prefs.max_ncpus_pct)/100);
- if (ncpus == 0) ncpus = 1;
+ ncpus = host_info.p_ncpus;
} else {
ncpus = 1;
}
+ if (global_prefs.max_ncpus_pct) {
+ ncpus = (int)((host_info.p_ncpus * global_prefs.max_ncpus_pct)/100);
+ }
+ if (ncpus == 0) ncpus = 1;
+ if (global_prefs.max_ncpus && global_prefs.max_ncpus < ncpus) {
+ ncpus = global_prefs.max_ncpus;
+ }
+
if (initialized && ncpus != ncpus_old) {
msg_printf(0, MSG_INFO,
"Number of usable CPUs has changed from %d to %d. Running benchmarks.",
diff --git a/html/ops/index.php b/html/ops/index.php
index 77e9fce2c0..7b300275ee 100644
--- a/html/ops/index.php
+++ b/html/ops/index.php
@@ -51,6 +51,7 @@ if (file_exists("../cache/remote.revision")
$context = stream_context_create(
array(
'http' => array(
+ 'request_fulluri' = true,
'proxy' => $project_http_proxy
)
)
diff --git a/html/project.sample/project.inc b/html/project.sample/project.inc
index 586a35be2b..3f7341702f 100644
--- a/html/project.sample/project.inc
+++ b/html/project.sample/project.inc
@@ -26,7 +26,7 @@ define("POST_REPORT_EMAILS", "moderator1@$master_url|moderator2@$master_url");
// set the following var if your project is behind a proxy.
// This is used on ops/index.php to get the current SVN rev from BOINC
-//$project_http_proxy = "http://host.domain:port"
+//$project_http_proxy = "tcp://proxyname:port"
function project_banner($title, $prefix) {
// Put your project title and logo here
diff --git a/lib/prefs.cpp b/lib/prefs.cpp
index 19a93911d5..5d788ff364 100644
--- a/lib/prefs.cpp
+++ b/lib/prefs.cpp
@@ -58,6 +58,7 @@ void GLOBAL_PREFS_MASK::set_all() {
work_buf_min_days = true;
work_buf_additional_days = true;
max_ncpus_pct = true;
+ max_ncpus= true;
cpu_scheduling_period_minutes = true;
disk_interval = true;
disk_max_used_gb = true;
@@ -88,6 +89,7 @@ bool GLOBAL_PREFS_MASK::are_prefs_set() {
if (work_buf_min_days) return true;
if (work_buf_additional_days) return true;
if (max_ncpus_pct) return true;
+ if (max_ncpus) return true;
if (cpu_scheduling_period_minutes) return true;
if (disk_interval) return true;
if (disk_max_used_gb) return true;
@@ -278,7 +280,8 @@ void GLOBAL_PREFS::defaults() {
dont_verify_images = false;
work_buf_min_days = 0.1;
work_buf_additional_days = 0.25;
- max_ncpus_pct = 100;
+ max_ncpus_pct = 0;
+ max_ncpus = 0;
cpu_scheduling_period_minutes = 60;
disk_interval = 60;
disk_max_used_gb = 10;
@@ -510,6 +513,10 @@ int GLOBAL_PREFS::parse_override(
mask.max_ncpus_pct = true;
continue;
}
+ if (xp.parse_int(tag, "max_ncpus", max_ncpus)) {
+ if (max_ncpus < 0) max_ncpus = 0;
+ mask.max_ncpus = true;
+ }
if (xp.parse_double(tag, "disk_interval", disk_interval)) {
if (disk_interval<0) disk_interval = 0;
mask.disk_interval = true;
@@ -658,6 +665,9 @@ int GLOBAL_PREFS::write(MIOFILE& f) {
max_bytes_sec_down,
cpu_usage_limit
);
+ if (max_ncpus) {
+ f.printf(" %d<\n", max_ncpus);
+ }
for (int i=0; i<7; i++) {
TIME_SPAN* cpu = cpu_times.week.get(i);
@@ -750,6 +760,9 @@ int GLOBAL_PREFS::write_subset(MIOFILE& f, GLOBAL_PREFS_MASK& mask) {
if (mask.max_ncpus_pct) {
f.printf(" %f\n", max_ncpus_pct);
}
+ if (mask.max_ncpus) {
+ f.printf(" %d\n", max_ncpus);
+ }
if (mask.cpu_scheduling_period_minutes) {
f.printf(" %f\n", cpu_scheduling_period_minutes);
}
diff --git a/lib/prefs.h b/lib/prefs.h
index d5241d59ad..3ff6b1280f 100644
--- a/lib/prefs.h
+++ b/lib/prefs.h
@@ -50,6 +50,7 @@ struct GLOBAL_PREFS_MASK {
bool work_buf_min_days;
bool work_buf_additional_days;
bool max_ncpus_pct;
+ bool max_ncpus;
bool cpu_scheduling_period_minutes;
bool disk_interval;
bool disk_max_used_gb;
@@ -144,6 +145,7 @@ struct GLOBAL_PREFS {
double work_buf_min_days;
double work_buf_additional_days;
double max_ncpus_pct;
+ int max_ncpus;
double cpu_scheduling_period_minutes;
double disk_interval;
double disk_max_used_gb;