pacman.operations.router_algorithms package

Submodules

pacman.operations.router_algorithms.routing_tree module

An explicit representation of a routing tree in a machine.

This representation of a route explicitly describes a tree-structure and the complete path taken by a route. This is used during place and route in preference to a set of RoutingTableEntry tuples since it is more easily verified and more accurately represents the problem at hand.

Based on https://github.com/project-rig/rig/blob/master/rig/place_and_route/routing_tree.py

class pacman.operations.router_algorithms.routing_tree.RoutingTree(chip)[source]

Bases: object

Explicitly defines a multicast route through a SpiNNaker machine.

Each instance represents a single hop in a route and recursively refers to following steps.

Parameters:chip (tuple(int,int)) – The chip the route is currently passing through.
append_child(child)[source]
Parameters:child (RoutingTree or MachineVertex) –
children

A iterable of the next steps in the route represented by a (route, object) tuple.

Note

Up until Rig 1.5.1, this structure used sets to store children. This was changed to lists since sets incur a large memory overhead and in practice the set-like behaviour of the list of children is not useful.

The object indicates the intended destination of this step in the route. It may be one of:

  • RoutingTree representing the continuation of the routing tree after following a given link.
  • A vertex (i.e. some other Python object) when the route terminates at the supplied vertex. Note that the direction may be None and so additional logic may be required to determine what core to target to reach the vertex.
Return type:iterable(RoutingTree or MachineVertex)
chip

The chip the route is currently passing through.

Return type:tuple(int,int)
remove_child(child)[source]
Parameters:child (RoutingTree or MachineVertex) –
traverse()[source]

Traverse the tree yielding the direction taken to a node, the coordinates of that node and the directions leading from the Node.

Returns:(direction, (x, y), set(route)) Direction taken to reach a Node in the tree, the (x, y) coordinate of that Node and routes leading to children of the Node.
Return type:iterable(tuple(int, tuple(int,int), set(int)))

Module contents

class pacman.operations.router_algorithms.BasicDijkstraRouting[source]

Bases: object

An routing algorithm that can find routes for edges between vertices in a machine graph that have been placed on a machine by the use of a Dijkstra shortest path algorithm.

BW_PER_ROUTE_ENTRY = 0.01
MAX_BW = 250
__call__(placements, machine, machine_graph, bw_per_route_entry=0.01, max_bw=250, use_progress_bar=True)[source]
Find routes between the edges with the allocated information,
placed in the given places
Parameters:
  • placements (Placements) – The placements of the edges
  • machine (Machine) – The machine through which the routes are to be found
  • machine_graph (MachineGraph) – the machine_graph object
  • use_progress_bar (bool) – whether to show a progress bar
Returns:

The discovered routes

Return type:

MulticastRoutingTables

Raises:

PacmanRoutingException – If something goes wrong with the routing

class pacman.operations.router_algorithms.NerRoute[source]

Bases: object

Performs routing using rig algorithm

__call__(machine_graph, machine, placements)[source]

basic ner router

Parameters:
Returns:

a routing table by partition

Return type:

MulticastRoutingTableByPartition

class pacman.operations.router_algorithms.NerRouteTrafficAware[source]

Bases: object

Performs routing with traffic awareness

__call__(machine_graph, machine, placements)[source]

traffic-aware ner router

Parameters:
Returns:

a routing table by partition

Return type:

MulticastRoutingTableByPartition