aboutsummaryrefslogtreecommitdiffstats
path: root/ecrts14/ecrts14.py
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2014-01-12 14:47:17 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2014-01-12 14:47:17 -0500
commit2be36af9b51551b1dc3d5d7881435b2e29402523 (patch)
tree830548cf4a0ffe621e543cfd4422e71981b9dc9d /ecrts14/ecrts14.py
parent6eaf83e1b470e8d0a72661b54bed2c9886ac7b64 (diff)
Get design points and save results in chunks
Patch makes getting design points and saving results happen in chunks. This reduces lock contention in the database, speeding up efficiency. Of course, load balancing is less granular.
Diffstat (limited to 'ecrts14/ecrts14.py')
-rwxr-xr-xecrts14/ecrts14.py22
1 files changed, 15 insertions, 7 deletions
diff --git a/ecrts14/ecrts14.py b/ecrts14/ecrts14.py
index ff772b5..90cd69e 100755
--- a/ecrts14/ecrts14.py
+++ b/ecrts14/ecrts14.py
@@ -380,12 +380,17 @@ def process_dp(_dp):
380 return __avg_sched, __avg_latencies, __avg_tard_ratios, __avg_hrt_ratios, __avg_ts_size, __avg_nr_graphs, __avg_graph_size, __avg_k 380 return __avg_sched, __avg_latencies, __avg_tard_ratios, __avg_hrt_ratios, __avg_ts_size, __avg_nr_graphs, __avg_graph_size, __avg_k
381 381
382def process_design_points(args): 382def process_design_points(args):
383 chunk_size = 415
383 try: 384 try:
384 (worker_id, db_name) = args 385 (worker_id, db_name) = args
385 nr_processed = 0 386 nr_processed = 0
387 __processed_dps = []
388 __results = []
386 while True: 389 while True:
387 dp = db.get_design_point(db_name) 390 dps = db.get_design_points(db_name, nr_dp = chunk_size)
388 if dp and not db.already_processed(dp, db_name = db_name): 391 if not dps or not len(dps):
392 break
393 for dp in dps:
389 (avg_sched, avg_lat, avg_tard_ratio, avg_hrt_tard_ratio, avg_ts_size, avg_nr_graphs, avg_size, avg_k) = process_dp(dp) 394 (avg_sched, avg_lat, avg_tard_ratio, avg_hrt_tard_ratio, avg_ts_size, avg_nr_graphs, avg_size, avg_k) = process_dp(dp)
390 395
391 sched_data = {} 396 sched_data = {}
@@ -401,10 +406,12 @@ def process_design_points(args):
401 results.avg_k = avg_k[m] 406 results.avg_k = avg_k[m]
402 sched_data[m] = results 407 sched_data[m] = results
403 408
404 db.store_sched_results(db_name, dp, sched_data) 409 __processed_dps.append(dp)
410 __results.append(sched_data)
405 nr_processed += 1 411 nr_processed += 1
406 else: 412 if len(__processed_dps):
407 break 413 assert len(__processed_dps) == len(__results)
414 db.store_sched_results(db_name, __processed_dps, __results)
408 except lite.OperationalError: 415 except lite.OperationalError:
409 print "CRAP. Database Error!" 416 print "CRAP. Database Error!"
410 print traceback.format_exc() 417 print traceback.format_exc()
@@ -463,8 +470,9 @@ def main():
463 # task parameters 470 # task parameters
464 step_size = 0.1 471 step_size = 0.1
465 exp.sys_util = [float(v) for v in arange(step_size, cpus+step_size, step_size)] 472 exp.sys_util = [float(v) for v in arange(step_size, cpus+step_size, step_size)]
466 exp.task_util = ['uni-light', 'uni-medium'] 473# exp.sys_util = [float(v) for v in arange(10.0, cpus+step_size, step_size)]
467 exp.period = ['uni-long'] 474 exp.task_util = ['uni-light', 'uni-medium', 'uni-heavy', 'bimo-medium']
475 exp.period = ['uni-short', 'uni-moderate', 'uni-long']
468# exp.job_splitting = [True, False] 476# exp.job_splitting = [True, False]
469 exp.job_splitting = [True] 477 exp.job_splitting = [True]
470 exp.wcycle = [0] 478 exp.wcycle = [0]