2004-06-09 19:09:16 +00:00
|
|
|
<?php
|
2003-08-26 18:33:21 +00:00
|
|
|
require_once("docutil.php");
|
|
|
|
page_head("Computation credit");
|
|
|
|
echo "
|
2002-10-20 22:12:53 +00:00
|
|
|
|
|
|
|
<p>
|
2005-01-24 18:24:26 +00:00
|
|
|
A BOINC project gives you <b>credit</b> for the computations your
|
2004-05-19 20:53:00 +00:00
|
|
|
computers perform for it.
|
|
|
|
BOINC's unit of credit, the <b>Cobblestone</b> <sup>1</sup>,
|
|
|
|
is 1/100 day of CPU time on a reference computer that does
|
|
|
|
<ul>
|
|
|
|
<li> 1,000 double-precision MIPS based on the Whetstone benchmark.
|
|
|
|
<li> 1,000 VAX MIPS based on the Dhrystone benchmark.
|
|
|
|
</ul>
|
2004-12-10 00:57:20 +00:00
|
|
|
These benchmarks are <a href=benchmark.php>imperfect predictors</a>
|
|
|
|
of application performance, but they're good enough.
|
2005-01-24 18:24:26 +00:00
|
|
|
<p>
|
2004-05-19 20:53:00 +00:00
|
|
|
Eventually, credit may reflect network transfer and disk storage as well
|
|
|
|
as computation.
|
2002-10-20 22:12:53 +00:00
|
|
|
|
2004-05-19 20:53:00 +00:00
|
|
|
<h2>How credit is determined</h2>
|
|
|
|
|
|
|
|
When your computer completes a result,
|
|
|
|
BOINC determines an amount of <b>claimed credit</b>
|
|
|
|
in one of two ways:
|
2002-10-20 22:12:53 +00:00
|
|
|
<ul>
|
2004-05-19 20:53:00 +00:00
|
|
|
<li>
|
|
|
|
In general, the claimed credit is the result's CPU time multiplied
|
|
|
|
by the CPU benchmarks as measured by the BOINC software.
|
|
|
|
<b>NOTE:</b> the BOINC software is not optimized for specific processors.
|
|
|
|
Its benchmark numbers may be lower than
|
|
|
|
those produced by other programs.
|
|
|
|
<li>
|
|
|
|
Some applications determine claimed credit themselves,
|
|
|
|
and report it to BOINC.
|
|
|
|
This would be the case, for example, with
|
|
|
|
applications that use graphics coprocessors or other non-CPU hardware.
|
2002-10-20 22:12:53 +00:00
|
|
|
</ul>
|
|
|
|
|
2004-03-23 01:44:47 +00:00
|
|
|
<p>
|
2004-05-19 20:53:00 +00:00
|
|
|
Claimed credit is reported to a project
|
|
|
|
when your computer communicates with its server.
|
|
|
|
The <b>granted credit</b> that you receive may
|
|
|
|
be different from the claimed credit,
|
|
|
|
and there may be a delay of a few hours or days
|
|
|
|
before it is granted.
|
|
|
|
This is because some BOINC projects grant credit only after
|
2004-03-23 01:44:47 +00:00
|
|
|
results have been <a href=intro_user.php#credit>validated</a>.
|
|
|
|
|
2004-05-19 20:53:00 +00:00
|
|
|
|
|
|
|
|
|
|
|
<h2>Recent Average Credit</h2>
|
2002-10-20 22:12:53 +00:00
|
|
|
<p>
|
2004-11-02 23:12:29 +00:00
|
|
|
Projects maintain two counts of granted credit:
|
2002-10-20 22:12:53 +00:00
|
|
|
<ul>
|
|
|
|
<li> <b>Total credit</b>:
|
2004-05-19 20:53:00 +00:00
|
|
|
The total number of Cobblestones performed and granted.
|
2002-10-20 22:12:53 +00:00
|
|
|
<li> <b>Recent average credit</b>:
|
2004-05-19 20:53:00 +00:00
|
|
|
The average number of Cobblestones per day granted recently.
|
2004-01-15 01:18:25 +00:00
|
|
|
This average decreases by a factor of two every week,
|
2004-05-19 20:53:00 +00:00
|
|
|
according to the algorithm given below.
|
2002-10-20 22:12:53 +00:00
|
|
|
</ul>
|
|
|
|
|
|
|
|
<p>
|
2004-05-19 20:53:00 +00:00
|
|
|
Both quantities (total and recent average)
|
|
|
|
are maintained for each user, host and team.
|
2003-01-02 23:12:05 +00:00
|
|
|
|
2004-05-19 20:53:00 +00:00
|
|
|
<p>
|
2004-11-15 23:46:50 +00:00
|
|
|
Each time new credit is granted,
|
2004-01-15 01:18:25 +00:00
|
|
|
the following function is used to update the
|
|
|
|
recent average credit of the host, user and team:
|
2004-04-13 21:31:55 +00:00
|
|
|
<pre>",htmlspecialchars("
|
2004-11-02 23:12:29 +00:00
|
|
|
#define CREDIT_HALF_LIFE (SECONDS_IN_DAY*7)
|
2004-01-15 01:18:25 +00:00
|
|
|
|
2004-04-13 21:31:55 +00:00
|
|
|
// Update an estimate of \"units per day\" of something (credit or CPU time).
|
|
|
|
// The estimate is exponentially averaged with a given half-life
|
|
|
|
// (i.e. if no new work is done, the average will decline by 50% in this time).
|
|
|
|
// This function can be called either with new work,
|
|
|
|
// or with zero work to decay an existing average.
|
2004-01-15 01:18:25 +00:00
|
|
|
//
|
|
|
|
void update_average(
|
2004-11-02 23:12:29 +00:00
|
|
|
double now, // current time
|
2004-04-13 21:31:55 +00:00
|
|
|
double work_start_time, // when new work was started
|
|
|
|
// (or zero if no new work)
|
|
|
|
double work, // amount of new work
|
|
|
|
double& avg, // average work per day (in and out)
|
|
|
|
double& avg_time // when average was last computed
|
2004-01-15 01:18:25 +00:00
|
|
|
) {
|
|
|
|
if (avg_time) {
|
|
|
|
double diff = now - avg_time;
|
2004-04-13 21:31:55 +00:00
|
|
|
double diff_days = diff/SECONDS_PER_DAY;
|
2004-11-02 23:12:29 +00:00
|
|
|
double weight = exp(-diff*M_LN2/CREDIT_HALF_LIFE);
|
2004-01-15 01:18:25 +00:00
|
|
|
avg *= weight;
|
2004-04-13 21:31:55 +00:00
|
|
|
avg += (1-weight)*(work/diff_days);
|
2004-01-15 01:18:25 +00:00
|
|
|
} else {
|
2004-04-13 21:31:55 +00:00
|
|
|
double dd = (now - work_start_time)/SECONDS_PER_DAY;
|
|
|
|
avg = work/dd;
|
2004-01-15 01:18:25 +00:00
|
|
|
}
|
|
|
|
avg_time = now;
|
|
|
|
}
|
2004-04-13 21:31:55 +00:00
|
|
|
|
|
|
|
"),"
|
2004-01-15 01:18:25 +00:00
|
|
|
</pre>
|
2004-11-02 23:12:29 +00:00
|
|
|
|
|
|
|
<h3>Computing the current value of Recent Average Credit</h3>
|
|
|
|
<p>
|
|
|
|
BOINC updates 'recent average credit' (RAC) only when new credit is granted.
|
|
|
|
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: <pre>", htmlspecialchars("
|
2004-11-15 23:46:50 +00:00
|
|
|
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;
|
|
|
|
}
|
2004-11-02 23:12:29 +00:00
|
|
|
"), "</pre>
|
|
|
|
<p>
|
|
|
|
If you don't apply this decay,
|
2004-11-15 23:46:50 +00:00
|
|
|
inactive entities will have incorrectly high RAC.
|
2004-11-02 23:12:29 +00:00
|
|
|
|
|
|
|
<p>
|
|
|
|
PHP code for the decay function can be found in
|
|
|
|
html/inc/credit.inc and html/inc/host.inc.
|
|
|
|
|
2003-09-11 22:26:42 +00:00
|
|
|
<hr noshade size=1>
|
|
|
|
<sup>1</sup> Named after Jeff Cobb of SETI@home
|
2003-08-26 18:33:21 +00:00
|
|
|
";
|
|
|
|
page_tail();
|
|
|
|
?>
|