Skip to content

Commit

Permalink
suppress logging while calling MLPerfLog(), which is too chatty
Browse files Browse the repository at this point in the history
  • Loading branch information
ens-lg4 committed Jan 16, 2024
1 parent d18edc8 commit 5f4cb03
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions base_power_measurement_experiment/code_axs.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import datetime
import sys
import logging


def load_lines(fname):
Expand All @@ -17,8 +18,14 @@ def avg_power( mlperf_log_parser_path, server_timezone_sec, client_timezone_sec,
server_timezone = datetime.timedelta(seconds=server_timezone_sec)
client_timezone = datetime.timedelta(seconds=client_timezone_sec)

logger = logging.getLogger()
orig_level = logger.level
logger.setLevel(logging.CRITICAL)

mlperf_log = MLPerfLog(detail_log_path)

logger.setLevel(orig_level)

datetime_format = '%m-%d-%Y %H:%M:%S.%f'
power_begin = datetime.datetime.strptime(mlperf_log["power_begin"], datetime_format) + client_timezone
power_end = datetime.datetime.strptime(mlperf_log["power_end"], datetime_format) + client_timezone
Expand Down

0 comments on commit 5f4cb03

Please sign in to comment.