From 20ec99ba96f349671f007b1a98bbb3864d064111 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 12 Mar 2024 15:08:32 +0000 Subject: [PATCH 1/3] a chip is also an (x,y) --- spinnman/processes/application_copy_run_process.py | 8 ++++---- spinnman/transceiver/base_transceiver.py | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/spinnman/processes/application_copy_run_process.py b/spinnman/processes/application_copy_run_process.py index ebc05fd56..346253e92 100644 --- a/spinnman/processes/application_copy_run_process.py +++ b/spinnman/processes/application_copy_run_process.py @@ -54,7 +54,7 @@ def _get_next_chips( on_same_board = _on_same_board(chip, chip_xy) eth = (chip.nearest_ethernet_x, chip.nearest_ethernet_y) if (eth not in chips_done or - (chip.x, chip.y) not in chips_done[eth]): + chip not in chips_done[eth]): if on_same_board or not off_board_copy_done: next_chips.append(chip) if not on_same_board: @@ -119,19 +119,19 @@ def run(self, size: int, app_id: int, core_subsets: CoreSubsets, boot_chip = machine.boot_chip chips_done: Mapping[Tuple[int, int], List[Tuple[int, int]]] = \ defaultdict(list) - chips_done[boot_chip.x, boot_chip.y].append((boot_chip.x, boot_chip.y)) + chips_done[boot_chip].append((boot_chip)) parent_chips = _compute_parent_chips(machine) next_chips = _get_next_chips(chips_done, parent_chips, machine) while next_chips: # Do all the chips at the current level for chip in next_chips: - subset = core_subsets.get_core_subset_for_chip(chip.x, chip.y) + subset = core_subsets.get_core_subset_for_chip(chip) self._send_request(AppCopyRun( chip.x, chip.y, cast(int, chip.parent_link), size, app_id, subset.processor_ids, checksum, wait)) eth = (chip.nearest_ethernet_x, chip.nearest_ethernet_y) - chips_done[eth].append((chip.x, chip.y)) + chips_done[eth].append(chip) self._finish() self.check_for_error() next_chips = _get_next_chips(chips_done, parent_chips, machine) diff --git a/spinnman/transceiver/base_transceiver.py b/spinnman/transceiver/base_transceiver.py index 3c699942c..67f440c76 100644 --- a/spinnman/transceiver/base_transceiver.py +++ b/spinnman/transceiver/base_transceiver.py @@ -816,11 +816,9 @@ def get_core_state_count( self, app_id: int, state: CPUState, xys: Optional[Iterable[Tuple[int, int]]] = None) -> int: process = GetNCoresInStateProcess(self._scamp_connection_selector) - chip_xys = xys if xys is None: machine = SpiNNManDataView.get_machine() - chip_xys = [(ch.x, ch.y) - for ch in machine.ethernet_connected_chips] + chip_xys = machine.ethernet_connected_chips else: chip_xys = xys return process.get_n_cores_in_state(chip_xys, app_id, state) From a0833f86170bbed55bafda698c296af165f3d26b Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 12 Mar 2024 15:21:15 +0000 Subject: [PATCH 2/3] typing --- spinnman/processes/application_copy_run_process.py | 2 +- spinnman/transceiver/base_transceiver.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spinnman/processes/application_copy_run_process.py b/spinnman/processes/application_copy_run_process.py index 346253e92..33c80a538 100644 --- a/spinnman/processes/application_copy_run_process.py +++ b/spinnman/processes/application_copy_run_process.py @@ -126,7 +126,7 @@ def run(self, size: int, app_id: int, core_subsets: CoreSubsets, while next_chips: # Do all the chips at the current level for chip in next_chips: - subset = core_subsets.get_core_subset_for_chip(chip) + subset = core_subsets.get_core_subset_for_chip(chip.x, chip.y) self._send_request(AppCopyRun( chip.x, chip.y, cast(int, chip.parent_link), size, app_id, subset.processor_ids, checksum, wait)) diff --git a/spinnman/transceiver/base_transceiver.py b/spinnman/transceiver/base_transceiver.py index 67f440c76..fa0b83ad7 100644 --- a/spinnman/transceiver/base_transceiver.py +++ b/spinnman/transceiver/base_transceiver.py @@ -816,6 +816,7 @@ def get_core_state_count( self, app_id: int, state: CPUState, xys: Optional[Iterable[Tuple[int, int]]] = None) -> int: process = GetNCoresInStateProcess(self._scamp_connection_selector) + chip_xys: Iterable[Tuple[int, int]] if xys is None: machine = SpiNNManDataView.get_machine() chip_xys = machine.ethernet_connected_chips From f32b7e71dd69b4744b9b7deb138c70d1459c8956 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 13 Mar 2024 06:27:38 +0000 Subject: [PATCH 3/3] remove hard coded n processors --- spinnman/get_cores_in_run_state.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spinnman/get_cores_in_run_state.py b/spinnman/get_cores_in_run_state.py index 1dcf930a5..2c55a2c55 100644 --- a/spinnman/get_cores_in_run_state.py +++ b/spinnman/get_cores_in_run_state.py @@ -48,7 +48,8 @@ def get_cores_in_run_state(txrx, app_id, print_all_chips): all_cores = [] for chip in machine.chips: - all_cores.append(CoreSubset(chip.x, chip.y, range(1, 17))) + all_cores.append(CoreSubset( + chip.x, chip.y, chip.placable_processors_ids)) all_cores = CoreSubsets(core_subsets=all_cores)