|   | 144 |  | 
                  
                          |   | 145 | == Combining multiple scheduling types == | 
                  
                          |   | 146 |  | 
                  
                          |   | 147 | BOINC potentially supports the following types of work, | 
                  
                          |   | 148 | each with its own scheduling mechanism: | 
                  
                          |   | 149 |  | 
                  
                          |   | 150 |  * Job-stream: the input is a stream of jobs; | 
                  
                          |   | 151 |    the goal is to maximize throughput and eventually finish all jobs. | 
                  
                          |   | 152 |  * Batch: described above. | 
                  
                          |   | 153 |  * Locality: a variant of job-stream in which | 
                  
                          |   | 154 |    jobs are assigned according to the files resident on the client. | 
                  
                          |   | 155 |  * Co-scheduling: like batch, except all jobs in each batch | 
                  
                          |   | 156 |    must run simultaneously (e.g., MPI applications). | 
                  
                          |   | 157 |  | 
                  
                          |   | 158 | A single project (such as a portal) may have work of some or all types. | 
                  
                          |   | 159 |  | 
                  
                          |   | 160 | How should we handle multiple scheduling types - | 
                  
                          |   | 161 | in particular, how can we maintain resource shares in their presence? | 
                  
                          |   | 162 |  | 
                  
                          |   | 163 | One simple approach is to maintain, for each scheduling type T, | 
                  
                          |   | 164 | the maximum debt D(T) of any user with an unsent job of type T. | 
                  
                          |   | 165 | Then use this top-level policy: | 
                  
                          |   | 166 | {{{ | 
                  
                          |   | 167 | for each scheduling type T in order of descending D(T) | 
                  
                          |   | 168 |         send jobs of type T | 
                  
                          |   | 169 | }}} | 
                  
                          |   | 170 | How to maintain D(T): | 
                  
                          |   | 171 |  | 
                  
                          |   | 172 |  * Job-stream: maintain in the feeder (consider only jobs in the cache) | 
                  
                          |   | 173 |  * Locality: constraint: only 1 user can use locality scheduling | 
                  
                          |   | 174 |  * Batch: maintain in batch module | 
                  
                          |   | 175 |  * Co-scheduling: maintain in co-scheduling module | 
                  
                          |   | 176 |  | 
                  
                          |   | 177 | == Maintaining debts == | 
                  
                          |   | 178 |  | 
                  
                          |   | 179 | A user's debt is adjusted each time a job is dispatched, | 
                  
                          |   | 180 | based on the estimated FLOPS of the job. | 
                  
                          |   | 181 | This quantity is recorded in the job record. | 
                  
                          |   | 182 |  | 
                  
                          |   | 183 | When a job finishes or times out | 
                  
                          |   | 184 | (at which point the actual computing done is known) | 
                  
                          |   | 185 | the user debt is adjusted accordingly. |