From a726775e942007a608132446143ef260d3489202 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 25 Oct 2008 15:21:28 +0000 Subject: [PATCH] - client: ignore max_cpus if max_ncpus_pct is nonzero svn path=/trunk/boinc/; revision=16318 --- checkin_notes | 6 ++++++ client/cpu_sched.cpp | 7 ++----- html/user/bolt_sched.php | 17 ++++++----------- 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/checkin_notes b/checkin_notes index 1c5325e7b6..875eef2cfb 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8689,3 +8689,9 @@ Charlie 24 Oct 2008 BOINCListCtrl.cpp ViewProjects.cpp ViewTransfers.cpp + +David 25 Oct 2008 + - client: ignore max_cpus if max_ncpus_pct is nonzero + + client/ + cpu_sched.cpp diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index f4890d18d5..f0c8720938 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -1638,11 +1638,8 @@ void CLIENT_STATE::set_ncpus() { if (global_prefs.max_ncpus_pct) { ncpus = (int)((ncpus * global_prefs.max_ncpus_pct)/100); - } - - if (ncpus == 0) ncpus = 1; - - if (global_prefs.max_ncpus && global_prefs.max_ncpus < ncpus) { + if (ncpus == 0) ncpus = 1; + } else if (global_prefs.max_ncpus && global_prefs.max_ncpus < ncpus) { ncpus = global_prefs.max_ncpus; } diff --git a/html/user/bolt_sched.php b/html/user/bolt_sched.php index 95413b8e72..f5d8bf98cc 100644 --- a/html/user/bolt_sched.php +++ b/html/user/bolt_sched.php @@ -97,19 +97,14 @@ function create_view($iter, $mode, $prev_view_id) { return BoltView::insert("(user_id, course_id, item_name, start_time, mode, state, fraction_done, prev_view_id) values ($user->id, $course->id, '$item->name', $now, $mode, '$state', $iter->frac_done, $prev_view_id)"); } -function page_header($title=null) { +function page_header() { + global $course; echo " - "; - if ($title) { - echo " - $title - "; - } - echo " + $course->name "; - if (function_exists('bolt_header')) bolt_header($title); + if (function_exists('bolt_header')) bolt_header(); } function page_footer() { @@ -352,7 +347,7 @@ case 'start': } $e = BoltEnrollment::lookup($user->id, $course_id); if ($e) { - page_header("Confirm restart"); + page_header(); echo "You are already enrolled in $course->name.

Are you sure you want to start over from the beginning? @@ -647,7 +642,7 @@ case 'question': $now = time(); $question = BoltDb::escape_string(get_str('question')); BoltQuestion::insert("(create_time, user_id, course_id, name, question, state) values ($now, $user->id, $course->id, '$view->item_name', '$question', 0)"); - page_header("Question recorded"); + page_header(); echo " Thanks; we have recorded your question. Questions help us improve this course.