| 1 | [[PageOutline]] |
| 2 | = Alternative mechanisms for granting credit = |
| 3 | |
| 4 | By default, BOINC automatically grants credit for valid jobs. |
| 5 | It does this in a way that is |
| 6 | * Device-neutral: a given job gets the same credit no matter |
| 7 | which host or device (CPU/GPU) it runs on. |
| 8 | * Project-neutral: a given host gets roughly the same credit per day |
| 9 | no matter what project it's attached to. |
| 10 | |
| 11 | Projects should use the default credit system |
| 12 | unless there is a clear reason not to. |
| 13 | To handle such cases, BOINC provides the following alternative mechanisms: |
| 14 | |
| 15 | == Credit via trickle messages == |
| 16 | |
| 17 | If you have very long-running jobs (a week or more) you may want to |
| 18 | grant credit incrementally. |
| 19 | To do so: |
| 20 | |
| 21 | * Have your application periodically send [TrickleApi trickle-up messages] |
| 22 | with variety '''runtime''' and content |
| 23 | {{{ |
| 24 | <runtime>X</runtime> |
| 25 | }}} |
| 26 | where X is the runtime since the last trickle message. |
| 27 | |
| 28 | * Run the '''trickle_credit''' daemon as follows: |
| 29 | {{{ |
| 30 | trickle_credit --variety runtime --max_runtime Y |
| 31 | }}} |
| 32 | where Y is the limit on runtime |
| 33 | (typically the period of the trickle messages). |
| 34 | |
| 35 | * Run your validator for the app with the '''--no_credit''' option |
| 36 | |
| 37 | The '''trickle_credit''' daemon grants credit in proportion to (runtime * CPU FLOPS), |
| 38 | hence this approach should be used only for applications with only single-CPU versions. |
| 39 | |
| 40 | This approach is not device-neutral because hosts with the same peak FLOPS |
| 41 | may have different actual FLOPS for the app version. |
| 42 | |
| 43 | == Credit for nonuniform jobs == |
| 44 | |
| 45 | The default credit system assumes that a given job always does |
| 46 | roughly the same amount of computation, no matter what host it runs on. |
| 47 | This is not the case, for example, |
| 48 | if your application is designed to run for a certain amount of time and then exit. |
| 49 | |
| 50 | For such applications, run your validator with the |
| 51 | {{{ |
| 52 | --credit_from_runtime X |
| 53 | }}} |
| 54 | option. |
| 55 | This grants credit in proportion to (runtime * CPU FLOPS), |
| 56 | hence this approach should be used only for applications with only single-CPU versions. |
| 57 | |
| 58 | X is the maximum runtime for which credit will be granted. |
| 59 | This provides a measure of cheat-proofing. |
| 60 | |
| 61 | == Explicit credit == |
| 62 | |
| 63 | You can assign credit to WUs when they are created. |
| 64 | If X is the number of FLOPs that the WU is expected to use, |
| 65 | the credit should be X*200/(86400*1e9). |
| 66 | Then run your validator with the |
| 67 | {{{ |
| 68 | --credit_from_wu |
| 69 | }}} |
| 70 | option. |