Skip to content

Commit a5a62eb

Browse files
committed
Profile performance_compare + minor storage profiling improvements
1 parent 92c4aa7 commit a5a62eb

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

reframe/frontend/cli.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -218,16 +218,19 @@ def __enter__(self):
218218
return self
219219

220220
def __exit__(self, exc_type, exc_val, exc_tb):
221-
logging.getprofiler().print_report(self.__logger.debug)
222221
if exc_type is SystemExit:
223222
# Allow users to exit inside the context manager
223+
logging.getprofiler().exit_region()
224+
logging.getprofiler().print_report(self.__logger.debug)
224225
return
225226

226227
if isinstance(exc_val, self.__exceptions):
227228
self.__logger.error(f'{self.__message}: {exc_val}')
228229
self.__logger.verbose(
229230
''.join(traceback.format_exception(exc_type, exc_val, exc_tb))
230231
)
232+
logging.getprofiler().exit_region()
233+
logging.getprofiler().print_report(self.__logger.debug)
231234
sys.exit(self.__exitcode)
232235

233236

@@ -1002,15 +1005,12 @@ def restrict_logging():
10021005

10031006
if options.performance_compare:
10041007
namepatt = '|'.join(options.names)
1005-
try:
1008+
with exit_gracefully_on_error('failed to generate performance report',
1009+
printer):
10061010
printer.table(
10071011
reporting.performance_compare(options.performance_compare,
10081012
namepatt=namepatt)
10091013
)
1010-
except errors.ReframeError as err:
1011-
printer.error(f'failed to generate performance report: {err}')
1012-
sys.exit(1)
1013-
else:
10141014
sys.exit(0)
10151015

10161016
# Show configuration after everything is set up

0 commit comments

Comments
 (0)