Changes between Version 1 and Version 2 of LocalityNew
- Timestamp:
- Aug 14, 2012, 2:06:53 PM (12 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
LocalityNew
v1 v2 1 [[PageOutline]] 1 2 = Locality scheduling redesign = 2 3 … … 4 5 5 6 * A '''batch''' consists of a sequence of files F1 ... Fn 6 7 and a set of jobs J1 ... Jm operating on these files. 7 8 * Each job uses a contiguous set of files. 8 9 * A given file may be used by many jobs. … … 74 75 workunit (new fields) 75 76 cursor_id integer 77 job_num integer 76 78 77 79 result (new fields) … … 86 88 * create batch record 87 89 * based on # of hosts, # of jobs, and job density, 88 create locality_ job_range and locality_cursor records90 create locality_cursor records 89 91 90 92 === Feeder/scheduler === … … 107 109 ==== Assigning jobs ==== 108 110 111 For each batch: 112 113 Enumerate unsent results for this host's cursor 114 in order of increasing job num 115 (i.e. finish old jobs before starting new ones). 116 Send as many as the host can handle. 117 118 Some type of synchronization is needed; maybe 119 120 * use a DB transaction (how much would this lock?) 121 * explicitly lock the locality_cursor record (is this possible?) 122 * use a semaphore per cursor 123 109 124 ==== Deleting files ==== 125 126 If the host has a file that's used only by finished jobs, 127 tell client to delete it. 110 128 111 129 === Work generator === 112 130 113 === Validator === 131 Try to maintain a cushion of N unsent jobs per cursor. 132 Start generating jobs at cursor.first_ungenerated_job_num. 114 133 115 134 === Transitioner === 116 135 136 When a workunit is completed (successfully or not): 137 138 {{{ 139 if workunit.job_num == cursor.first_unfinished_job_num 140 cursor.first_unfinished_job_num++ 141 }}} 142 117 143 === locality_daemon === 144 145 This runs periodically (every hour or day) and recomputes 146 locality_cursor.expavg_credit. 147 It doesn't have to be a separate program; 148 it could be added to an existing daemon, like the feeder