pacman.operations.router_compressors package¶
Subpackages¶
Submodules¶
pacman.operations.router_compressors.routing_compression_checker module¶
-
pacman.operations.router_compressors.routing_compression_checker.
calc_remainders
(o_code, c_code)[source]¶ Parameters: Return type:
-
pacman.operations.router_compressors.routing_compression_checker.
codify
(route, length=32)[source]¶ This method discovers all the routing keys covered by this route.
Starts of with the assumption that the key is always covered.
Whenever a mask bit is zero the list of covered keys is doubled to include both the key with a zero and a one at that place.
Parameters: - route (MulticastRoutingEntry) – single routing Entry
- length (int) – length in bits of the key and mask (defaults to 32)
Returns: set of routing_keys covered by this route
Return type:
-
pacman.operations.router_compressors.routing_compression_checker.
codify_table
(table, length=32)[source]¶ Parameters: - table (MulticastRoutingTable) –
- length (int) –
Return type:
-
pacman.operations.router_compressors.routing_compression_checker.
compare_route
(o_route, compressed_dict, o_code=None, start=0, f=None)[source]¶ Parameters: - o_route (MulticastRoutingEntry) – the original route
- compressed_dict (dict) –
- o_code (str) –
- start (int) –
- f (FileIO) –
-
pacman.operations.router_compressors.routing_compression_checker.
compare_tables
(original, compressed)[source]¶ Compares the two tables without generating any output.
Parameters: - original (MulticastRoutingTable) – The original routing tables
- compressed (MulticastRoutingTable) – The compressed routing tables. Which will be considered in order.
Raises: PacmanRoutingException if there is any error
Module contents¶
-
class
pacman.operations.router_compressors.
AbstractCompressor
(ordered=True, accept_overflow=False)¶ Bases:
object
-
compress_table
(router_table)[source]¶ Parameters: router_table (UnCompressedMulticastRoutingTable) – Original routing table for a single chip Returns: Raw compressed routing table entries for the same chip Return type: list(Entry)
-
compress_tables
(router_tables, progress)[source]¶ Compress all the unordered routing tables.
Tables who start of smaller than global_target are not compressed
Parameters: - router_tables (MulticastRoutingTables) – Routing tables
- progress (ProgressBar) – Progress bar to show while working
Returns: The compressed but still unordered routing tables
Return type: Raises: MinimisationFailedError – on failure
-
-
class
pacman.operations.router_compressors.
Entry
(key, mask, defaultable, spinnaker_route)¶ Bases:
object
Parameters: -
defaultable
¶
-
static
from_MulticastRoutingEntry
(mre)[source]¶ Parameters: mre (MulticastRoutingEntry) – Return type: Entry
-
key
¶
-
mask
¶
-
spinnaker_route
¶
-
to_MulticastRoutingEntry
()[source]¶ Return type: MulticastRoutingEntry
-
-
pacman.operations.router_compressors.
pair_compressor
(ordered=True, accept_overflow=False, verify=False)¶ Parameters: Return type:
-
class
pacman.operations.router_compressors.
RangeCompressor
¶ Bases:
object
-
compress_table
(uncompressed)[source]¶ Compresses all the entries for a single table.
Compressed the entries for this unordered table returning a new table with possibly fewer entries
Parameters: uncompressed (UnCompressedMulticastRoutingTable) – Original Routing table for a single chip Returns: Compressed routing table for the same chip Return type: list(Entry)
-
-
pacman.operations.router_compressors.
range_compressor
(accept_overflow=True)¶ Parameters: - router_tables (MulticastRoutingTables) –
- accept_overflow (bool) – A flag which should only be used in testing to stop raising an exception if result is too big
Return type: