Skip to content

Commit e99780d

Browse files
committed
#611: pushed part of the update formulae that work prior to meeting
1 parent 3755001 commit e99780d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/lbaf/Execution/lbsTemperedWithUpdatesCriterion.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ def compute(self, r_src: Rank, o_src: list, r_dst: Rank, o_dst: Optional[list]=N
6767
self._work_model.compute(r_dst))
6868

6969
# Compute update formulae
70+
w_max_up = max(
71+
self._work_model.update(r_src, o_src, o_dst),
72+
self._work_model.update(r_dst, o_dst, o_src))
7073

7174
# Move objects into proposed new arrangement
7275
self._phase.transfer_objects(r_src, o_src, r_dst, o_dst)
@@ -80,4 +83,7 @@ def compute(self, r_src: Rank, o_src: list, r_dst: Rank, o_dst: Optional[list]=N
8083
self._phase.transfer_objects(r_dst, o_src, r_src, o_dst)
8184

8285
# Return criterion value
86+
if w_max_new != w_max_up:
87+
self._logger.error(f"Discrepancy in post update works: {w_max_new} <> {m_max_up}")
88+
8389
return w_max_0 - w_max_new

src/lbaf/Model/lbsAffineCombinationWorkModel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def compute(self, rank: Rank):
111111
rank.get_sent_volume(),
112112
rank.get_homing())
113113

114-
def update_load(self, rank: Rank, o_snd: list, o_rcv: list):
114+
def __update_load(self, rank: Rank, o_snd: list, o_rcv: list):
115115
"""Update total load if objects are to be sent and received."""
116116
return rank.get_load() + sum(
117117
o.get_load() for o in o_rcv) - sum(
@@ -122,7 +122,7 @@ def update(self, rank: Rank, o_snd: list, o_rcv: list):
122122
# Return combination of load and volumes
123123
return self.affine_combination(
124124
rank.get_alpha(),
125-
rank.update_load(),
125+
self.__update_load(rank, o_snd, o_rcv),
126126
rank.get_received_volume(),
127127
rank.get_sent_volume(),
128128
rank.get_homing())

0 commit comments

Comments
 (0)