| 14 | BOINC offers several mechanisms for validating results and credit. |
| 15 | However, there is no "one size fits all" solution. |
| 16 | The choice depends on your requirements, |
| 17 | and on the nature of your applications |
| 18 | (you can use different mechanisms for different applications). |
| 19 | |
| 20 | For each of your applications, |
| 21 | you must supply two server-side programs: |
| 22 | * A "validator", which decides whether results are correct; |
| 23 | * An "assimilator", which handles validated results |
| 24 | |
| 25 | PICTURE: different validator/assim for different apps |
| 26 | |
| 27 | BOINC provides examples of each of these, |
| 28 | as well as a framework that makes it easy to develop your own. |
| 29 | |
| 30 | == No replication == |
| 31 | |
| 32 | The first option is to not use replication. |
| 33 | Each job gets done once. |
| 34 | The validator examines single results. |
| 35 | |
| 36 | This approach is useful if you have some way (application-specific) |
| 37 | of detecting wrong results with high probability. |
| 38 | |
| 39 | The credit question remains. |
| 40 | Some possibilities: |
| 41 | |
| 42 | * Grant fixed credit (feasible if your jobs are uniform). |
| 43 | * Put a cap on granted credit (this allows cheating). |
| 44 | * If claimed credit exceeds a threshold, replicate the job. |
| 45 | |
| 46 | == Replication == |
| 47 | |
| 48 | BOINC supports replication: |
| 49 | each job gets done on N different hosts, |
| 50 | and a result is considered valid if a strict majority of hosts return it. |
| 51 | |
| 52 | Replication also provides a good solution to credit cheating, even for non-uniform apps: |
| 53 | grant the average claimed credit, throwing out the low and high first |
| 54 | (if N=2, grant the minimum). |
| 55 | |
| 56 | One problem with replication is that there are discrepancies |
| 57 | in the way different computers do floating point math. |
| 58 | This makes it hard to determine when two results "agree"; |
| 59 | two different results may be equally correct. |
| 60 | |
| 61 | There are several different ways of dealing with this problem. |
| 62 | |
| 63 | === Eliminate discrepancies === |
| 64 | |
| 65 | By selecting the right compiler, compiler options, and math libraries, |
| 66 | it may be possible to eliminate numerical discrepancies. |
| 67 | This lets you do bitwise comparison of results. |
| 68 | However, it is difficult and generally reduces the performance of your application. |
| 69 | |
| 70 | === Fuzzy comparison === |
| 71 | |
| 72 | If your application is numerically stable |
| 73 | (i.e., small discrepancies lead to small differences in the result) |
| 74 | you can write a "fuzzy comparison function" for the validator that |
| 75 | considers two results as equivalent if they agree within some tolerance. |
| 76 | |
| 77 | === Homogeneous replication === |