Skip to content

Commit 6aa243c

Browse files
authored
Merge branch 'master' into list_map
2 parents 0b3d1b7 + a21543a commit 6aa243c

2 files changed

Lines changed: 24 additions & 51 deletions

File tree

fec_integration_tests/interface/interface_functions/test_database_interface.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
from pacman.model.resources import ConstantSDRAM
2727
from pacman.model.placements import Placements, Placement
2828
from pacman.model.routing_info import (
29-
RoutingInfo, MachineVertexRoutingInfo, AppVertexRoutingInfo)
30-
from pacman.model.routing_info.base_key_and_mask import BaseKeyAndMask
29+
RoutingInfo,
30+
GlobalAppVertexRoutingInfo, GlobalMachineVertexRoutingInfo, BaseKeyAndMask)
3131
from pacman.model.tags.tags import Tags
3232
from pacman.model.partitioner_splitters import AbstractSplitterCommon
3333
from pacman.model.graphs.common.slice import Slice
@@ -106,14 +106,15 @@ def _add_rinfo(
106106
app_vertex: ApplicationVertex, partition_id: str,
107107
routing_info: RoutingInfo, base_key: int, app_mask: int, mac_mask: int,
108108
m_vertex_shift: int) -> None:
109-
routing_info.add_routing_info(AppVertexRoutingInfo(
110-
BaseKeyAndMask(base_key, app_mask), partition_id, app_vertex,
111-
mac_mask, 1, 1))
109+
bkma = BaseKeyAndMask(base_key, app_mask)
110+
routing_info.add_routing_info(GlobalAppVertexRoutingInfo(
111+
bkma, partition_id, app_vertex, len(app_vertex.machine_vertices),
112+
mac_mask))
112113
for i, m_vertex in enumerate(app_vertex.machine_vertices):
113-
routing_info.add_routing_info(MachineVertexRoutingInfo(
114-
BaseKeyAndMask(
115-
base_key | i << m_vertex_shift, app_mask | mac_mask),
116-
partition_id, m_vertex, i))
114+
m_key = base_key | i << m_vertex_shift
115+
bkmm = BaseKeyAndMask(m_key, app_mask | mac_mask)
116+
routing_info.add_routing_info(GlobalMachineVertexRoutingInfo(
117+
bkmm, partition_id, m_vertex, i, app_mask))
117118

118119

119120
def _place_vertices(app_vertexes: List[ApplicationVertex],

spinn_front_end_common/interface/abstract_spinnaker_base.py

Lines changed: 14 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
from pacman.operations.router_compressors.ordered_covering_router_compressor \
7777
import ordered_covering_compressor
7878
from pacman.operations.routing_info_allocator_algorithms.\
79-
zoned_routing_info_allocator import (flexible_allocate, global_allocate)
79+
zoned_routing_info_allocator import ZonedRoutingInfoAllocator
8080
from pacman.operations.routing_table_generators import (
8181
basic_routing_table_generator, merged_routing_table_generator)
8282
from pacman.operations.tag_allocator_algorithms import basic_tag_allocator
@@ -1017,41 +1017,7 @@ def _report_tag_allocations(self) -> None:
10171017
tag_allocator_report()
10181018

10191019
@final
1020-
def _execute_global_allocate(
1021-
self, extra_allocations: Iterable[
1022-
Tuple[ApplicationVertex, str]]) -> None:
1023-
"""
1024-
Runs, times and logs the Global Zoned Routing Info Allocator.
1025-
1026-
Sets "routing_info" is called
1027-
1028-
.. note::
1029-
Calling of this method is based on the configuration
1030-
info_allocator value
1031-
"""
1032-
with FecTimer("Global allocate", TimerWork.OTHER):
1033-
self._data_writer.set_routing_infos(
1034-
global_allocate(extra_allocations))
1035-
1036-
@final
1037-
def _execute_flexible_allocate(
1038-
self, extra_allocations: Iterable[
1039-
Tuple[ApplicationVertex, str]]) -> None:
1040-
"""
1041-
Runs, times and logs the Zoned Routing Info Allocator.
1042-
1043-
Sets "routing_info" is called
1044-
1045-
.. note::
1046-
Calling of this method is based on the configuration
1047-
info_allocator value
1048-
"""
1049-
with FecTimer("Zoned routing info allocator", TimerWork.OTHER):
1050-
self._data_writer.set_routing_infos(
1051-
flexible_allocate(extra_allocations))
1052-
1053-
@final
1054-
def _do_info_allocator(self) -> None:
1020+
def _execute_info_allocator(self) -> None:
10551021
"""
10561022
Runs, times and logs one of the info allocators.
10571023
@@ -1067,14 +1033,20 @@ def _do_info_allocator(self) -> None:
10671033
"""
10681034
name = get_config_str("Mapping", "info_allocator")
10691035
if name == "GlobalZonedRoutingInfoAllocator":
1070-
return self._execute_global_allocate([])
1036+
logger.warning("GlobalZonedRoutingInfoAllocator is deprecated. "
1037+
"Please change cfg Mapping info_allocator to "
1038+
"ZonedRoutingInfoAllocator")
1039+
name = "ZonedRoutingInfoAllocator"
10711040
if name == "ZonedRoutingInfoAllocator":
1072-
return self._execute_flexible_allocate([])
1073-
if "," in name:
1041+
with FecTimer("Zoned routing info allocator", TimerWork.OTHER):
1042+
self._data_writer.set_routing_infos(
1043+
ZonedRoutingInfoAllocator().allocate())
1044+
elif "," in name:
10741045
raise ConfigurationException(
10751046
"Only a single algorithm is supported for info_allocator")
1076-
raise ConfigurationException(
1077-
f"Unexpected cfg setting info_allocator: {name}")
1047+
else:
1048+
raise ConfigurationException(
1049+
f"Unexpected cfg setting info_allocator: {name}")
10781050

10791051
def _report_router_info(self) -> None:
10801052
"""
@@ -1280,7 +1252,7 @@ def _stage_mapping(self, total_run_time: Optional[float],
12801252
self._execute_basic_tag_allocator()
12811253
self._report_tag_allocations()
12821254

1283-
self._do_info_allocator()
1255+
self._execute_info_allocator()
12841256
self._report_router_info()
12851257
self._do_routing_table_generator()
12861258
self._report_uncompressed_routing_table()

0 commit comments

Comments
 (0)