From f5b3972d0f327c1609129752cf24e06c36776414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Berkay=20=C3=9Cr=C3=BCn?= Date: Wed, 23 Aug 2023 19:42:30 +0200 Subject: [PATCH] Add goldenrun-only flag --- controller.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/controller.py b/controller.py index 2aded00..1518183 100755 --- a/controller.py +++ b/controller.py @@ -472,6 +472,7 @@ def controller( num_workers, queuedepth, compressionlevel, + goldenrun_only, goldenrun=True, logger=hdf5collector, qemu_pre=None, @@ -525,7 +526,10 @@ def controller( return config_qemu clogger.info("Checking the backup") if check_backup(args, config_qemu, backup_config): - clogger.info("Backup matched and will be used") + clogger.info("Backup matched") + + if goldenrun_only: + return config_qemu faultlist = backup_expanded_faultlist config_qemu["max_instruction_count"] = backup_config[ @@ -558,6 +562,13 @@ def controller( log_config = False log_goldenrun = False + if goldenrun_only: + faultlist = [] + overwrite_faults = False + + log_config = True + log_goldenrun = True + p_logger = Process( target=logger, args=( @@ -595,7 +606,7 @@ def controller( continue goldenrun_data[keyword] = pd.DataFrame(goldenrun_data[keyword]) - pbar = tqdm(total=len(faultlist), desc="Simulating faults") + pbar = tqdm(total=len(faultlist), desc="Simulating faults", disable=not len(faultlist)) itter = 0 while 1: if len(p_list) == 0 and itter == len(faultlist): @@ -694,7 +705,11 @@ def controller( "Took {}:{}:{} to complete all experiments".format(int(h), int(m), int(s)) ) - tperindex = (t1 - t0) / len(faultlist) + if faultlist: + tperindex = (t1 - t0) / len(faultlist) + else: + tperindex = (t1 - t0) + tperworker = tperindex / num_workers clogger.debug( "Took average of {}s per fault, python worker rough runtime is {}s".format( @@ -784,6 +799,12 @@ def get_argument_parser(): action="store_true", required=False, ) + parser.add_argument( + "--goldenrun-only", + help="Only run goldenrun", + action="store_true", + required=False, + ) return parser @@ -820,6 +841,12 @@ def process_arguments(args): ) exit(1) + if args.goldenrun_only: + parguments["goldenrun_only"] = True + parguments["goldenrun"] = True + else: + parguments["goldenrun_only"] = False + qemu_conf = json.load(args.qemu) args.qemu.close() print(qemu_conf) @@ -927,6 +954,7 @@ def init_logging(): parguments["num_workers"], # num_workers parguments["queuedepth"], # queuedepth parguments["compressionlevel"], # compressionlevel + parguments["goldenrun_only"], parguments["goldenrun"], # goldenrun hdf5collector, # logger None, # qemu_pre