2
require_once("docutil.php");
3
page_head("Computation credit");
7
A BOINC project gives you <b>credit</b> for the computations your
8
computers perform for it.
9
BOINC's unit of credit, the <b>Cobblestone</b> <sup>1</sup>,
10
is 1/100 day of CPU time on a reference computer that does both
12
<li> 1,000 double-precision MIPS based on the Whetstone benchmark, and
13
<li> 1,000 VAX MIPS based on the Dhrystone benchmark.
15
These benchmarks are <a href=benchmark.php>imperfect predictors</a>
16
of application performance, but they're good enough.
18
Eventually, credit may reflect network transfer and disk storage as well
21
<h2>How credit is determined</h2>
23
When your computer completes a result,
24
BOINC determines an amount of <b>claimed credit</b>
28
In general, the claimed credit is the result's CPU time multiplied
29
by the CPU benchmarks as measured by the BOINC software.
30
<b>NOTE:</b> the BOINC software is not optimized for specific processors.
31
Its benchmark numbers may be lower than
32
those produced by other programs.
34
Some applications determine claimed credit themselves,
35
and report it to BOINC.
36
This would be the case, for example, with
37
applications that use graphics coprocessors or other non-CPU hardware.
41
Claimed credit is reported to a project
42
when your computer communicates with its server.
43
The <b>granted credit</b> that you receive may
44
be different from the claimed credit,
45
and there may be a delay of a few hours or days
47
This is because some BOINC projects grant credit only after
48
results have been <a href=intro_user.php#credit>validated</a>.
52
<h2>Recent Average Credit</h2>
54
Projects maintain two counts of granted credit:
56
<li> <b>Total credit</b>:
57
The total number of Cobblestones performed and granted.
58
<li> <b>Recent average credit</b>:
59
The average number of Cobblestones per day granted recently.
60
This average decreases by a factor of two every week,
61
according to the algorithm given below.
65
Both quantities (total and recent average)
66
are maintained for each user, host and team.
69
Each time new credit is granted,
70
the following function is used to update the
71
recent average credit of the host, user and team:
72
<pre>",htmlspecialchars("
76
double work_start_time, // when new work was started
77
// (or zero if no new work)
78
double work, // amount of new work
80
double& avg, // average work per day (in and out)
81
double& avg_time // when average was last computed
86
// If an average R already exists, imagine that the new work was done
87
// entirely between avg_time and now.
88
// That gives a rate R'.
89
// Replace R with a weighted average of R and R',
90
// weighted so that we get the right half-life if R' == 0.
92
// But this blows up if avg_time == now; you get 0*(1/0)
93
// So consider the limit as diff->0,
94
// using the first-order Taylor expansion of
96
// So to the lowest order in diff:
97
// weight = 1 - diff ln(2) / half_life
99
// avg += (1-weight)*(work/diff_days)
100
// avg += [diff*ln(2)/half_life] * (work*SECONDS_PER_DAY/diff)
101
// notice that diff cancels out, leaving
102
// avg += [ln(2)/half_life] * work*SECONDS_PER_DAY
104
double diff, diff_days, weight;
106
diff = now - avg_time;
109
diff_days = diff/SECONDS_PER_DAY;
110
weight = exp(-diff*M_LN2/half_life);
114
if ((1.0-weight) > 1.e-6) {
115
avg += (1-weight)*(work/diff_days);
117
avg += M_LN2*work*SECONDS_PER_DAY/half_life;
120
// If first time, average is just work/duration
122
double dd = (now - work_start_time)/SECONDS_PER_DAY;
130
<h3>Computing the current value of Recent Average Credit</h3>
132
BOINC updates 'recent average credit' (RAC) only when new credit is granted.
133
Interfaces that export RAC also export that time at which it was last updated.
134
To obtain the current value of RAC,
135
you must 'decay' it based on the time that has elapsed
136
since it was updated: <pre>", htmlspecialchars('
137
function decay_average($avg, $avg_time, $now = 0) {
138
$M_LN2 = 0.693147180559945309417;
139
$credit_half_life = 86400 * 7;
143
$diff = $now - $avg_time;
144
$weight = exp(-$diff * $M_LN2/$credit_half_life);
150
If you don't apply this decay,
151
inactive entities will have incorrectly high RAC.
154
PHP code for the decay function can be found in
155
html/inc/credit.inc and html/inc/host.inc.
158
<sup>1</sup> Named after Jeff Cobb of SETI@home