From 80d918964cd0eefd3a9e938f151445e0cadb7a11 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 24 Oct 2023 11:56:34 +0100 Subject: [PATCH 1/4] app_vertex.has_splitter --- .../interface/splitter_selectors/splitter_selector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py b/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py index 9d77dbea67..ba8116b40e 100644 --- a/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py +++ b/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py @@ -24,13 +24,13 @@ logger = FormatAdapter(logging.getLogger(__name__)) -def splitter_selector(): +def splitter_selector() -> None: """ Basic selector which puts the legacy splitter object on everything without a splitter object. """ for app_vertex in PacmanDataView.iterate_vertices(): - if app_vertex.splitter is None: + if not app_vertex.has_splitter is None: vertex_selector(app_vertex) From 3f57d099b5c4674632017e3ca477d8cdf973ccb4 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 24 Oct 2023 14:08:30 +0100 Subject: [PATCH 2/4] fix call --- .../interface/splitter_selectors/splitter_selector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py b/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py index ba8116b40e..797054a110 100644 --- a/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py +++ b/spinn_front_end_common/interface/splitter_selectors/splitter_selector.py @@ -30,7 +30,7 @@ def splitter_selector() -> None: everything without a splitter object. """ for app_vertex in PacmanDataView.iterate_vertices(): - if not app_vertex.has_splitter is None: + if not app_vertex.has_splitter: vertex_selector(app_vertex) From 1ce0b76dd03b1fb9329f9e2196472ce11b0fd773 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Tue, 24 Oct 2023 14:19:26 +0100 Subject: [PATCH 3/4] use vertex_slice property --- .../reverse_ip_tag_multicast_source_machine_vertex.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spinn_front_end_common/utility_models/reverse_ip_tag_multicast_source_machine_vertex.py b/spinn_front_end_common/utility_models/reverse_ip_tag_multicast_source_machine_vertex.py index ca72ee321a..a68d717744 100644 --- a/spinn_front_end_common/utility_models/reverse_ip_tag_multicast_source_machine_vertex.py +++ b/spinn_front_end_common/utility_models/reverse_ip_tag_multicast_source_machine_vertex.py @@ -494,8 +494,8 @@ def _fill_send_buffer_2d(self, key_base): end_time_step = FecDataView.get_current_run_timesteps() if first_time_step == end_time_step: return - keys = get_field_based_keys(key_base, self._vertex_slice) - for atom in range(self._vertex_slice.n_atoms): + keys = get_field_based_keys(key_base, self.vertex_slice) + for atom in range(self.vertex_slice.n_atoms): for tick in sorted(self._send_buffer_times[atom]): if self._is_in_range(tick, first_time_step, end_time_step): self._send_buffer.add_key(tick, keys[atom]) @@ -512,8 +512,8 @@ def _fill_send_buffer_1d(self, key_base): end_time_step = FecDataView.get_current_run_timesteps() if first_time_step == end_time_step: return - keys = get_field_based_keys(key_base, self._vertex_slice) - key_list = [keys[atom] for atom in range(self._vertex_slice.n_atoms)] + keys = get_field_based_keys(key_base, self.vertex_slice) + key_list = [keys[atom] for atom in range(self.vertex_slice.n_atoms)] for tick in sorted(self._send_buffer_times): if self._is_in_range(tick, first_time_step, end_time_step): self._send_buffer.add_keys(tick, key_list) From 6637a83d1604f8cb1302f2da803ad135be170c2a Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 25 Oct 2023 08:08:21 +0100 Subject: [PATCH 4/4] metacalss AbstractBase --- .../abstract_models/impl/tdma_aware_application_vertex.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spinn_front_end_common/abstract_models/impl/tdma_aware_application_vertex.py b/spinn_front_end_common/abstract_models/impl/tdma_aware_application_vertex.py index f75bdeeb37..fe637ec452 100644 --- a/spinn_front_end_common/abstract_models/impl/tdma_aware_application_vertex.py +++ b/spinn_front_end_common/abstract_models/impl/tdma_aware_application_vertex.py @@ -11,13 +11,14 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +from spinn_utilities.abstract_base import AbstractBase from pacman.model.graphs.application import ApplicationVertex from spinn_front_end_common.interface.provenance import ProvenanceWriter from spinn_front_end_common.utilities.constants import BYTES_PER_WORD from spinn_utilities.abstract_base import abstractmethod -class TDMAAwareApplicationVertex(ApplicationVertex): +class TDMAAwareApplicationVertex(ApplicationVertex, metaclass=AbstractBase): """ An application vertex that contains the code for using TDMA to spread packet transmission to try to avoid overloading any SpiNNaker routers.