From 15b58e582dcd1571b252c232e879bf5fd76c9853 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 1 Nov 2008 23:13:55 +0000 Subject: [PATCH] - client, scheduler: there were a few places where we had 1e9 instead of 1 gig (2^20) svn path=/trunk/boinc/; revision=16387 --- checkin_notes | 9 +++++++++ client/cs_prefs.cpp | 4 ++-- sched/sched_send.cpp | 8 ++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index f806aa8995..25ec4200dc 100644 --- a/checkin_notes +++ b/checkin_notes @@ -8979,3 +8979,12 @@ David 1 Nov 2008 client/ client_types.h rr_sim.cpp + +David 1 Nov 2008 + - client, scheduler: there were a few places where we had 1e9 + instead of 1 gig (2^20) + + client/ + cs_prefs.cpp + sched/ + sched_send.cpp diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index 1bb9044815..dcd7269e66 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -57,9 +57,9 @@ double CLIENT_STATE::allowed_disk_usage() { percent_space = host_info.d_total*global_prefs.disk_max_used_pct/100.0; - min_val = host_info.d_free - global_prefs.disk_min_free_gb*1e9; + min_val = host_info.d_free - global_prefs.disk_min_free_gb*GIGA; - double size = min(min(global_prefs.disk_max_used_gb*(1e9), percent_space), min_val); + double size = min(min(global_prefs.disk_max_used_gb*(GIGA), percent_space), min_val); if (size < 0) size = 0; return size; } diff --git a/sched/sched_send.cpp b/sched/sched_send.cpp index 152f0f3702..16789c9066 100644 --- a/sched/sched_send.cpp +++ b/sched/sched_send.cpp @@ -281,10 +281,10 @@ double max_allowable_disk(SCHEDULER_REQUEST& req, SCHEDULER_REPLY& reply) { // The post 4 oct 2005 case. // Compute the max allowable additional disk usage based on prefs // - x1 = prefs.disk_max_used_gb*1e9 - host.d_boinc_used_total; + x1 = prefs.disk_max_used_gb*GIGA - host.d_boinc_used_total; x2 = host.d_total*prefs.disk_max_used_pct/100. - host.d_boinc_used_total; - x3 = host.d_free - prefs.disk_min_free_gb*1e9; // may be negative + x3 = host.d_free - prefs.disk_min_free_gb*GIGA; // may be negative x = min(x1, min(x2, x3)); // see which bound is the most stringent @@ -303,7 +303,7 @@ double max_allowable_disk(SCHEDULER_REQUEST& req, SCHEDULER_REPLY& reply) { // We can't honor the max_used for max_used_pct preferences. // We can only honor the min_free pref. // - x = host.d_free - prefs.disk_min_free_gb*1e9; // may be negative + x = host.d_free - prefs.disk_min_free_gb*GIGA; // may be negative reply.disk_limits.min_free = x; x1 = x2 = x3 = 0; } @@ -1396,7 +1396,7 @@ void send_work(SCHEDULER_REQUEST& sreq, SCHEDULER_REPLY& reply) { ); log_messages.printf(MSG_DEBUG, "available disk %f GB, work_buf_min %d\n", - reply.wreq.disk_available/1e9, + reply.wreq.disk_available/GIGA, (int)sreq.global_prefs.work_buf_min() ); log_messages.printf(MSG_DEBUG,