| 27 | | An app_version record (in the server DB) has a character string field '''class'''. |
| 28 | | |
| 29 | | The scheduler is linked with a project-supplied function |
| 30 | | {{{ |
| 31 | | bool analyze_app(HOST&, char* class, HOST_USAGE&); |
| 32 | | |
| 33 | | struct HOST_USAGE { |
| 34 | | COPROCS coprocs; // coprocessors used by the app (name and count) |
| 35 | | double ncpus; // #CPUs used by app (may be fractional) |
| 36 | | double flops; // estimated FLOPS |
| 37 | | char opaque[256]; // passed to the app in init_data.xml |
| 38 | | }; |
| 39 | | }}} |
| 40 | | The HOST argument describes the host's CPU(s), |
| 41 | | and includes a field 'coprocs' listing its coprocessors. |
| 42 | | |
| 43 | | The function returns true if the host's resources are sufficient for the app version. |
| 44 | | If true, it populates the HOST_USAGE structure. |
| 45 | | |
| 46 | | When deciding whether to send a job to a host, |
| 47 | | the scheduler examines all latest-version app_versions for the platform, |
| 48 | | and selects the one for which flops is greatest. |
| 49 | | |
| 50 | | The scheduler reply includes, for each app version, an XML encoding of HOST_USAGE. |
| 51 | | |
| 52 | | The client keeps track of coprocessor allocation, i.e. how many instances of each are free. |
| 53 | | It only runs an app if enough instances are available. |
| 54 | | |
| 55 | | The client uses app_version.usage.flops to estimate job completion times. |