Skip to content

Commit b5e6fb4

Browse files
committed
#607: added better instrumentation
1 parent 8363cfe commit b5e6fb4

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/lbaf/Execution/lbsAlgorithmBase.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ def __init__(self, work_model: WorkModelBase, parameters: dict, logger: Logger):
9999
self.__statistics = {
100100
("ranks", lambda x: x.get_load()): {
101101
"maximum load": "maximum"},
102+
("ranks", lambda x: self._work_model.compute(x)): {
103+
"maximum work": "maximum"},
102104
("ranks", lambda x: self._work_model.compute(x)): {
103105
"total work": "sum"}}
104106

src/lbaf/Execution/lbsInformAndTransferAlgorithm.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,10 @@ def execute(self, p_id: int, phases: list, statistics: dict):
233233
# Set phase to be used by transfer criterion
234234
self.__transfer_criterion.set_phase(self._rebalanced_phase)
235235

236-
# Retrieve total work from computed statistics
237-
total_work = statistics["total work"][-1]
238-
239236
# Perform requested number of load-balancing iterations
237+
s_name = "maximum work"
240238
for i in range(self.__n_iterations):
241-
self._logger.info(f"Starting iteration {i + 1} with total work of {total_work}")
239+
self._logger.info(f"Starting iteration {i + 1} with {s_name} of {statistics[s_name][-1]:.6g}")
242240

243241
# Time the duration of each iteration
244242
start_time = time.time()

src/lbaf/Execution/lbsTransferStrategyBase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def _initialize_transfer_stage(self, ave_load: float):
9292
"""Initialize transfer stage consistently across strategies."""
9393

9494
# Keep track of average load
95+
self._logger.info(f"Executing transfer phase with average load: {ave_load}")
9596
self._average_load = ave_load
96-
self._logger.info(f"Executing transfer phase with average load: {self._average_load}")
9797

9898
# Initialize numbers of transfers and rejects
9999
self._n_transfers = 0

0 commit comments

Comments
 (0)