-
Notifications
You must be signed in to change notification settings - Fork 0
/
BatchBasedSchedule.py
653 lines (508 loc) · 23 KB
/
BatchBasedSchedule.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
'''
Created on Apr 8, 2015
@author: hustnn
'''
import Configuration
from JobGenerator import JobGenerator
from Utility import Utility
import time
import itertools
from datetime import datetime
from random import randint
from Cluster import Cluster
from YARNScheduler import YARNScheduler
from WorkloadGenerator import WorkloadGenerator
from RMContainerInfo import RMContainerInfo
import copy
import multiprocessing
import time
import math
def startNodaUpdateService(scheduler, newLaunchQueue, newAppsQueue, completedQueue, e):
# start node update thread
while True and not e.is_set():
while(not completedQueue.empty()):
#print("completed container")
containerID = completedQueue.get()
container = scheduler._launchedContainerDict[containerID]
scheduler.completeContainer(container)
while(not newAppsQueue.empty()):
#print("new apps submitted")
newApps = newAppsQueue.get()
for k, v in newApps.items():
for job in v:
scheduler.addApplication(job, k)
scheduler.update()
for node in scheduler._cluster.getAllNodes():
scheduler.nodeUpdate(node)
for container in scheduler._newLaunchContainerList:
#print("launch container")
newLaunchQueue.put(container)
scheduler._newLaunchContainerList = []
def oldScheduling(clusterSize, queueName, jobList, tradeoff):
cluster = Cluster(clusterSize)
scheduler = YARNScheduler(cluster, True, tradeoff)
scheduler.createQueue("queue1", "MULTIFAIR", True, "root")
workloadGen = WorkloadGenerator(Configuration.SIMULATION_PATH, Configuration.WORKLOAD_PATH, {queueName: jobList}, cluster)
workloadGen.genWorkloadByList(queueName, copy.deepcopy(jobList))
simulationStepCount = 0
while True:
if workloadGen.allJobsSubmitted() and len(scheduler.getAllApplications()) == 0:
break
currentTime = simulationStepCount * Configuration.SIMULATION_STEP
workloadGen.submitJobs(currentTime, scheduler)
scheduler.activateWaitingJobs(currentTime)
scheduler.oldSimulate(Configuration.SIMULATION_STEP, currentTime)
simulationStepCount += 1
makespan = simulationStepCount * Configuration.SIMULATION_STEP
finishedApp = scheduler.getFinishedAppsInfo()
return makespan, finishedApp
def scheduling(clusterSize, queueName, jobList, tradeoff):
cluster = Cluster(clusterSize)
#queueWorkloads = {"queue1": workloadSet}
#print("fair")
scheduler = YARNScheduler(cluster, True, tradeoff)
scheduler.createQueue("queue1", "MULTIFAIR", True, "root")
workloadGen = WorkloadGenerator(Configuration.SIMULATION_PATH, Configuration.WORKLOAD_PATH, {queueName: jobList}, cluster)
workloadGen.genWorkloadByList(queueName, copy.deepcopy(jobList))
newLaunchQueue = multiprocessing.Queue()
newAppsQueue = multiprocessing.Queue()
completedQueue = multiprocessing.Queue()
e = multiprocessing.Event()
updateProcess = multiprocessing.Process(target = startNodaUpdateService, name = "updateProcess", args = (scheduler, newLaunchQueue, newAppsQueue, completedQueue, e))
updateProcess.start()
simulationStepCount = 0
while True:
if workloadGen.allJobsSubmitted() and len(scheduler.getAllApplications()) == 0:
#notify the node update process ending
e.set()
break
currentTime = simulationStepCount * Configuration.SIMULATION_STEP
workloadGen.submitJobs(currentTime, scheduler)
addedApps = scheduler.activateWaitingJobs(currentTime)
if len(addedApps) > 0:
#print("put new app")
newAppsQueue.put(addedApps)
while(not newLaunchQueue.empty()):
#print("new receive container")
newContainer = newLaunchQueue.get()
scheduler.launchAllocatedContainer(newContainer["containerID"], newContainer["node"], newContainer["task"], newContainer["appID"])
scheduler.simulate(Configuration.SIMULATION_STEP, currentTime)
for container in scheduler._completedContaienrList:
#print(container.getContainerID())
completedQueue.put(container.getContainerID())
scheduler._completedContaienrList = []
simulationStepCount += 1
# waiting for the end of node update process
updateProcess.join()
makespan = simulationStepCount * Configuration.SIMULATION_STEP
finishedApp = scheduler.getFinishedAppsInfo()
return makespan, finishedApp
def execSimulationWithSchedulingInfo(clusterSize, queueName, jobList):
fairMakespan, fairFinishedApp = oldScheduling(clusterSize, queueName, jobList, 1.0)
perfMakespan, perfFinishedApp = oldScheduling(clusterSize, queueName, jobList, 0.0)
return fairMakespan, fairFinishedApp, perfMakespan, perfFinishedApp
def execSimulation(clusterSize, queueName, jobList, mode):
if mode == "new":
fairMakespan, fairFinishedApp = scheduling(clusterSize, queueName, jobList, 1.0)
perfMakespan, perfFinishedApp = scheduling(clusterSize, queueName, jobList, 0.0)
else:
fairMakespan, fairFinishedApp = oldScheduling(clusterSize, queueName, jobList, 1.0)
perfMakespan, perfFinishedApp = oldScheduling(clusterSize, queueName, jobList, 0.0)
count = 0
reduction = 0.0
for k in perfFinishedApp.keys():
count += 1
tPerf = perfFinishedApp[k]
tFair = fairFinishedApp[k]
if tPerf > tFair:
red = float(tPerf - tFair) / tFair
reduction += red
return {"fairness": float(reduction) / count, "perf": 1 - min(float(perfMakespan) / fairMakespan, 1)}
def genJob(num):
fileName = Configuration.WORKLOAD_PATH + "workloadSet"
f = open(fileName, "r")
lines = f.readlines()
f.close()
jobCount = 1
jobList = []
for l in lines:
for i in range(num):
items = l.split(",")
#numOfTask = int(items[0])
#taskExecTime = int(items[1])
#submissionTime = int(items[2])
memory = int(items[3])
cpu = int(items[4])
disk = int(items[5])
network = int(items[6])
#job = JobGenerator.genComputeIntensitveJob(str(jobCount), numOfTask, memory, cpu, disk, network, taskExecTime, submissionTime)
jobList.append((memory, cpu, disk, network))
return jobList
def genJobCateList(jobCate, num):
l = []
for i in range(len(jobCate)):
for j in range(num):
l.append(jobCate[i])
return l
def swap(l, i, j):
tmp = l[i]
l[i] = l[j]
l[j] = tmp
RES = [0]
def checkSwapValid(jobList, i, j):
for k in range(i, j):
if jobList[k] == jobList[j]:
return False
return True
def genCombination(jobList, i, n):
if (i == n - 1):
#print(jobList)
RES[0] = RES[0] + 1
#RES.append(list(jobList))
#RES.append(genAverageEntropy(jobList, 4))
return
else:
for k in range(i, n):
if checkSwapValid(jobList, i, k):
swap(jobList, k, i)
genCombination(jobList, i + 1, n)
swap(jobList, k, i)
def genAverageEntropy(l, batchSize):
totalEntropy = 0
c = len(l) / batchSize
for i in range(c):
s = l[i * batchSize: (i + 1) * batchSize]
entropy = Utility.calEntropyOfVectorList(s, 4)
totalEntropy += entropy
aveEn = float(totalEntropy) / c
return aveEn
#print(aveEn)
def getNextPermu(A , n):
j = n - 2
while(A[j] >= A[j + 1] and j >= 0):
j -= 1
if (j < 0):
return False
i = n - 1
while(A[j] >= A[i]):
i -= 1
swap(A, j, i)
l = j + 1
r = n - 1
while(l < r):
swap(A, l, r)
l += 1
r -= 1
return True
def genLexiPermu(A, n):
num = 0
sorted(A)
while(True):
num += 1
print(A)
if not getNextPermu(A, n):
break
print(num)
def swapItemByWindow(A, swapNum, windowNum, windowSize):
if windowNum == 1:
return A
for i in range(swapNum):
r1 = randint(0, windowNum - 1)
r2 = r1
while (r2 == r1):
r2 = randint(0, windowNum - 1)
w1 = A[r1]
w2 = A[r2]
e1 = randint(0, len(w1) - 1)
e2 = randint(0, len(w2) - 1)
tmp = w1[e1]
w1[e1] = w2[e2]
w2[e2] = tmp
return A
def genWindowBasedList(A, windowSize, windowNum):
w = []
for i in range(windowNum):
begin = i * windowSize
end = min(begin + windowSize, len(A))
w.append(A[begin:end])
return w
def sortWindowBasedList(windowList):
for i in range(len(windowList)):
windowList[i] = sorted(windowList[i])
def genAverageEntropyByWindow(windowList):
totalEntropy = 0
maxEntropy = 0
window = windowList[0]
for w in windowList:
entropy = Utility.calEntropyOfVectorList(w, 4)
#print("entropy" + str(entropy))
totalEntropy += entropy
if entropy > maxEntropy:
maxEntropy = entropy
window = w
aveEn = float(totalEntropy) / len(windowList)
return maxEntropy, [window]
#return aveEn
def genJobsAccordingCategoryList(categoryList, workloadSet):
jobs = []
codes = []
fileName = Configuration.WORKLOAD_PATH + workloadSet
f = open(fileName, "r")
lines = f.readlines()
f.close()
jobCount = 0
for i in categoryList:
#print(categoryList)
jobCount += 1
line = lines[i - 1]
items = line.split(",")
numOfTask = int(items[0])
taskExecTime = int(items[1])
submissionTime = int(items[2])
memory = int(items[3])
cpu = int(items[4])
disk = int(items[5])
network = int(items[6])
code = int(items[7])
job = JobGenerator.genComputeIntensitveJob(str(jobCount), numOfTask, memory, cpu, disk, network, taskExecTime, submissionTime)
jobs.append(job)
codes.append(code)
return jobs, codes
def genJobsOfWindowList(windowList, workloadSet):
result = []
size = len(windowList[0])
for w in windowList:
if len(w) != size:
break
jobs, codes = genJobsAccordingCategoryList(w, workloadSet)
entropy = Utility.calEntropyOfVectorList(codes, 4)
result.append({"jobs": jobs, "entropy": entropy})
return result
def genAveragePerfFairForWindowList(windowList, clusterSize, mode):
#print(windowList)
avePerf = 0
aveFair = 0
count = 0
for w in windowList:
#print(w)
jobs = genJobsAccordingCategoryList(w)
#print("exec simu start")
res = execSimulation(clusterSize, "queue1", jobs, mode)
#print("exec simu end")
count += 1
avePerf += float(res["perf"])
aveFair += float(res["fairness"])
return avePerf / count, aveFair / count
def genAverageAfterScheduling(jobsWindow, clusterSize, mode):
avePerf = 0.0
aveFair = 0.0
count = 0
for jobs in jobsWindow:
count += 1
perf, fairness = scheduleOfJobList(jobs, clusterSize, mode)
avePerf += float(perf)
aveFair += float(fairness)
return avePerf / count, aveFair / count
def scheduleOfJobList(jobList, clusterSize, mode):
res = execSimulation(clusterSize, "queue1", jobList, mode)
return res["perf"], res["fairness"]
def calAverageValueOfWindowBasedList(workloadScale = 10, windowSize = 10, repeatNum = 5, swapNum = 10, clusterSize = 1):
l = genJobCateList([1,2,3,4], workloadScale)
windowNum = len(l) / windowSize
w = genWindowBasedList(l, windowSize)
swapNumList = [0]
for i in range(1, swapNum):
for j in range(repeatNum):
swapNumList.append(i)
entropyToPerf = {}
entropyToFairness = {}
result = []
swapNumCount = 0
for i in swapNumList:
beforeSwap = list(w)
afterSwap = swapItemByWindow(beforeSwap, i, windowNum, windowSize)
sortWindowBasedList(afterSwap)
e = genAverageEntropyByWindow(afterSwap)
perf, fairness = genAveragePerfFairForWindowList(afterSwap, clusterSize)
#print(e, perf, fairness)
entropyToPerf.setdefault(float('%0.1f'%e), []).append(perf)
entropyToFairness.setdefault(float('%0.1f'%e), []).append(fairness)
swapNumCount += 1
#print(swapNumCount)
for k in entropyToPerf.keys():
result.append({"entropy": k,
"perf": sum(entropyToPerf[k]) / len(entropyToPerf[k]),
"fairness": sum(entropyToFairness[k]) / len(entropyToFairness[k])})
sortedResult = sorted(result, key=lambda k: k['entropy'])
for i in sortedResult:
print i["entropy"], i["perf"], i["fairness"]
def getDetailSchedulingInfo(jobCateList, workloadScale, workloadSet, clusterSize):
l = genJobCateList(jobCateList, workloadScale)
jobs, codes = genJobsAccordingCategoryList(l, workloadSet)
for job in jobs:
print(job.getJobID())
entropy = Utility.calEntropyOfVectorList(codes, 4)
print("entropy: " + str(entropy) + ", cluster size: " + str(clusterSize))
fairMakespan, fairFinishedApp, perfMakespan, perfFinishedApp = execSimulationWithSchedulingInfo(clusterSize, "queue1", jobs)
print("fair makespan: " + str(fairMakespan) + ", perf makespan: " + str(perfMakespan))
count = 0
reduction = 0.0
for k in perfFinishedApp.keys():
count += 1
tPerf = perfFinishedApp[k]
tFair = fairFinishedApp[k]
if tPerf > tFair:
red = float(tPerf - tFair) / tFair
reduction += red
print("unfairness: " + str(float(reduction) / count))
print("fair app:")
for k, v in fairFinishedApp.items():
print(k, v)
print("perf app:")
for k, v in perfFinishedApp.items():
print(k, v)
def calAverageValueOfWindowBasedListForDiffClusterSize(jobCateList, workloadScale, workloadSet, windowSize, repeatNum, swapInternal, swapNum, clusterSizeList = [], mode = "new"):
l = genJobCateList(jobCateList, workloadScale)
windowNum = int(math.ceil(float(len(l)) / windowSize))
w = genWindowBasedList(l, windowSize, windowNum)
swapNumList = []
swapList = []
for i in range(swapNum + 1):
swapList.append(swapInternal * i)
for i in swapList:
for j in range(repeatNum):
swapNumList.append(i)
resultForDifferentSize = {}
for size in clusterSizeList:
resultForDifferentSize[size] = [{}, {}, []]
for i in swapNumList:
beforeSwap = list(w)
afterSwap = swapItemByWindow(beforeSwap, i, windowNum, windowSize)
sortWindowBasedList(afterSwap)
#e, chosenWindow = genAverageEntropyByWindow(afterSwap)
#e = genAverageEntropyByWindow(afterSwap)
#print("entropy:" + str(float('%.1f'%e)))
jobInfoOfWindowList = genJobsOfWindowList(afterSwap, workloadSet)
#sortedJobInfo = sorted(jobInfoOfWindowList, key = lambda k: k["entropy"], reverse = True)
#jobs = sortedJobInfo[0]["jobs"]
entropy = 0
count = 0
jobsWindow = []
for jobInfo in jobInfoOfWindowList:
count += 1
entropy += jobInfo["entropy"]
jobsWindow.append(jobInfo["jobs"])
e = float(entropy) / count
#e = sortedJobInfo[0]["entropy"]
#print("entropy:" + str(float('%.1f'%e)))
for size in clusterSizeList:
#perf, fairness = genAveragePerfFairForWindowList(jobsWindow, size, mode)
#perf, fairness = genAveragePerfFairForWindowList(chosenWindow, size, mode)
#perf, fairness = scheduleOfJobList(jobs, size, mode)
perf, fairness = genAverageAfterScheduling(jobsWindow, size, mode)
resultForDifferentSize[size][0].setdefault(float('%.1f'%e), []).append(perf)
resultForDifferentSize[size][1].setdefault(float('%.1f'%e), []).append(fairness)
for size in resultForDifferentSize.keys():
result = []
for k in resultForDifferentSize[size][0].keys():
result.append({"entropy": k,
"perf": sum(resultForDifferentSize[size][0][k]) / len(resultForDifferentSize[size][0][k]),
"fairness": sum(resultForDifferentSize[size][1][k]) / len(resultForDifferentSize[size][1][k])})
resultForDifferentSize[size][2] = sorted(result, key=lambda k: k['entropy'])
for k, v in resultForDifferentSize.items():
print("cluster size: " + str(k))
print "Entropy", "Perf", "Fairness"
for i in v[2]:
print i["entropy"], i["perf"], i["fairness"]
if __name__ == '__main__':
#jobList = genJob(4)
#genCombination(jobList, 0, len(jobList))
#print(len(RES))
#print(str(datetime.now()))
#l = genJobCateList([1, 1, 2, 2, 3, 3], 1)
#genLexiPermu(l, len(l))
#print(str(datetime.now()))
'''genCombination(l, 0, len(l))
print(RES[0])
print(str(datetime.now()))'''
# Gen combination by swapping
'''for clusterSize in [1, 2, 3, 4, 5]:
print("cluster size: " + str(clusterSize))
print "Entropy", "Perf", "Fairness"
calAverageValueOfWindowBasedList(20, 10, 10, clusterSize)'''
'''print(str(datetime.now()))
calAverageValueOfWindowBasedListForDiffClusterSize(24, 24, 1, 1, 10, [1,2,4,6,8,10], "new")
print(str(datetime.now()))'''
#print(str(datetime.now()))
#calAverageValueOfWindowBasedListForDiffClusterSize(24, 24, 1, 1, 10, [1,2,4,6,8,10], "old")
#print(str(datetime.now()))
#calAverageValueOfWindowBasedListForDiffClusterSize(800, 800, 1, 60, 10, [100, 200, 400, 600, 800])
#calAverageValueOfWindowBasedListForDiffClusterSize(500, 500, 1, 30, 10, [100, 200, 300, 400, 500])
'''print("old")
print(str(datetime.now()))
calAverageValueOfWindowBasedListForDiffClusterSize(1000, 500, 1, 70, 10, [100, 200, 300, 400, 500], "old")
print(str(datetime.now()))'''
'''print("new")
print(str(datetime.now()))
calAverageValueOfWindowBasedListForDiffClusterSize(500, 500, 1, 30, 10, [100, 200, 300, 400, 500], "new")
print(str(datetime.now()))'''
#print(Utility.calEntropyOfVectorList([1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4]))
#ratios = [{"window": 20, "cluster": 5}, {"window": 40, "cluster": 10}, {"window": 80, "cluster": 20}, {"window": 160, "cluster": 40}]
'''ratios = [{"window": 160, "cluster": 40}]
for i in ratios:
print("window: " + str(i["window"]) + " cluster: " + str(i["cluster"]))
print "Entropy", "Perf", "Fairness"
calAverageValueOfWindowBasedList(i["window"], 10, 10, i["cluster"])'''
#calAverageValueOfWindowBasedList(24, 24, 10, 10, 6)
# experiment 1
#calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 24, "workloadSet1", 24, 1, 1, 10, [6], "old")
'''print("#1 workloadset1")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 800, 1, 50, 10, [200], "old")
print("#2 workloadset2, same window size")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet2", 800, 1, 50, 10, [200], "old")'''
'''print("#3 workloadset2, same load")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 1600, "workloadSet2", 1600, 1, 100, 10, [200], "old")
print("#4 workloadset3, same window size")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4, 5, 6, 7, 8], 800, "workloadSet3", 800, 1, 100, 10, [200], "old")'''
'''print("#5 workloadset3, same load")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4, 5, 6, 7, 8], 1200, "workloadSet3", 1200, 1, 150, 10, [200], "old")
print("#6 workloadset5, same window size")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4, 5, 6, 7, 8], 800, "workloadSet5", 800, 1, 150, 10, [200], "old")'''
'''print("#7 workloadset5, same load")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4, 5, 6, 7, 8], 1200, "workloadSet5", 1200, 1, 200, 10, [200], "old")
print("#8 workloadset4")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4, 5, 6, 7, 8], 800, "workloadSet4", 800, 1, 100, 10, [200], "old")'''
'''print("#9 workloadset6, same window size")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet6", 800, 1, 50, 10, [200], "old")
print("#10 workloadset6, same load")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 1200, "workloadSet6", 1200, 1, 100, 10, [200], "old")'''
# cluster size
'''print("#11 workloadset1, cluster size 50")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 800, 1, 50, 10, [50], "old")
print("#12 workloadset1, cluster size 100")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 800, 1, 50, 10, [100], "old")'''
'''print("#13 workloadset1, cluster size 200")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 800, 1, 50, 10, [200], "old")
print("#14 workloadset1, cluster size 300")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 800, 1, 50, 10, [300], "old")'''
'''print("#15 workloadset1, cluster size 400")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 800, 1, 50, 10, [400], "old")
print("#16 workloadset1, cluster size 500")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 800, 1, 100, 10, [500], "old")'''
# window size
'''print("workloadSet1, window size")
print("#17 window 1000")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 400, 1, 50, 10, [200], "old")
print("#18 window 4000")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 1600, 1, 100, 5, [200], "old")
print("#19 window 6000")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 800, "workloadSet1", 3200, 1, 20, 0, [200], "old")'''
'''print("#20 window 8000")
calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 2000, "workloadSet1", 8000, 1, 20, 0, [200], "old")'''
#calAverageValueOfWindowBasedListForDiffClusterSize([1, 2, 3, 4], 24, "workloadSet", 24, 1, 2, 10, [1], "old")
# detail scheduling info
#getDetailSchedulingInfo([1,1,1,1,1,1,1,1,1,1,1,2], 2, "workloadSet8", 2)
#getDetailSchedulingInfo([1,1,1,1,1,1,1,1,1,1,1,2], 2, "workloadSet8", 4)
#getDetailSchedulingInfo([1,1,1,1,1,1,2,3], 3, "workloadSet8", 4)
#getDetailSchedulingInfo([1,2,3,4], 6, "workloadSet8", 4)
getDetailSchedulingInfo([1,2,3,4], 6, "workloadSet8", 6)