Skip to content

Commit

Permalink
Added Info logging for profiler and removed unnecessary bracket calls. (
Browse files Browse the repository at this point in the history
  • Loading branch information
hariharan-devarajan authored Oct 17, 2023
1 parent cdc67e8 commit a724c11
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions dlio_benchmark/utils/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,13 +184,13 @@ def initialize_log(logdir, data_dir):
os.remove(instance.log_file)
spec = importlib.util.find_spec('dlio_profiler_py')
if spec:
logging.info(f"{utcnow()} Using DLIO Profiler")
instance.logger_type = LoggerType.DLIO_PROFILER
import dlio_profiler_py as dlio_logger
instance.logger = dlio_logger
instance.logger.initialize(instance.log_file, f"{data_dir}", process_id=get_rank())
with open(instance.log_file, 'w') as f:
f.write("[")
else:
logging.info(f"{utcnow()} Using Internal Profiler.")
instance.logger = logging.getLogger("perftrace")
instance.logger.setLevel(logging.DEBUG)
instance.logger.propagate = False
Expand Down Expand Up @@ -219,8 +219,6 @@ def log_event(self, name, cat, start_time, duration, int_args=None):
def finalize(self):
if self.logger_type == LoggerType.DLIO_PROFILER:
self.logger.finalize()
with open(self.log_file, 'a') as f:
f.write("]")
else:
self.logger.debug("]")

Expand Down

0 comments on commit a724c11

Please sign in to comment.