Computation of Credit

From Unofficial BOINC Wiki

Jump to: navigation, search

Contents

[edit] General

A BOINC Powered Project gives you Credit for the computations your computers perform for it. BOINC's unit of Credit, the Cobblestone1, is 1/100 day of CPU time on a reference computer that does

These benchmarks are imperfect predictors of application performance, but they're good enough.

Eventually, Credit may reflect network transfer and disk storage as well as computation.

[edit] How Credit Is Determined

When your computer completes a result, the BOINC Client Software determines an amount of Claimed Credit in one of two ways:

  • Some applications determine Claimed Credit themselves, and report it to the BOINC Client Software. This would be the case, for example, with applications that use graphics co-processors or other non-CPU hardware.

Claimed Credit is reported to a Project when your computer communicates with its server. The Granted Credit 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 Powered Projects grant credit only after the Results have been Validated.

[edit] Implementation of the Recent Average Credit Algorithm

BOINC Powered Projects maintain two counts of Granted Credit:

Both quantities (Total Credit and Recent Average Credit) are maintained for each Participant, Host, and Team.

Each time new Credit is granted, the following function is used to update the recent average credit of the Participant, Host, and Team:

void update_average(
    double work_start_time,         // when new work was started
                                    // (or zero if no new work)
    double work,                    // amount of new work
    double half_life,
    double& avg,                    // average work per day (in and out)
    double& avg_time                // when average was last computed
) {
    double now = dtime();

    if (avg_time) {
        // If an average R already exists, imagine that the new work was done
        // entirely between avg_time and now.
        // That gives a rate R'.
        // Replace R with a weighted average of R and R',
        // weighted so that we get the right half-life if R' == 0.
        //
        // But this blows up if avg_time == now; you get 0*(1/0)
        // So consider the limit as diff->0,
        // using the first-order Taylor expansion of
        // exp(x)=1+x+O(x^2).
        // So to the lowest order in diff:
        // weight = 1 - diff ln(2) / half_life
        // so one has
        // avg += (1-weight)*(work/diff_days)
        // avg += [diff*ln(2)/half_life] * (work*SECONDS_PER_DAY/diff)
        // notice that diff cancels out, leaving
        // avg += [ln(2)/half_life] * work*SECONDS_PER_DAY

        double diff, diff_days, weight;

        diff = now - avg_time;
        if (diff<0) diff=0;

        diff_days = diff/SECONDS_PER_DAY;
        weight = exp(-diff*M_LN2/half_life);

        avg *= weight;

        if ((1.0-weight) > 1.e-6) {
            avg += (1-weight)*(work/diff_days);
        } else {
            avg += M_LN2*work*SECONDS_PER_DAY/half_life;
        }
    } else if (work) {
        // If first time, average is just work/duration
        //
        double dd = (now - work_start_time)/SECONDS_PER_DAY;
        avg = work/dd;
    }
    avg_time = now;
}

[edit] Computing the Current Value of Recent Average Credit

The BOINC Server Software 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:

   $M_LN2 = 0.693147180559945309417;
   $credit_half_life = 86400 * 7;
   if ($now == 0) {
       $now = time();
   }
   $diff = $now - $avg_time;
   $weight = exp(-$diff * $M_LN2/$credit_half_life);
   $avg *= $weight;
   return $avg;
}

If you don't apply this decay, inactive entities will have incorrectly high RAC.

Note:
PHP code for the decay function can be found in html/inc/credit.inc and html/inc/host.inc.


[edit] Also See


1 Named after Jeff Cobb of SETI@Home


[edit] UCB Source

[edit] Copyright ©

  • 2005 University of California
  • 2005 Paul D. Buck

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.

Personal tools