Skip to content

Commit

Permalink
hwbench: add option --no-tuning to disable tuning for some runs
Browse files Browse the repository at this point in the history
  • Loading branch information
anisse committed Dec 2, 2024
1 parent 5a00337 commit 9897e58
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 7 additions & 1 deletion hwbench/hwbench.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def main():
# configure logging
init_logging(tuning_out_dir / "hwbench-tuning.log")

tuning_setup.Tuning(tuning_out_dir).apply()
tuning_setup.Tuning(tuning_out_dir).apply(args.tuning)
env = env_soft.Environment(out_dir)
hw = env_hw.Hardware(out_dir, args.monitoring_config)

Expand Down Expand Up @@ -91,6 +91,12 @@ def parse_options():
"--output-directory",
help="Specify the directory used to put all results and collected information",
)
parser.add_argument(
"--tuning",
action=argparse.BooleanOptionalAction,
default=True,
help="Enable or disable tuning: this is useful when you want to test the system as-is.",
)
return parser.parse_args()


Expand Down
6 changes: 5 additions & 1 deletion hwbench/tuning/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
from .scheduler import MQDeadlineIOScheduler
from .turbo_boost import IntelTurboBoost, TurboBoost
from ..utils.external import External_Simple
from ..utils.hwlogging import tunninglog


class Tuning:
def __init__(self, out_dir):
self.out_dir = out_dir

def apply(self):
def apply(self, apply_tuning: bool):
if not apply_tuning:
tunninglog().info("Tunning has been disabled on the hwbench command line")
return
External_Simple(self.out_dir, ["sync"])
SysctlDropCaches(self.out_dir).run()
PerformancePowerProfile(self.out_dir).run()
Expand Down

0 comments on commit 9897e58

Please sign in to comment.