| 13 | | The XML looks like: |
| | 13 | |
| | 14 | == Deploying a coprocessor app == |
| | 15 | |
| | 16 | BOINC uses the [AppPlan application planning] mechanism to |
| | 17 | coordinate the scheduling of multi-threaded applications. |
| | 18 | |
| | 19 | Suppose you've developed a coprocessor program, |
| | 20 | that it uses a CUDA GPU and 1 GFLOPS of the CPU. |
| | 21 | To deploy it: |
| | 22 | |
| | 23 | * Choose a "planning class" name for the program, say "cuda_1.1" (see below). |
| | 24 | * Create an [UpdateVersions app version]. Include a file '''app_plan''' containing "cuda_1.1". |
| | 25 | * Link the following function into your scheduler: |
| 15 | | <coprocs> |
| 16 | | <coproc_cuda> |
| 17 | | <count>1</count> |
| 18 | | <name>GeForce 8800 GT (1)</name> |
| 19 | | <totalGlobalMem>...</totalGlobalMem> |
| 20 | | ... |
| 21 | | </coproc_cuda> |
| 22 | | </coprocs> |
| | 27 | bool app_plan(HOST& host, char* plan_class, HOST_USAGE& hu) { |
| | 28 | if (!strcmp(plan_class, "cuda_1.1")) { |
| | 29 | for (i=0; i<host.coprocs.size(); i++) { |
| | 30 | COPROC cp = host.coprocs[i]; |
| | 31 | if (cp.type == COPROC_CUDA) { |
| | 32 | COPROC_USAGE cu; |
| | 33 | strcpy(cu.name, cp.name); |
| | 34 | cu.count = 1; |
| | 35 | hu.coprocs.push_back(cu); |
| | 36 | double x = 1e9/host.p_fpops; |
| | 37 | if (x > 1) x = 1; |
| | 38 | hu.ncpus = x; |
| | 39 | hu.fpops = 5e11; |
| | 40 | return true; |
| | 41 | } |
| | 42 | } |
| | 43 | } |
| | 44 | return false; |
| | 45 | } |