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:
  • o_code (str) –

  • c_code (str) –

Return type:

list(str)

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:

str

pacman.operations.router_compressors.routing_compression_checker.codify_table(table, length=32)[source]
Parameters:
  • table (MulticastRoutingTable) –

  • length (int) –

Return type:

dict(str, MulticastRoutingEntry)

pacman.operations.router_compressors.routing_compression_checker.compare_route(o_route, compressed_dict, o_code=None, start=0, f=None)[source]
Parameters:
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

pacman.operations.router_compressors.routing_compression_checker.covers(o_code, c_code)[source]
Parameters:
  • o_code (str) –

  • c_code (str) –

Return type:

bool

Module contents

class pacman.operations.router_compressors.AbstractCompressor(ordered=True, accept_overflow=False)[source]

Bases: object

abstract 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 target_length are not compressed

Parameters:
Returns:

The compressed but still unordered routing tables

Return type:

MulticastRoutingTables

Raises:

MinimisationFailedError – on failure

class pacman.operations.router_compressors.Entry(key, mask, defaultable, spinnaker_route)[source]

Bases: object

Parameters:
  • key (int) –

  • mask (int) –

  • defaultable (bool) –

  • spinnaker_route (int) –

defaultable
static from_MulticastRoutingEntry(mre)[source]
Parameters:

mre (MulticastRoutingEntry) –

Return type:

Entry

key
mask
spinnaker_route
to_MulticastRoutingEntry()[source]
Return type:

MulticastRoutingEntry

class pacman.operations.router_compressors.RangeCompressor[source]

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)

static cut_off(key, power)[source]
static next_power(number)[source]
pacman.operations.router_compressors.pair_compressor(ordered=True, accept_overflow=False, verify=False)[source]
Parameters:
  • accept_overflow (bool) – A flag which should only be used in testing to stop raising an exception if result is too big

  • verify (bool) – If set to true will verify the length before returning

Return type:

MulticastRoutingTables

pacman.operations.router_compressors.range_compressor(accept_overflow=True)[source]
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:

MulticastRoutingTables