Skip to content

Commit 6d920ac

Browse files
author
telemin
committed
change default reference case choice strategy
1 parent 1ac882e commit 6d920ac

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

pypop/metrics/metricset.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,16 @@ def _repr_html_(self):
100100
def _choose_ref_key(stats_dict):
101101
""" Take the stats dict and choose an appropriate reference trace.
102102
103-
As a default choice choose the smallest number of processes, breaking ties with
104-
smallest number of threads per process
103+
As a default choice choose the smallest number of total threads, breaking ties
104+
with smallest number of threads per process
105105
"""
106106

107-
sort_key = lambda x: "{:05}_{:05}".format(
108-
x[1].metadata.num_processes, x[1].metadata.threads_per_process[0]
109-
)
110-
111-
return min(stats_dict.items(), key=sort_key)[0]
107+
return min(
108+
stats_dict.items(),
109+
key=lambda x: "{:05}_{:05}".format(
110+
x[1].metadata.total_threads, x[1].metadata.threads_per_process[0]
111+
),
112+
)[0]
112113

113114
@property
114115
def metric_data(self):

0 commit comments

Comments
 (0)