From 1f70362952af62a2c6abdc0f8355b795afc23a76 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Apr 2024 14:53:07 +0100 Subject: [PATCH 1/4] move v_to_p_map from Chip to DataView --- spinnman/messages/sdp/sdp_header.py | 10 +++------- spinnman/processes/get_machine_process.py | 5 ++--- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/spinnman/messages/sdp/sdp_header.py b/spinnman/messages/sdp/sdp_header.py index 98523a341..370e1ab81 100644 --- a/spinnman/messages/sdp/sdp_header.py +++ b/spinnman/messages/sdp/sdp_header.py @@ -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): """ diff --git a/spinnman/processes/get_machine_process.py b/spinnman/processes/get_machine_process.py index 7df2ab18d..fee4fe108 100644 --- a/spinnman/processes/get_machine_process.py +++ b/spinnman/processes/get_machine_process.py @@ -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: @@ -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(): From 30228ff61b8921f1886dfd16cd699616d737473c Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Apr 2024 15:10:48 +0100 Subject: [PATCH 2/4] XY as a tuple --- spinnman/messages/sdp/sdp_header.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinnman/messages/sdp/sdp_header.py b/spinnman/messages/sdp/sdp_header.py index 370e1ab81..538855a63 100644 --- a/spinnman/messages/sdp/sdp_header.py +++ b/spinnman/messages/sdp/sdp_header.py @@ -331,7 +331,7 @@ def get_physical_cpu_id(self) -> str: :rtype: str """ return SpiNNManDataView.get_physical_core_string( - self._destination_chip_x, self._destination_chip_y, + (self._destination_chip_x, self._destination_chip_y), self._destination_cpu) def update_for_send(self, source_x: int, source_y: int): From 24c7759b87b41e3fddba17331e3797168f955db5 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 2 Apr 2024 16:24:14 +0100 Subject: [PATCH 3/4] Chip now takes scamp and placeable processor ids as param --- spinnman/processes/get_machine_process.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/spinnman/processes/get_machine_process.py b/spinnman/processes/get_machine_process.py index fee4fe108..aa97e7631 100644 --- a/spinnman/processes/get_machine_process.py +++ b/spinnman/processes/get_machine_process.py @@ -116,15 +116,20 @@ def _make_chip(self, chip_info: ChipSummaryInfo, machine: Machine) -> Chip: n_cores = min(chip_info.n_cores, n_cores) core_states = chip_info.core_states down_cores = self._ignore_cores_map.get( - (chip_info.x, chip_info.y), None) + (chip_info.x, chip_info.y), set()) + if 0 in down_cores: + raise NotImplementedError( + f"Declaring scamp core (0) as down is not supported") + cores = list() for i in range(1, n_cores): - if core_states[i] != CPUState.IDLE: + if i in down_cores: + pass + elif core_states[i] != CPUState.IDLE: self._report_ignore( "Not using core {}, {}, {} in state {}", chip_info.x, chip_info.y, i, core_states[i]) - if down_cores is None: - down_cores = set() - down_cores.add(i) + else: + cores.append(i) # Create the router router = self._make_router(chip_info, machine) @@ -139,12 +144,13 @@ def _make_chip(self, chip_info: ChipSummaryInfo, machine: Machine) -> Chip: # Create the chip return Chip( - x=chip_info.x, y=chip_info.y, n_processors=n_cores, + x=chip_info.x, y=chip_info.y, scamp_processors=[0], + placable_processors=cores, router=router, sdram=sdram_size, 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) + parent_link=chip_info.parent_link) def _make_router( self, chip_info: ChipSummaryInfo, machine: Machine) -> Router: From 7c809a17a727143fbc571a845e27d2cf654b5746 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 9 Apr 2024 12:58:53 +0100 Subject: [PATCH 4/4] not an f string --- spinnman/processes/get_machine_process.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinnman/processes/get_machine_process.py b/spinnman/processes/get_machine_process.py index aa97e7631..00b104300 100644 --- a/spinnman/processes/get_machine_process.py +++ b/spinnman/processes/get_machine_process.py @@ -119,7 +119,7 @@ def _make_chip(self, chip_info: ChipSummaryInfo, machine: Machine) -> Chip: (chip_info.x, chip_info.y), set()) if 0 in down_cores: raise NotImplementedError( - f"Declaring scamp core (0) as down is not supported") + "Declaring scamp core (0) as down is not supported") cores = list() for i in range(1, n_cores): if i in down_cores: