Skip to content

Commit

Permalink
move v_to_p_map from Chip to DataView
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Apr 2, 2024
1 parent bc417d6 commit 1f70362
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 3 additions & 7 deletions spinnman/messages/sdp/sdp_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,9 @@ def get_physical_cpu_id(self) -> str:
:rtype: str
"""
if SpiNNManDataView.has_machine():
chip = SpiNNManDataView.get_machine().get_chip_at(
self._destination_chip_x, self._destination_chip_y)
if chip is not None:
return chip.get_physical_core_string(
self._destination_cpu)
return ""
return SpiNNManDataView.get_physical_core_string(
self._destination_chip_x, self._destination_chip_y,
self._destination_cpu)

def update_for_send(self, source_x: int, source_y: int):
"""
Expand Down
5 changes: 2 additions & 3 deletions spinnman/processes/get_machine_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ def _make_chip(self, chip_info: ChipSummaryInfo, machine: Machine) -> Chip:
ip_address=chip_info.ethernet_ip_address,
nearest_ethernet_x=chip_info.nearest_ethernet_x,
nearest_ethernet_y=chip_info.nearest_ethernet_y,
down_cores=down_cores, parent_link=chip_info.parent_link,
v_to_p_map=self._virtual_to_physical_map.get(
(chip_info.x, chip_info.y)))
down_cores=down_cores, parent_link=chip_info.parent_link)

def _make_router(
self, chip_info: ChipSummaryInfo, machine: Machine) -> Router:
Expand Down Expand Up @@ -255,6 +253,7 @@ def get_machine_details(
ReadMemory((x, y, 0), P_TO_V_ADDR, P_MAPS_SIZE),
functools.partial(self._receive_p_maps, x, y))
self._progress.end()
SpiNNManDataView.set_v_to_p_map(self._virtual_to_physical_map)

# Warn about unexpected missing chips
for (x, y) in p2p_table.iterchips():
Expand Down

0 comments on commit 1f70362

Please sign in to comment.