pacman.model.routing_info package¶
Submodules¶
pacman.model.routing_info.vertex_routing_info module¶
- class pacman.model.routing_info.vertex_routing_info.VertexRoutingInfo(key_and_mask, partition_id)[source]¶
Bases:
object
Associates a partition identifier to its routing information (keys and masks).
- Parameters:
keys_and_masks (iterable(BaseKeyAndMask)) – The keys allocated to the machine partition
partition_id (str) – The partition to set the keys for
machine_vertex (MachineVertex) – The vertex to set the keys for
index (int) – The index of the machine vertex
- property key_and_mask¶
The only key and mask.
- Return type:
- abstract property vertex¶
The vertex of the information.
- Return type:
Module contents¶
- class pacman.model.routing_info.AppVertexRoutingInfo(keys_and_masks, partition_id, app_vertex, machine_mask, n_bits_atoms, max_machine_index)[source]¶
Bases:
VertexRoutingInfo
- Parameters:
keys_and_masks (iterable(BaseKeyAndMask)) – The keys allocated to the machine partition
partition_id (str) – The partition to set the keys for
machine_vertex (MachineVertex) – The vertex to set the keys for
index (int) – The index of the machine vertex
- property vertex¶
The vertex of the information.
- Return type:
- class pacman.model.routing_info.BaseKeyAndMask(base_key, mask)[source]¶
Bases:
object
A Key and Mask to be used for routing.
- Parameters:
- Raises:
PacmanConfigurationException – If key & mask != key i.e. the key is not valid for the given mask
- get_keys(key_array=None, offset=0, n_keys=None)[source]¶
Get the ordered list of keys that the combination allows.
- Parameters:
key_array (ndarray(int)) – Optional array into which the returned keys will be placed
offset (int) – Optional offset into the array at which to start placing keys
n_keys (int) – Optional limit on the number of keys returned. If less than this number of keys are available, only the keys available will be added
- Returns:
A tuple of an array of keys and the number of keys added to the array
- Return type:
- class pacman.model.routing_info.MachineVertexRoutingInfo(keys_and_masks, partition_id, machine_vertex, index)[source]¶
Bases:
VertexRoutingInfo
Associates a machine vertex and partition identifier to its routing information (keys and masks).
- Parameters:
keys_and_masks (iterable(BaseKeyAndMask)) – The keys allocated to the machine partition
partition_id (str) – The partition to set the keys for
machine_vertex (MachineVertex) – The vertex to set the keys for
index (int) – The index of the machine vertex
- property machine_vertex¶
The machine vertex.
- Return type:
- property vertex¶
The vertex of the information.
- Return type:
- class pacman.model.routing_info.RoutingInfo[source]¶
Bases:
object
An association of machine vertices to a non-overlapping set of keys and masks.
- add_routing_info(info)[source]¶
Add a routing information item.
- Parameters:
info (VertexRoutingInfo) – The routing information item to add
- Raises:
PacmanAlreadyExistsException – If the partition is already in the set of edges
- get_first_key_from_pre_vertex(vertex, partition_id)[source]¶
Get the first key for the partition starting at a vertex.
- Parameters:
vertex (AbstractVertex) – The vertex which the partition starts at
partition_id (str) – The ID of the partition for which to get the routing information
- Returns:
The routing key of the partition
- Return type:
- get_routing_info_from_pre_vertex(vertex, partition_id)[source]¶
Get routing information for a given partition_id from a vertex.
- Parameters:
vertex (AbstractVertex) – The vertex to search for
partition_id (str) – The ID of the partition for which to get the routing information