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 9, 2023
1 parent fb62a95 commit f5b3972
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 @@ -472,6 +472,7 @@ def controller(
num_workers,
queuedepth,
compressionlevel,
goldenrun_only,
goldenrun=True,
logger=hdf5collector,
qemu_pre=None,
Expand Down Expand Up @@ -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[
Expand Down Expand Up @@ -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=(
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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


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

0 comments on commit f5b3972

Please sign in to comment.