# pacman.operations.routing_info_allocator_algorithms package¶

## Module contents¶

class pacman.operations.routing_info_allocator_algorithms.MallocBasedRoutingInfoAllocator[source]

A Routing Info Allocation Allocator algorithm that keeps track of free keys and attempts to allocate them as requested.

__call__(machine_graph, n_keys_map)[source]
Parameters: machine_graph (MachineGraph) – n_keys_map (AbstractMachinePartitionNKeysMap) – RoutingInfo
class pacman.operations.routing_info_allocator_algorithms.ZonedRoutingInfoAllocator[source]

Bases: object

A routing key allocator that uses fixed zones that are the same for all vertices. This will hopefully make the keys more compressible.

Keys will have the format:

      <--- 32 bits --->
Key:  | A | P | M | X |
Mask: |11111111111|   | (i.e. 1s covering A, P and M fields)

Field A:
The index of the application vertex.
Field P:
The index of the name of outgoing edge partition of the vertex.
Field M:
The index of the machine vertex of the application vertex.
Field X:
Space for the maximum number of keys required by any outgoing edge partition.

The A and P are combined into a single index (AP) so that applications with multiple partitions use multiple entries while ones with only 1 use just one.

The split between the AP bit and other parts is always fixed This also means that all machine vertices of the same application vertex and partition will have a shared key.

The split between the M and X may vary depending on how the allocator is called.

In “global” mode the widths of the fields are predetermined and fixed such that every key will have every field in the same place in the key, and the mask is the same for every vertex. The global approach is particularly sensitive to the one large and many small vertices limit.

In “flexible” mode the size of the M and X will change for each application/partition. Every vertex for a application/partition pair but different pairs may have different masks. This should result in less gaps between the machine vertexes. Even in none Flexible mode if the sizes are too big to keep M and X the same size they will be allowed to change for those vertexes will a very high number of atoms.

__call__(machine_graph, n_keys_map, flexible)[source]
Parameters: machine_graph (MachineGraph) – The machine graph to allocate the routing info for n_keys_map (AbstractMachinePartitionNKeysMap) – A map between the edges and the number of keys required by the edges flexible (bool) – Determines if flexible can be use. If False, global settings will be attempted The routing information RoutingInfo PacmanRouteInfoAllocationException – If something goes wrong with the allocation