|
11 | 11 | import pytz
|
12 | 12 | import Jedule.schedule_common as sc
|
13 | 13 | from ffd import ffEachBestMetricFirst, getPossibleSizes
|
14 |
| -from shapes import char_range, shape_candidates |
| 14 | +from shapes import char_range, shape_candidates, metric_ad, opt_ad |
15 | 15 | from packingbin import Bin
|
16 | 16 | from packingspace import ConvexSpace
|
17 | 17 | import plot_cuboids
|
@@ -104,7 +104,7 @@ def schedule_strict(dimensions, candidates, alpha, jobs, time_series_generator):
|
104 | 104 | bins = pack(jobs, requestSizes, [], dimensions, candidates, alpha)
|
105 | 105 | print('#bins: ' + str(len(bins)) + ', slice: ' + str(lastTimeSlice))
|
106 | 106 | for b in sorted(bins, key=lambda b: max_bin_time(b, jobs)):
|
107 |
| - plot_cuboids.plot_bin(b) |
| 107 | + # plot_cuboids.plot_bin(b) |
108 | 108 | schedule.extend((b.spaceIDs[s], currentTime, s) for s in b.spaces)
|
109 | 109 | currentTime = currentTime + max_bin_time(b, jobs)
|
110 | 110 |
|
@@ -191,13 +191,25 @@ def printStats(schedule, jobs, actual_sched, boundaries, possibleSizes):
|
191 | 191 | cmax_lb_non_convex = max(max_job_time, jobs_work / reduce(operator.mul, boundaries, 1))
|
192 | 192 | jobs_convex_work = sum(min(possibleSizes[j[0]]) * j[1] for j in jobs)
|
193 | 193 | cmax_lb_convex = max(max_job_time, jobs_convex_work / reduce(operator.mul, boundaries, 1))
|
| 194 | + |
| 195 | + max_overalloc = max((reduce(operator.mul, s.boundaries, 1) - jobs[i][0]) * 100 / jobs[i][0] |
| 196 | + for i, t, s in schedule) |
| 197 | + avg_overalloc = sum((reduce(operator.mul, s.boundaries, 1) - jobs[i][0]) * 100 / jobs[i][0] |
| 198 | + for i, t, s in schedule) / len(jobs) |
| 199 | + |
| 200 | + dimensions = {c: boundaries[i] for i, c in enumerate(char_range('x', len(boundaries)))} |
| 201 | + avg_metric = sum(metric_ad(s.boundaries, False, dimensions) for i, t, s in schedule) / len(jobs) |
| 202 | + avg_opt_metric = sum(opt_ad(j[0], False, dimensions) for j in jobs) / len(jobs) |
| 203 | + |
194 | 204 | print('Cmax lower bound (non-convex): ' + str(cmax_lb_non_convex) +
|
195 | 205 | ', Cmax lower bound (convex): ' + str(cmax_lb_convex) +
|
196 | 206 | ', Cmax of schedule: ' + str(cmax) +
|
197 | 207 | ' (loss of ' + str((cmax - cmax_lb_non_convex) * 100 / cmax_lb_non_convex) +
|
198 | 208 | '% compared to non-convex lower bound, ' +
|
199 | 209 | str((cmax - cmax_lb_convex) * 100 / cmax_lb_convex) +
|
200 |
| - '% compared to convex lower bound), actual Cmax: ' + str(actual_cmax)) |
| 210 | + '% compared to convex lower bound), actual Cmax: ' + str(actual_cmax) + |
| 211 | + ', max overalloc: ' + str(max_overalloc) + '% / average overalloc: ' + str(avg_overalloc) + |
| 212 | + ', average metric: ' + str(avg_metric) + ', average optimal metric: ' + str(avg_opt_metric)) |
201 | 213 |
|
202 | 214 | def get_resource_ids(space, boundaries):
|
203 | 215 | # coordinates here can go outside of boundaries of the torus. only when the ID is computed,
|
@@ -306,17 +318,23 @@ def perform_schedule(filename, boundaries, time_series_generator, alpha):
|
306 | 318 | # RESULTS using processing times (wall-time = run-time) with inversed powers of 2
|
307 | 319 | # bw_request_sizes_20160405_5000.txt
|
308 | 320 | # Cmax lower bound non-convex: 103557, convex: 103557, actual Cmax: 130284
|
309 |
| -# strategy strict: Cmax of schedule: 207036 (loss of ~100% compared to lower bound) |
| 321 | +# strategy strict: Cmax of schedule: 207036 (loss of ~100% compared to lower bound), |
| 322 | +# max overalloc: 14.3% / avg overalloc: 0.77%, avg metric: 0.79, avg opt metric: 0.74, |
| 323 | +# avg job size: 14.88, median job size: 1 |
310 | 324 | # strategy last_bin: Cmax of schedule: 127547 (loss of ~23.2% compared to lower bounds)
|
311 | 325 |
|
312 | 326 | # bw_request_sizes_20160406_5000.txt
|
313 | 327 | # Cmax lower bound non-convex: 72011, convex: 72011, actual Cmax: 161359
|
314 |
| -# strategy strict: Cmax of schedule: 157863 (loss of ~119% compared to lower bounds) |
| 328 | +# strategy strict: Cmax of schedule: 157863 (loss of ~119% compared to lower bounds), |
| 329 | +# max overalloc: 67.6% / avg overalloc: 1.39%, avg metric: 1.26, avg opt metric: 1.19, |
| 330 | +# avg job size: 58.96, median job size: 1 |
315 | 331 | # strategy last_bin: Cmax of schedule: 134803 (loss of ~87.2% compared to lower bounds)
|
316 | 332 |
|
317 | 333 | # bw_request_sizes_20160406_20000.txt
|
318 | 334 | # Cmax lower bound non-convex: 173696, convex: 173696, actual Cmax: 335835
|
319 |
| -# strategy strict: Cmax of schedule: 460801 (loss of ~165% compared to lower bounds) |
| 335 | +# strategy strict: Cmax of schedule: 460801 (loss of ~165% compared to lower bounds), |
| 336 | +# max overalloc: 14.3% / avg overalloc: 0.77%, avg metric: 0.79, avg opt metric: 0.74, |
| 337 | +# avg job size: 19.25, median job size: 1 |
320 | 338 | # strategy last_bin: Cmax of schedule: 415969 (loss of ~139% compared to lower bounds)
|
321 | 339 |
|
322 | 340 | # this strategy is not used as it does not make a lot of sense (cutOff is arbitrary etc)
|
|
0 commit comments