From e99bb9deea7e573301d883e85dca0e768fc8d9e7 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Mon, 15 Nov 2004 23:46:50 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4569 --- checkin_notes | 10 ++++++++++ doc/credit.php | 17 ++++++++++++++--- doc/download.php | 4 ++-- sched/assimilator.C | 5 ++++- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index d4d4a7449f..eed3a30983 100755 --- a/checkin_notes +++ b/checkin_notes @@ -19507,3 +19507,13 @@ David 15 Nov 2004 client_types.C cs_data.C net_xfer.h + +David 15 Nov 2004 + - assimilator: after each enumeration of WUs, do a COMMIT. + This will hopefully fix a bug where a WU would appear + in an two enumerations in succession + (this happens when the enumerations are short, + i.e. when the assimilator is nearly caught up). + + sched/ + assimilator.C diff --git a/doc/credit.php b/doc/credit.php index 1f3e1bc12c..c27063cd7d 100644 --- a/doc/credit.php +++ b/doc/credit.php @@ -63,7 +63,7 @@ Both quantities (total and recent average) are maintained for each user, host and team.

-Each time new credit granted, +Each time new credit is granted, the following function is used to update the recent average credit of the host, user and team:

",htmlspecialchars("
@@ -106,11 +106,22 @@ Interfaces that export RAC also export that time at which it was last updated.
 To obtain the current value of RAC,
 you must 'decay' it based on the time that has elapsed
 since it was updated: 
", htmlspecialchars("
-    update_average(dtime(), 0, 0, expavg_credit, expavg_time);
+function decay_average(\$avg, \$avg_time, \$now = 0) {
+   \$M_LN2 = 0.693147180559945309417;
+   \$credit_half_life = 86400 * 7;
+   if (\$now == 0) {
+       \$now = time();
+   }
+   \$diff = \$now - \$avg_time;
+   \$diff_days = \$diff/86400;
+   \$weight = exp(-\$diff * \$M_LN2/\$credit_half_life);
+   \$avg *= \$weight;
+   return \$avg;
+}
 "), "

If you don't apply this decay, -then inactive entities may appear to have high RAC. +inactive entities will have incorrectly high RAC.

PHP code for the decay function can be found in diff --git a/doc/download.php b/doc/download.php index 4c57aed8be..a3f6dafd42 100755 --- a/doc/download.php +++ b/doc/download.php @@ -31,7 +31,7 @@ function show_413() { version_start("4.13", "13 Oct 2004"); version("Windows", "boinc_4.13_windows_intelx86.exe"); version("Linux/x86", "boinc_4.13_i686-pc-linux-gnu.gz"); - version("Mac OS/X", "boinc_4.13_powerpc-apple-darwin.gz"); + version("Mac OS X", "boinc_4.13_powerpc-apple-darwin.gz"); version("Solaris/SPARC", "boinc_4.13_sparc-sun-solaris2.7.gz"); version_end(); } @@ -46,7 +46,7 @@ Learn more about BOINC The BOINC core client is available for the following platforms:

diff --git a/sched/assimilator.C b/sched/assimilator.C index ca60fdff48..3838efcf8d 100644 --- a/sched/assimilator.C +++ b/sched/assimilator.C @@ -80,7 +80,7 @@ bool do_pass(APP& app) { assimilate_handler(wu, results, canonical_result); sprintf( - buf, "assimilate_state=%d, transition_time=%d", + buf, "assimilate_state=%d, transition_time=%d", ASSIMILATE_DONE, (int)time(0) ); retval = wu.update_field(buf); @@ -91,6 +91,9 @@ bool do_pass(APP& app) { exit(1); } } + if (did_something) { + boinc_db.commit_transaction(); + } return did_something; }