Skip to content

Commit

Permalink
Add goldenrun-only flag
Browse files Browse the repository at this point in the history
  • Loading branch information
berkayurun committed Sep 28, 2023
1 parent 53d9db7 commit 591bac5
Showing 1 changed file with 31 additions and 3 deletions.
34 changes: 31 additions & 3 deletions controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ def controller(
num_workers,
queuedepth,
compressionlevel,
goldenrun_only,
goldenrun=True,
logger=hdf5collector,
qemu_pre=None,
Expand Down Expand Up @@ -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[
Expand Down Expand Up @@ -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=(
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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


Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 591bac5

Please sign in to comment.