Changes between Version 7 and Version 8 of CreditNew

Show
Ignore:
Author:
davea (IP: 128.32.18.181)
Timestamp:
11/03/09 16:23:38 (3 weeks ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • CreditNew

    v7 v8  
    245245So for each quantity we maintain the following object: 
    246246{{{ 
    247 #define MIN_SAMPLES    20 
    248        // after this many samples, use exponentially averaged version 
    249 #define SAMPLE_WEIGHT  0.001 
    250        // new samples get this weight in exp avg 
    251 #define SAMPLE_LIMIT   10 
    252        // cap samples at recent_mean*10 
     247#define MIN_SAMPLES    20 
     248    // after this many samples, use exponentially averaged version 
     249#define SAMPLE_WEIGHT    0.001 
     250    // new samples get this weight in exp avg 
     251#define SAMPLE_LIMIT    10 
     252    // cap samples at recent_mean*10 
    253253 
    254254struct STATS { 
    255255    int nsamples; 
    256256    double mean; 
    257        double sum_var; 
     257    double sum_var; 
    258258    double recent_mean; 
    259        double recent_var; 
     259    double recent_var; 
    260260 
    261261    void update(double sample) { 
    262                if (sample < 0) return; 
    263                if (nsamples > MIN_SAMPLES) { 
    264                        if (sample > recent_mean*SAMPLE_LIMIT) { 
    265                                sample = recent_main*SAMPLE_LIMIT; 
    266                        
    267                
    268                // see http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance 
    269                nsamples++; 
    270                double delta = sample - mean; 
    271                mean += delta/nsamples; 
    272                sum_var += delta*(sample-mean); 
    273  
    274                if (nsamples < MIN_SAMPLES) { 
    275                        recent_mean = mean; 
    276                        recent_var = sum_var/nsamples; 
    277                } else { 
    278                        // update recent averages 
    279                        delta = sample - recent_mean; 
    280                        recent_mean += SAMPLE_WEIGHT*delta; 
    281                        double d2 = delta*delta - recent_var; 
    282                        recent_var += SAMPLE_WEIGHT*d2; 
    283                
     262        if (sample < 0) return; 
     263        if (nsamples > MIN_SAMPLES) { 
     264            if (sample > recent_mean*SAMPLE_LIMIT) { 
     265                sample = recent_main*SAMPLE_LIMIT; 
     266           
     267       
     268        // see http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance 
     269        nsamples++; 
     270        double delta = sample - mean; 
     271        mean += delta/nsamples; 
     272        sum_var += delta*(sample-mean); 
     273 
     274        if (nsamples < MIN_SAMPLES) { 
     275            recent_mean = mean; 
     276            recent_var = sum_var/nsamples; 
     277        } else { 
     278            // update recent averages 
     279            delta = sample - recent_mean; 
     280            recent_mean += SAMPLE_WEIGHT*delta; 
     281            double d2 = delta*delta - recent_var; 
     282            recent_var += SAMPLE_WEIGHT*d2; 
     283       
    284284    } 
    285285}; 
    287287 
    288288== Cross-project scaling factors == 
     289 
     290We'll have a script that publishes a project's 
     291accounting data (see Implementation). 
     292The BOINC web site will collect these from a few big projects 
     293and publish the averages. 
    289294 
    290295== Replication and cheating == 
    324329  subsequent jobs will be replicated. 
    325330 
     331== Trickle credit == 
     332 
     333 
    326334== Job runtime estimates == 
    327335 
    338346== Implementation == 
    339347 
    340 Database changes: 
    341  
    342 New table "host_app_version" 
    343 {{{ 
    344 int host_id; 
    345 int app_version_id; 
    346 double avg_vnpfc;       // recent average 
    347 int njobs; 
    348 double total_vnpfc; 
    349 }}} 
    350  
    351 New fields in "app_version": 
    352 {{{ 
    353 double avg_vnpfc; 
    354 int njobs; 
    355 double total_vnpfc; 
    356 }}} 
    357  
    358 New fields in "app": 
    359 {{{ 
    360 double min_avg_vnpfc;           // min value of app_version.avg_vnpfc 
    361 }}} 
    362  
     348=== Database changes === 
     349 
     350New table '''host_app''': 
     351{{{ 
     352int    host_id; 
     353int    app_id; 
     354int    vnpfc_n; 
     355double vnpfc_mean; 
     356double vnpfc_sum_var; 
     357double vnpfc_recent_mean; 
     358double vnpfc_recent_var; 
     359}}} 
     360 
     361New table '''host_app_version''': 
     362{{{ 
     363int    host_id; 
     364int    app_version_id; 
     365int    et_n; 
     366double et_mean; 
     367double et_sum_var; 
     368double et_recent_mean; 
     369double et_recent_var; 
     370}}} 
     371 
     372New fields in '''app_version''': 
     373{{{ 
     374int    pfc_n; 
     375double pfc_mean; 
     376double pfc_sum_var; 
     377double pfc_recent_mean; 
     378double pfc_recent_var; 
     379double pfc_scaling_factor; 
     380}}} 
     381 
     382New fields in '''app''': 
     383{{{ 
     384int    vnpfc_n; 
     385double vnpfc_mean; 
     386double vnpfc_sum_var; 
     387double vnpfc_recent_mean; 
     388double vnpfc_recent_var; 
     389}}} 
     390 
     391=== New request message fields === 
     392 
     393=== New reply message fields === 
     394 
     395=== Scheduler changes === 
     396 
     397=== Client changes === 
     398 
     399=== Validator changes === 
     400 
     401=== Server APIs for computing and granting credit === 
     402 
     403== Compatibility == 

If this page is incomplete or incorrect, please edit it or add it to the wiki to-do list. To do this, you must be logged in; click Login or Register above.