From 4ae4a89f07227aae81959a24e6f0fcc43fa8975c Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 6 Mar 2024 16:32:53 +0000 Subject: [PATCH 1/6] rename non_user cores to scamp cores --- spinn_machine/chip.py | 4 ++-- spinn_machine/version/abstract_version.py | 4 ++-- spinn_machine/version/version_spin1.py | 4 ++-- unittests/version/test_version3.py | 2 +- unittests/version/test_version5.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/spinn_machine/chip.py b/spinn_machine/chip.py index ea899b8d..0ba7ddd0 100644 --- a/spinn_machine/chip.py +++ b/spinn_machine/chip.py @@ -115,14 +115,14 @@ def __generate_monitors(self): if standard_monitor_processors is None: standard_monitor_processors = dict() for i in range( - MachineDataView.get_machine_version().n_non_user_cores): + MachineDataView.get_machine_version().n_scamp_cores): standard_monitor_processors[i] = Processor.factory(i, True) return standard_monitor_processors def __generate_processors( self, n_processors: int, down_cores: Optional[Collection[int]]) -> Dict[int, Processor]: - n_monitors = MachineDataView.get_machine_version().n_non_user_cores + n_monitors = MachineDataView.get_machine_version().n_scamp_cores if down_cores is None: if n_processors not in standard_processors: processors = dict() diff --git a/spinn_machine/version/abstract_version.py b/spinn_machine/version/abstract_version.py index 7301c008..b50593c6 100644 --- a/spinn_machine/version/abstract_version.py +++ b/spinn_machine/version/abstract_version.py @@ -145,9 +145,9 @@ def max_cores_per_chip(self) -> int: @property @abstractmethod - def n_non_user_cores(self) -> int: + def n_scamp_cores(self) -> int: """ - The number of system cores per chip. + The number of scamp cores per chip. :rtype: int """ diff --git a/spinn_machine/version/version_spin1.py b/spinn_machine/version/version_spin1.py index a18e4f66..2d4520c6 100644 --- a/spinn_machine/version/version_spin1.py +++ b/spinn_machine/version/version_spin1.py @@ -29,8 +29,8 @@ def __init__(self) -> None: super().__init__(max_cores_per_chip=18, max_sdram_per_chip=123469792) @property - @overrides(AbstractVersion.n_non_user_cores) - def n_non_user_cores(self) -> int: + @overrides(AbstractVersion.n_scamp_cores) + def n_scamp_cores(self) -> int: return 1 @property diff --git a/unittests/version/test_version3.py b/unittests/version/test_version3.py index 4d529a1d..8c7779ef 100644 --- a/unittests/version/test_version3.py +++ b/unittests/version/test_version3.py @@ -33,7 +33,7 @@ def test_attributes(self): version = Version3() self.assertEqual(18, version.max_cores_per_chip) self.assertEqual(123469792, version.max_sdram_per_chip) - self.assertEqual(1, version.n_non_user_cores) + self.assertEqual(1, version.n_scamp_cores) self.assertEqual("Spin1 4 Chip", version.name) self.assertEqual(3, version.number) self.assertEqual((2, 2), version.board_shape) diff --git a/unittests/version/test_version5.py b/unittests/version/test_version5.py index f35aa164..3ca9d741 100644 --- a/unittests/version/test_version5.py +++ b/unittests/version/test_version5.py @@ -36,7 +36,7 @@ def test_attributes(self): version = Version5() self.assertEqual(18, version.max_cores_per_chip) self.assertEqual(123469792, version.max_sdram_per_chip) - self.assertEqual(1, version.n_non_user_cores) + self.assertEqual(1, version.n_scamp_cores) self.assertEqual("Spin1 48 Chip", version.name) self.assertEqual(5, version.number) self.assertEqual((8, 8), version.board_shape) From 07ffd695da513f1dc4587be1363db657bb5c01d8 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Wed, 6 Mar 2024 17:06:20 +0000 Subject: [PATCH 2/6] rename monitor processor to scamp processors --- spinn_machine/chip.py | 56 +++++++++++++++---------------- unittests/test_chip.py | 4 +-- unittests/test_json_machine.py | 4 +-- unittests/test_virtual_machine.py | 2 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/spinn_machine/chip.py b/spinn_machine/chip.py index 0ba7ddd0..4a6b916b 100644 --- a/spinn_machine/chip.py +++ b/spinn_machine/chip.py @@ -22,7 +22,7 @@ # One dict for each number of processors (none dead) standard_processors = {} # One dict for the standard monitor processors -standard_monitor_processors = None # pylint: disable=invalid-name +standard_scamp_processors = None # pylint: disable=invalid-name class Chip(object): @@ -42,7 +42,7 @@ class Chip(object): __slots__ = ( "_x", "_y", "_router", "_sdram", "_ip_address", "_tag_ids", "_nearest_ethernet_x", "_nearest_ethernet_y", - "_user_processors", "_monitor_processors", "_parent_link", + "_user_processors", "_scamp_processors", "_parent_link", "_v_to_p_map" ) @@ -88,7 +88,7 @@ def __init__(self, x: int, y: int, n_processors: int, router: Router, """ self._x = x self._y = y - self._monitor_processors = self.__generate_monitors() + self._scamp_processors = self.__generate_scamp() self._user_processors = self.__generate_processors( n_processors, down_cores) self._router = router @@ -105,19 +105,19 @@ def __init__(self, x: int, y: int, n_processors: int, router: Router, self._parent_link = parent_link self._v_to_p_map = v_to_p_map - def __generate_monitors(self): + def __generate_scamp(self): """ - Generates the monitors assuming all Chips have the same monitor cores + Generates the scamp assuming all Chips have the same scamp cores :return: Dict[int, Processor] """ - global standard_monitor_processors # pylint: disable=global-statement - if standard_monitor_processors is None: - standard_monitor_processors = dict() + global standard_scamp_processors # pylint: disable=global-statement + if standard_scamp_processors is None: + standard_scamp_processors = dict() for i in range( MachineDataView.get_machine_version().n_scamp_cores): - standard_monitor_processors[i] = Processor.factory(i, True) - return standard_monitor_processors + standard_scamp_processors[i] = Processor.factory(i, True) + return standard_scamp_processors def __generate_processors( self, n_processors: int, @@ -152,7 +152,7 @@ def is_processor_with_id(self, processor_id: int) -> bool: """ if processor_id in self._user_processors: return True - return processor_id in self._monitor_processors + return processor_id in self._scamp_processors def get_processor_with_id(self, processor_id: int) -> Optional[Processor]: """ @@ -167,7 +167,7 @@ def get_processor_with_id(self, processor_id: int) -> Optional[Processor]: """ if processor_id in self._user_processors: return self._user_processors[processor_id] - return self._monitor_processors.get(processor_id) + return self._scamp_processors.get(processor_id) @property def x(self) -> int: @@ -204,7 +204,7 @@ def processors(self) -> Iterator[Processor]: :rtype: iterable(Processor) """ - yield from self._monitor_processors.values() + yield from self._scamp_processors.values() yield from self._user_processors.values() @property @@ -214,7 +214,7 @@ def all_processor_ids(self) -> Iterator[int]: :rtype: iterable(int) """ - yield from self._monitor_processors.keys() + yield from self._scamp_processors.keys() yield from self._user_processors.keys() @property @@ -224,7 +224,7 @@ def n_processors(self) -> int: :rtype: int """ - return len(self._monitor_processors) + len(self._user_processors) + return len(self._scamp_processors) + len(self._user_processors) @property def user_processors(self) -> Iterator[Processor]: @@ -247,38 +247,38 @@ def user_processors_ids(self) -> Iterator[int]: @property def n_user_processors(self) -> int: """ - The total number of processors that are not monitors. + The total number of processors that are not used by scamp. :rtype: int """ return len(self._user_processors) @property - def monitor_processors(self) -> Iterator[Processor]: + def scamp_processors(self) -> Iterator[Processor]: """ - An iterable of available monitor processors. + An iterable of available scamp processors. :rtype: iterable(Processor) """ - return self._monitor_processors.values() + return self._scamp_processors.values() @property - def monitor_processors_ids(self) -> Iterator[int]: + def scamp_processors_ids(self) -> Iterator[int]: """ - An iterable of available user processors. + An iterable of available scamp processors. :rtype: iterable(Processor) """ - yield from self._monitor_processors + yield from self._scamp_processors @property def n_monitor_processors(self) -> int: """ - The total number of processors that are not monitors. + The total number of processors that are used by scamp. :rtype: int """ - return len(self._monitor_processors) + return len(self._scamp_processors) @property def router(self) -> Router: @@ -389,7 +389,7 @@ def __iter__(self) -> Iterator[Tuple[int, Processor]]: * ``processor`` is the processor with the ID :rtype: iterable(tuple(int,Processor)) """ - yield from self._monitor_processors.items() + yield from self._scamp_processors.items() yield from self._user_processors.items() def __len__(self) -> int: @@ -399,13 +399,13 @@ def __len__(self) -> int: :return: The number of items in the underlying iterator. :rtype: int """ - return len(self._monitor_processors) + len(self._user_processors) + return len(self._scamp_processors) + len(self._user_processors) def __getitem__(self, processor_id: int) -> Processor: if processor_id in self._user_processors: return self._user_processors[processor_id] - if processor_id in self._monitor_processors: - return self._monitor_processors[processor_id] + if processor_id in self._scamp_processors: + return self._scamp_processors[processor_id] # Note difference from get_processor_with_id(); this is to conform to # standard Python semantics raise KeyError(processor_id) diff --git a/unittests/test_chip.py b/unittests/test_chip.py index 083e606e..a3a34d3f 100644 --- a/unittests/test_chip.py +++ b/unittests/test_chip.py @@ -120,10 +120,10 @@ def test_processors(self): users = set(new_chip.user_processors) self.assertEqual(len(users), new_chip.n_user_processors) self.assertEqual(len(users), len(set(new_chip.user_processors_ids))) - monitors = set(new_chip.monitor_processors) + monitors = set(new_chip.scamp_processors) self.assertEqual(users.union(monitors), all_p) self.assertEqual(len(monitors), - len(set(new_chip.monitor_processors_ids))) + len(set(new_chip.scamp_processors_ids))) if __name__ == '__main__': diff --git a/unittests/test_json_machine.py b/unittests/test_json_machine.py index b423f87c..3485c5d8 100644 --- a/unittests/test_json_machine.py +++ b/unittests/test_json_machine.py @@ -64,9 +64,9 @@ def test_monitor_exceptions(self): chip02 = vm[0, 2] # Hack in an extra monitor users = dict(chip02._user_processors) - monitors = dict(chip02._monitor_processors) + monitors = dict(chip02._scamp_processors) monitors[1] = users.pop(1) - chip02._monitor_processors = monitors + chip02._scamp_processors = monitors chip02._user_processors = users jpath = mktemp("json") # Should still be able to write json even with more than one monitor diff --git a/unittests/test_virtual_machine.py b/unittests/test_virtual_machine.py index 936b3324..247689a5 100644 --- a/unittests/test_virtual_machine.py +++ b/unittests/test_virtual_machine.py @@ -179,7 +179,7 @@ def test_new_vm_with_max_cores(self): self.assertEqual(n_cpus - 1, _chip.n_user_processors) self.assertEqual(1, _chip.n_monitor_processors) self.assertEqual(n_cpus - 1, len(list(_chip.user_processors))) - self.assertEqual(1, len(list(_chip.monitor_processors))) + self.assertEqual(1, len(list(_chip.scamp_processors))) count = sum(_chip.n_processors for _chip in vm.chips) self.assertEqual(count, 4 * n_cpus) From 5d25dca5625e425328410ba45f491355f8ad9cf8 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 7 Mar 2024 05:57:14 +0000 Subject: [PATCH 3/6] rename chip user processor(s) chip placable processor(s) --- spinn_machine/chip.py | 44 +++++++++++++++---------------- spinn_machine/json_machine.py | 12 ++++----- spinn_machine/machine.py | 2 +- unittests/test_chip.py | 8 +++--- unittests/test_json_machine.py | 4 +-- unittests/test_machine.py | 4 +-- unittests/test_virtual_machine.py | 4 +-- 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/spinn_machine/chip.py b/spinn_machine/chip.py index 4a6b916b..ecf03eea 100644 --- a/spinn_machine/chip.py +++ b/spinn_machine/chip.py @@ -42,7 +42,7 @@ class Chip(object): __slots__ = ( "_x", "_y", "_router", "_sdram", "_ip_address", "_tag_ids", "_nearest_ethernet_x", "_nearest_ethernet_y", - "_user_processors", "_scamp_processors", "_parent_link", + "_placable_processors", "_scamp_processors", "_parent_link", "_v_to_p_map" ) @@ -89,7 +89,7 @@ def __init__(self, x: int, y: int, n_processors: int, router: Router, self._x = x self._y = y self._scamp_processors = self.__generate_scamp() - self._user_processors = self.__generate_processors( + self._placable_processors = self.__generate_processors( n_processors, down_cores) self._router = router self._sdram = sdram @@ -150,7 +150,7 @@ def is_processor_with_id(self, processor_id: int) -> bool: :return: Whether the processor with the given ID exists :rtype: bool """ - if processor_id in self._user_processors: + if processor_id in self._placable_processors: return True return processor_id in self._scamp_processors @@ -165,8 +165,8 @@ def get_processor_with_id(self, processor_id: int) -> Optional[Processor]: or ``None`` if no such processor :rtype: Processor or None """ - if processor_id in self._user_processors: - return self._user_processors[processor_id] + if processor_id in self._placable_processors: + return self._placable_processors[processor_id] return self._scamp_processors.get(processor_id) @property @@ -205,7 +205,7 @@ def processors(self) -> Iterator[Processor]: :rtype: iterable(Processor) """ yield from self._scamp_processors.values() - yield from self._user_processors.values() + yield from self._placable_processors.values() @property def all_processor_ids(self) -> Iterator[int]: @@ -215,7 +215,7 @@ def all_processor_ids(self) -> Iterator[int]: :rtype: iterable(int) """ yield from self._scamp_processors.keys() - yield from self._user_processors.keys() + yield from self._placable_processors.keys() @property def n_processors(self) -> int: @@ -224,34 +224,34 @@ def n_processors(self) -> int: :rtype: int """ - return len(self._scamp_processors) + len(self._user_processors) + return len(self._scamp_processors) + len(self._placable_processors) @property - def user_processors(self) -> Iterator[Processor]: + def placeable_processors(self) -> Iterator[Processor]: """ - An iterable of available user processors. + An iterable of available placable/ none scamp processors. :rtype: iterable(Processor) """ - yield from self._user_processors.values() + yield from self._placable_processors.values() @property - def user_processors_ids(self) -> Iterator[int]: + def placable_processors_ids(self) -> Iterator[int]: """ - An iterable of available user processors. + An iterable of available placable/ non scamp processor ids. :rtype: iterable(Processor) """ - yield from self._user_processors + yield from self._placable_processors @property - def n_user_processors(self) -> int: + def n_placable_processors(self) -> int: """ - The total number of processors that are not used by scamp. + The total number of processors that are placable / not used by scamp. :rtype: int """ - return len(self._user_processors) + return len(self._placable_processors) @property def scamp_processors(self) -> Iterator[Processor]: @@ -342,7 +342,7 @@ def get_first_none_monitor_processor(self) -> Processor: :rtype: Processor ;raises StopIteration: If there is no user processor """ - return next(iter(self._user_processors.values())) + return next(iter(self._placable_processors.values())) @property def parent_link(self) -> Optional[int]: @@ -390,7 +390,7 @@ def __iter__(self) -> Iterator[Tuple[int, Processor]]: :rtype: iterable(tuple(int,Processor)) """ yield from self._scamp_processors.items() - yield from self._user_processors.items() + yield from self._placable_processors.items() def __len__(self) -> int: """ @@ -399,11 +399,11 @@ def __len__(self) -> int: :return: The number of items in the underlying iterator. :rtype: int """ - return len(self._scamp_processors) + len(self._user_processors) + return len(self._scamp_processors) + len(self._placable_processors) def __getitem__(self, processor_id: int) -> Processor: - if processor_id in self._user_processors: - return self._user_processors[processor_id] + if processor_id in self._placable_processors: + return self._placable_processors[processor_id] if processor_id in self._scamp_processors: return self._scamp_processors[processor_id] # Note difference from get_processor_with_id(); this is to conform to diff --git a/spinn_machine/json_machine.py b/spinn_machine/json_machine.py index e0d34c9e..122b7705 100644 --- a/spinn_machine/json_machine.py +++ b/spinn_machine/json_machine.py @@ -204,9 +204,9 @@ def _describe_chip(chip: Chip, standard, ethernet) -> JsonArray: if chip.ip_address is not None: details['ipAddress'] = chip.ip_address # Write the Resources ONLY if different from the e_values - if (chip.n_processors - chip.n_user_processors) != ethernet.monitors: + if (chip.n_processors - chip.n_placable_processors) != ethernet.monitors: exceptions["monitors"] = \ - chip.n_processors - chip.n_user_processors + chip.n_processors - chip.n_placable_processors if router_entries != ethernet.router_entries: exceptions["routerEntries"] = router_entries if chip.sdram != ethernet.sdram: @@ -215,9 +215,9 @@ def _describe_chip(chip: Chip, standard, ethernet) -> JsonArray: exceptions["tags"] = tags else: # Write the Resources ONLY if different from the s_values - if (chip.n_processors - chip.n_user_processors) != standard.monitors: + if (chip.n_processors - chip.n_placable_processors) != standard.monitors: exceptions["monitors"] = \ - chip.n_processors - chip.n_user_processors + chip.n_processors - chip.n_placable_processors if router_entries != standard.router_entries: exceptions["routerEntries"] = router_entries if chip.sdram != standard.sdram: @@ -243,7 +243,7 @@ def to_json() -> JsonObject: for chip in machine.chips: if chip.ip_address is None: std = _Desc( - monitors=chip.n_processors - chip.n_user_processors, + monitors=chip.n_processors - chip.n_placable_processors, router_entries=_int_value( chip.router.n_available_multicast_entries), sdram=chip.sdram, @@ -255,7 +255,7 @@ def to_json() -> JsonObject: # find the nth values to use for Ethernet chips chip = machine.boot_chip eth = _Desc( - monitors=chip.n_processors - chip.n_user_processors, + monitors=chip.n_processors - chip.n_placable_processors, router_entries=_int_value( chip.router.n_available_multicast_entries), sdram=chip.sdram, diff --git a/spinn_machine/machine.py b/spinn_machine/machine.py index 167616cf..1ca54375 100644 --- a/spinn_machine/machine.py +++ b/spinn_machine/machine.py @@ -1084,7 +1084,7 @@ def total_available_user_cores(self) -> int: :rtype: int """ - return sum(chip.n_user_processors for chip in self.chips) + return sum(chip.n_placable_processors for chip in self.chips) @property def total_cores(self) -> int: diff --git a/unittests/test_chip.py b/unittests/test_chip.py index a3a34d3f..62a9980d 100644 --- a/unittests/test_chip.py +++ b/unittests/test_chip.py @@ -53,7 +53,7 @@ def test_create_chip(self): self.assertEqual(new_chip.ip_address, self._ip) self.assertEqual(new_chip.sdram, self._sdram) self.assertEqual(new_chip.router, self._router) - self.assertEqual(new_chip.n_user_processors, self.n_processors - 1) + self.assertEqual(new_chip.n_placable_processors, self.n_processors - 1) with self.assertRaises(KeyError): self.assertIsNone(new_chip[42]) print(new_chip.__repr__()) @@ -117,9 +117,9 @@ def test_processors(self): for id in new_chip.all_processor_ids: all_p.add(new_chip[id]) self.assertEqual(len(all_p), new_chip.n_processors) - users = set(new_chip.user_processors) - self.assertEqual(len(users), new_chip.n_user_processors) - self.assertEqual(len(users), len(set(new_chip.user_processors_ids))) + users = set(new_chip.placeable_processors) + self.assertEqual(len(users), new_chip.n_placable_processors) + self.assertEqual(len(users), len(set(new_chip.placable_processors_ids))) monitors = set(new_chip.scamp_processors) self.assertEqual(users.union(monitors), all_p) self.assertEqual(len(monitors), diff --git a/unittests/test_json_machine.py b/unittests/test_json_machine.py index 3485c5d8..0b140ec5 100644 --- a/unittests/test_json_machine.py +++ b/unittests/test_json_machine.py @@ -63,11 +63,11 @@ def test_monitor_exceptions(self): MachineDataWriter.mock().set_machine(vm) chip02 = vm[0, 2] # Hack in an extra monitor - users = dict(chip02._user_processors) + users = dict(chip02._placable_processors) monitors = dict(chip02._scamp_processors) monitors[1] = users.pop(1) chip02._scamp_processors = monitors - chip02._user_processors = users + chip02._placable_processors = users jpath = mktemp("json") # Should still be able to write json even with more than one monitor to_json_path(jpath) diff --git a/unittests/test_machine.py b/unittests/test_machine.py index a58ded1d..b5415a5e 100644 --- a/unittests/test_machine.py +++ b/unittests/test_machine.py @@ -390,8 +390,8 @@ def test_too_few_cores(self): machine = virtual_machine(8, 8) # Hack to get n_processors return a low number chip01 = machine.get_chip_at(0, 1) - chip01._user_processors = dict( - list(chip01._user_processors.items())[:2]) + chip01._placable_processors = dict( + list(chip01._placable_processors.items())[:2]) with self.assertRaises(SpinnMachineException): machine.validate() diff --git a/unittests/test_virtual_machine.py b/unittests/test_virtual_machine.py index 247689a5..36b3b3ec 100644 --- a/unittests/test_virtual_machine.py +++ b/unittests/test_virtual_machine.py @@ -176,9 +176,9 @@ def test_new_vm_with_max_cores(self): vm = virtual_machine(2, 2, validate=True) _chip = vm[1, 1] self.assertEqual(n_cpus, _chip.n_processors) - self.assertEqual(n_cpus - 1, _chip.n_user_processors) + self.assertEqual(n_cpus - 1, _chip.n_placable_processors) self.assertEqual(1, _chip.n_monitor_processors) - self.assertEqual(n_cpus - 1, len(list(_chip.user_processors))) + self.assertEqual(n_cpus - 1, len(list(_chip.placeable_processors))) self.assertEqual(1, len(list(_chip.scamp_processors))) count = sum(_chip.n_processors for _chip in vm.chips) self.assertEqual(count, 4 * n_cpus) From 73e5557f92bcc8ce7385c6dcbf76890b5670ad6c Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 7 Mar 2024 05:57:58 +0000 Subject: [PATCH 4/6] rename monitor processor to scamp processors --- spinn_machine/chip.py | 2 +- unittests/test_virtual_machine.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spinn_machine/chip.py b/spinn_machine/chip.py index ecf03eea..2585db9b 100644 --- a/spinn_machine/chip.py +++ b/spinn_machine/chip.py @@ -272,7 +272,7 @@ def scamp_processors_ids(self) -> Iterator[int]: yield from self._scamp_processors @property - def n_monitor_processors(self) -> int: + def n_scamp_processors(self) -> int: """ The total number of processors that are used by scamp. diff --git a/unittests/test_virtual_machine.py b/unittests/test_virtual_machine.py index 36b3b3ec..0587ee68 100644 --- a/unittests/test_virtual_machine.py +++ b/unittests/test_virtual_machine.py @@ -177,7 +177,7 @@ def test_new_vm_with_max_cores(self): _chip = vm[1, 1] self.assertEqual(n_cpus, _chip.n_processors) self.assertEqual(n_cpus - 1, _chip.n_placable_processors) - self.assertEqual(1, _chip.n_monitor_processors) + self.assertEqual(1, _chip.n_scamp_processors) self.assertEqual(n_cpus - 1, len(list(_chip.placeable_processors))) self.assertEqual(1, len(list(_chip.scamp_processors))) count = sum(_chip.n_processors for _chip in vm.chips) From 58b7d19a91997a16841f8e63ad1aabe8290ad583 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 7 Mar 2024 06:27:22 +0000 Subject: [PATCH 5/6] use chip.n_scamp_processors --- spinn_machine/json_machine.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spinn_machine/json_machine.py b/spinn_machine/json_machine.py index 122b7705..9bde816b 100644 --- a/spinn_machine/json_machine.py +++ b/spinn_machine/json_machine.py @@ -204,9 +204,8 @@ def _describe_chip(chip: Chip, standard, ethernet) -> JsonArray: if chip.ip_address is not None: details['ipAddress'] = chip.ip_address # Write the Resources ONLY if different from the e_values - if (chip.n_processors - chip.n_placable_processors) != ethernet.monitors: - exceptions["monitors"] = \ - chip.n_processors - chip.n_placable_processors + if (chip.n_scamp_processors) != ethernet.monitors: + exceptions["monitors"] = chip.n_scamp_processors if router_entries != ethernet.router_entries: exceptions["routerEntries"] = router_entries if chip.sdram != ethernet.sdram: @@ -215,9 +214,8 @@ def _describe_chip(chip: Chip, standard, ethernet) -> JsonArray: exceptions["tags"] = tags else: # Write the Resources ONLY if different from the s_values - if (chip.n_processors - chip.n_placable_processors) != standard.monitors: - exceptions["monitors"] = \ - chip.n_processors - chip.n_placable_processors + if (chip.n_scamp_processors) != standard.monitors: + exceptions["monitors"] = chip.n_scamp_processors if router_entries != standard.router_entries: exceptions["routerEntries"] = router_entries if chip.sdram != standard.sdram: From ad983420b1ce5a109c966375d000adf96e2420bb Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Thu, 7 Mar 2024 06:31:51 +0000 Subject: [PATCH 6/6] flake8 --- unittests/test_chip.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/unittests/test_chip.py b/unittests/test_chip.py index 62a9980d..105eadfd 100644 --- a/unittests/test_chip.py +++ b/unittests/test_chip.py @@ -119,7 +119,8 @@ def test_processors(self): self.assertEqual(len(all_p), new_chip.n_processors) users = set(new_chip.placeable_processors) self.assertEqual(len(users), new_chip.n_placable_processors) - self.assertEqual(len(users), len(set(new_chip.placable_processors_ids))) + self.assertEqual(len(users), + len(set(new_chip.placable_processors_ids))) monitors = set(new_chip.scamp_processors) self.assertEqual(users.union(monitors), all_p) self.assertEqual(len(monitors),