Skip to content

Commit 148581b

Browse files
committed
#566: reduced computation of stats to what is needed: max load and total work
1 parent e3b5659 commit 148581b

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

src/lbaf/Execution/lbsAlgorithmBase.py

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -87,22 +87,12 @@ def __init__(self, work_model: WorkModelBase, parameters: dict, logger: Logger):
8787
# Save the initial communications data
8888
self._initial_communications = {}
8989

90-
# Map global statistical QOIs to their computation methods
90+
# Map rank statistics to their respective computation methods
9191
self.__statistics = {
9292
("ranks", lambda x: x.get_load()): {
93-
"minimum load": "minimum",
94-
"maximum load": "maximum",
95-
"load variance": "variance",
96-
"load imbalance": "imbalance"},
97-
("largest_volumes", lambda x: x): {
98-
"number of communication edges": "cardinality",
99-
"maximum largest directed volume": "maximum",
100-
"total largest directed volume": "sum"},
101-
("ranks", lambda x: self._work_model.compute(x)): { #pylint:disable=W0108
102-
"minimum work": "minimum",
103-
"maximum work": "maximum",
104-
"total work": "sum",
105-
"work variance": "variance"}}
93+
"maximum load": "maximum"},
94+
("ranks", lambda x: self._work_model.compute(x)): {
95+
"total work": "sum"}}
10696

10797
def get_rebalanced_phase(self):
10898
"""Return phased assigned for processing by algoritm."""
@@ -143,6 +133,7 @@ def _update_statistics(self, statistics: dict):
143133
# Create or update statistics dictionary entries
144134
for (support, getter), stat_names in self.__statistics.items():
145135
for k, v in stat_names.items():
136+
self._logger.info(f"Updating {k} statistics for {support}")
146137
stats = compute_function_statistics(
147138
getattr(self._rebalanced_phase, f"get_{support}")(), getter)
148139
statistics.setdefault(k, []).append(getattr(stats, f"get_{v}")())

0 commit comments

Comments
 (0)