Skip to content

Commit a9a9417

Browse files
committed
#586: ordering: use set operation when possible
1 parent 887ef9c commit a9a9417

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lbaf/Execution/lbsInformAndTransferAlgorithm.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,9 @@ def __execute_information_stage(self):
159159
msg = Message(0, {r_snd})
160160

161161
# Broadcast message to random sample of ranks excluding self
162+
other_ranks = [r for r in phase_ranks if r!= r_snd] if self._deterministic_transfer else phase_ranks.difference({r_snd})
162163
for r_rcv in random.sample(
163-
[r for r in phase_ranks if r != r_snd], min(self.__fanout, n_r - 1)):
164+
other_ranks, min(self.__fanout, n_r - 1)):
164165
messages.setdefault(r_rcv, []).append(msg)
165166

166167
# Sanity check prior to forwarding iterations

0 commit comments

Comments
 (0)