diff --git a/controller.py b/controller.py index 1fec668..1495035 100755 --- a/controller.py +++ b/controller.py @@ -476,6 +476,7 @@ def controller( num_workers, queuedepth, compressionlevel, + goldenrun_only, goldenrun=True, logger=hdf5collector, qemu_pre=None, @@ -529,7 +530,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[ @@ -562,6 +566,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=( @@ -599,7 +610,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): @@ -698,7 +709,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( @@ -788,6 +803,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 @@ -824,6 +845,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) @@ -931,6 +958,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