From 6f5f5a16b9e43430db8de02717dac8494b2fe6c0 Mon Sep 17 00:00:00 2001 From: MariusWirtz Date: Tue, 26 Oct 2021 18:15:28 +0200 Subject: [PATCH] Include processing speed in best order --- optimuspy.py | 2 +- results.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/optimuspy.py b/optimuspy.py index 6d0b034..8a46951 100644 --- a/optimuspy.py +++ b/optimuspy.py @@ -178,7 +178,7 @@ def main(instance_name: str, view_name: str, process_name: str, executions: int, tm1.cubes.update_storage_dimension_order(cube_name, best_order) logging.info(f"Updated dimension order for cube '{cube_name}' to {best_order}") else: - logging.info(f"Best order for cube '{cube_name}' {best_order}") + logging.info(f"Best order for cube '{cube_name}': {best_order}") tm1.cubes.update_storage_dimension_order(cube_name, original_dimension_order) logging.info( f"Restored original dimension order for cube '{cube_name}' to {original_dimension_order}") diff --git a/results.py b/results.py index e98fcb7..11adcfe 100644 --- a/results.py +++ b/results.py @@ -223,15 +223,22 @@ def determine_best_result(self) -> Union[PermutationResult, None]: min_ram, max_ram = min(ram_range), max(ram_range) query_speed_range = [result.median_query_time() for result in self.permutation_results] + process_speed_range = [result.median_process_time(result.process_name) for result in self.permutation_results] + min_query_speed, max_query_speed = min(query_speed_range), max(query_speed_range) + min_process_execution, max_process_execution = min(process_speed_range), max(process_speed_range) - # find a good balance between speed and ram - for value in (0.01, 0.025, 0.05, 0.075, 0.1, 0.125, 0.15, 0.2, 0.25): + # find a good balance between speed and ram and process speed + for value in (0.01, 0.025, 0.05): ram_threshold = min_ram + value * (max_ram - min_ram) query_speed_threshold = min_query_speed + value * (max_query_speed - min_query_speed) + process_speed_threshold = min_process_execution + value * (max_process_execution - min_process_execution) + for permutation_result in self.permutation_results: if all([permutation_result.ram_usage <= ram_threshold, - permutation_result.median_query_time() <= query_speed_threshold]): + permutation_result.median_query_time() <= query_speed_threshold, + permutation_result.median_process_time() <= process_speed_threshold]): + return permutation_result # no dimension order falls in sweet spot