Skip to content

Commit

Permalink
Also account for the partition here
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Aug 23, 2024
1 parent 9ba6193 commit d1b71cc
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions pacman/operations/router_algorithms/application_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,10 @@ def route_application_graph() -> MulticastRoutingTableByPartition:

source_xy = next(iter(source_mappings.keys()))
# Get all source chips coordinates
all_source_xys = _get_all_xys(source)
all_source_xys = {
vertex_xy(m_vertex)
for m_vertex in source.splitter.get_out_going_vertices(
partition.identifier)}

# Keep track of the source edge chips
source_edge_xys: Set[XY] = set()
Expand Down Expand Up @@ -234,8 +237,8 @@ def route_application_graph() -> MulticastRoutingTableByPartition:
_route_source_to_source(source, partition, targets, self_xys)

# Deal with internal multicast partitions
internal = _get_filtered_internal_partitions(
source, partition.identifier)
internal = list(_get_filtered_internal_partitions(
source, partition.identifier))
if internal:
self_connected = True
_route_internal(internal, targets, self_xys)
Expand Down Expand Up @@ -320,7 +323,8 @@ def _route_source_to_target(
overlaps = None
else:
# Find all coordinates for chips (xy) that are in the target
target_xys = _get_all_xys(target)
target_xys = {vertex_xy(m_vertex)
for m_vertex, _srcs in target_vertices}

# Pick one to actually use as a target
target_xy, overlaps = _find_target_xy(
Expand Down Expand Up @@ -642,18 +646,6 @@ def _get_outgoing_mapping(
return outgoing_mapping


def _get_all_xys(app_vertex: ApplicationVertex) -> Set[XY]:
"""
Gets the list of all the x,y coordinates that the vertex's machine vertices
are placed on.
:param ApplicationVertex app_vertex:
:rtype: set(tuple(int, int))
"""
return {vertex_xy(m_vertex)
for m_vertex in app_vertex.machine_vertices}


def _route_to_xys(
first_xy: XY, all_xys: Set[XY], machine: Machine,
routes: Dict[XY, RoutingTree], targets: Iterable[XY], label: str):
Expand Down

0 comments on commit d1b71cc

Please sign in to comment.