pacman.model.routing_table_by_partition package

Module contents

class pacman.model.routing_table_by_partition.MulticastRoutingTableByPartition

Bases: object

A set of multicast routing path objects.

add_path_entry(entry: MulticastRoutingTableByPartitionEntry, router_x: int, router_y: int, source_vertex: AbstractVertex, partition_id: str)[source]

Adds a multicast routing path entry.

Parameters:
get_entries_for_router(router_x: int, router_y: int) Dict[Tuple[AbstractVertex, str], MulticastRoutingTableByPartitionEntry] | None[source]

Get the set of multicast path entries assigned to this router.

Parameters:
  • router_x (int) – the X coordinate of the router

  • router_y (int) – the Y coordinate of the router

Returns:

all router_path_entries for the router.

Return type:

dict(tuple((ApplicationVertex or MachineVertex), str), MulticastRoutingTableByPartitionEntry)

get_entry_on_coords_for_edge(source_vertex: AbstractVertex, partition_id: str, router_x: int, router_y: int) MulticastRoutingTableByPartitionEntry | None[source]

Get an entry from a specific coordinate.

Parameters:
Return type:

MulticastRoutingTableByPartitionEntry or None

get_routers() Iterator[Tuple[int, int]][source]

Get the coordinates of all stored routers.

Return type:

iterable(tuple(int, int))

property n_routers: int

The number of routers stored.

Return type:

int

class pacman.model.routing_table_by_partition.MulticastRoutingTableByPartitionEntry(out_going_links: int | Iterable[int] | None, outgoing_processors: int | Iterable[int] | None, incoming_processor: int | None = None, incoming_link: int | None = None)

Bases: object

An entry in a path of a multicast route.

Parameters:
  • out_going_links (int or iterable(int) or None) – the edges this path entry goes down, each of which is between 0 and 5

  • outgoing_processors (int or iterable(int) or None) – the processors this path entry goes to, each of which is between 0 and 17

  • incoming_processor (int) – the direction this entry came from (between 0 and 17)

  • incoming_link (int) – the direction this entry came from in link (between 0 and 5)

Raises:

PacmanInvalidParameterException

property defaultable: bool

The defaultable status of the entry.

Return type:

bool

has_same_route(entry: MulticastRoutingTableByPartitionEntry) bool[source]

Checks if the two Entries have the same routes after applying mask

Parameters:

entry (MulticastRoutingTableByPartitionEntry) –

Return type:

bool

The source link for this path entry.

Return type:

int or None

property incoming_processor: int | None

The source processor.

Return type:

int or None

The destination links of the entry.

Return type:

frozenset(int)

merge_entry(other: MulticastRoutingTableByPartitionEntry) MulticastRoutingTableByPartitionEntry[source]

Merges the another entry with this one and returns a new MulticastRoutingTableByPartitionEntry

Parameters:

other (MulticastRoutingTableByPartitionEntry) – the entry to merge into this one

Returns:

a merged MulticastRoutingTableByPartitionEntry

Raises:

PacmanInvalidParameterException

property processor_ids: FrozenSet[int]

The destination processors of the entry.

Return type:

frozenset(int)

property spinnaker_route: int

The masked routes

Return type:

int