Skip to content

Commit 061b278

Browse files
committed
added more stats and results for schedules
1 parent d310f27 commit 061b278

File tree

1 file changed

+24
-6
lines changed

1 file changed

+24
-6
lines changed

Diff for: sched.py

+24-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import pytz
1212
import Jedule.schedule_common as sc
1313
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
1515
from packingbin import Bin
1616
from packingspace import ConvexSpace
1717
import plot_cuboids
@@ -104,7 +104,7 @@ def schedule_strict(dimensions, candidates, alpha, jobs, time_series_generator):
104104
bins = pack(jobs, requestSizes, [], dimensions, candidates, alpha)
105105
print('#bins: ' + str(len(bins)) + ', slice: ' + str(lastTimeSlice))
106106
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)
108108
schedule.extend((b.spaceIDs[s], currentTime, s) for s in b.spaces)
109109
currentTime = currentTime + max_bin_time(b, jobs)
110110

@@ -191,13 +191,25 @@ def printStats(schedule, jobs, actual_sched, boundaries, possibleSizes):
191191
cmax_lb_non_convex = max(max_job_time, jobs_work / reduce(operator.mul, boundaries, 1))
192192
jobs_convex_work = sum(min(possibleSizes[j[0]]) * j[1] for j in jobs)
193193
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+
194204
print('Cmax lower bound (non-convex): ' + str(cmax_lb_non_convex) +
195205
', Cmax lower bound (convex): ' + str(cmax_lb_convex) +
196206
', Cmax of schedule: ' + str(cmax) +
197207
' (loss of ' + str((cmax - cmax_lb_non_convex) * 100 / cmax_lb_non_convex) +
198208
'% compared to non-convex lower bound, ' +
199209
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))
201213

202214
def get_resource_ids(space, boundaries):
203215
# 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):
306318
# RESULTS using processing times (wall-time = run-time) with inversed powers of 2
307319
# bw_request_sizes_20160405_5000.txt
308320
# 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
310324
# strategy last_bin: Cmax of schedule: 127547 (loss of ~23.2% compared to lower bounds)
311325

312326
# bw_request_sizes_20160406_5000.txt
313327
# 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
315331
# strategy last_bin: Cmax of schedule: 134803 (loss of ~87.2% compared to lower bounds)
316332

317333
# bw_request_sizes_20160406_20000.txt
318334
# 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
320338
# strategy last_bin: Cmax of schedule: 415969 (loss of ~139% compared to lower bounds)
321339

322340
# this strategy is not used as it does not make a lot of sense (cutOff is arbitrary etc)

0 commit comments

Comments
 (0)