提交 ebfe5239 authored 作者: Frederic Bastien's avatar Frederic Bastien

Sort profile before printing

上级 605adead
......@@ -52,8 +52,9 @@ def _atexit_print_fn():
destination_file = sys.stdout
else:
destination_file = open(config.profiling.destination, 'w')
for ps in _atexit_print_list:
# Reverse sort in the order of compile+exec time
for ps in sorted(_atexit_print_list,
key=lambda a:a.compile_time + a.fct_call_time)[::-1]:
if ps.fct_callcount >= 1 or ps.compile_time > 1:
ps.summary(file=destination_file,
n_ops_to_print=config.profiling.n_ops,
......
......@@ -2511,7 +2511,6 @@ class EquilibriumOptimizer(NavigatorOptimizer):
m = prof2[idx][i][o2.index(opt)]
tmp.append(m)
return tmp
t = merge(global_optimizers, 'global_optimizers', 9)
global_sub_profs.append(merge(global_optimizers, 'global_optimizers', 9))
final_sub_profs.append(merge(final_optimizers, 'final_optimizers', 10))
cleanup_sub_profs.append(merge(cleanup_optimizers, 'cleanup_optimizers', 11))
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论