Skip to content

Commit

Permalink
Fix these calls too
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Oct 10, 2024
1 parent 6104452 commit a3e7187
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions mcmc/mcmc_coordinator_vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ def get_sequence_mask(self, placement, routing_info):

def get_acknowledge_key(self, placement, routing_info):
if self._is_receiver_placement(placement):
key = routing_info.get_first_key_from_pre_vertex(
key = routing_info.get_safe_first_key_from_pre_vertex(
placement.vertex, self._acknowledge_partition_name)
return key
return 0
Expand Down Expand Up @@ -224,10 +224,9 @@ def generate_data_specification(
mcmc_placement = FecDataView.get_placement_of_vertex(vertex)
self._mcmc_placements.append(mcmc_placement)
if self._is_receiver_placement(mcmc_placement):
key = routing_info.get_first_key_from_pre_vertex(
key = routing_info.get_safe_first_key_from_pre_vertex(
vertex, self._acknowledge_partition_name)
if key is not None:
keys.append(key)
keys.append(key)
keys.sort()

# Write the data size in words
Expand Down
4 changes: 2 additions & 2 deletions mcmc/mcmc_vertex.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _get_model_state_array(self):
def get_result_key(self, placement):
if self._is_receiver_placement(placement):
routing_info = FecDataView.get_routing_infos()
key = routing_info.get_first_key_from_pre_vertex(
key = routing_info.get_safe_first_key_from_pre_vertex(
placement.vertex, self._result_partition_name)
return key
return 0
Expand All @@ -163,7 +163,7 @@ def _is_receiver_placement(self, placement):
def get_cholesky_result_key(self, placement):
if self._is_cholesky_receiver_placement(placement):
routing_info = FecDataView.get_routing_infos()
key = routing_info.get_first_key_from_pre_vertex(
key = routing_info.get_safe_first_key_from_pre_vertex(
placement.vertex, self._cholesky_result_partition_name)
return key
return 0
Expand Down

0 comments on commit a3e7187

Please sign in to comment.