pacman.utilities.algorithm_utilities package¶
Submodules¶
pacman.utilities.algorithm_utilities.element_allocator_algorithm module¶
pacman.utilities.algorithm_utilities.field_based_system_utilities module¶
-
class
pacman.utilities.algorithm_utilities.field_based_system_utilities.
TYPES_OF_FIELDS
[source]¶ Bases:
enum.Enum
An enumeration.
-
FIXED_FIELD
= 2¶
-
FIXED_KEY
= 1¶
-
FIXED_MASK
= 0¶
-
-
pacman.utilities.algorithm_utilities.field_based_system_utilities.
convert_mask_into_fields
(entity)[source]¶ Parameters: entity –
pacman.utilities.algorithm_utilities.machine_algorithm_utilities module¶
pacman.utilities.algorithm_utilities.partition_algorithm_utilities module¶
A collection of methods which support partitioning algorithms.
-
pacman.utilities.algorithm_utilities.partition_algorithm_utilities.
generate_machine_edges
(machine_graph, graph_mapper, application_graph)[source]¶ Generate the machine edges for the vertices in the graph
Parameters: - machine_graph (
pacman.model.graphs.machine.MachineGraph
) – the machine graph to add edges to - graph_mapper (
pacman.model.graphs.common.GraphMapper
) – the mapper graphs - application_graph (
pacman.model.graphs.application.ApplicationGraph
) – the application graph to work with
- machine_graph (
pacman.utilities.algorithm_utilities.placer_algorithm_utilities module¶
-
pacman.utilities.algorithm_utilities.placer_algorithm_utilities.
add_set
(all_sets, new_set)[source]¶ Adds a new set into the list of sets, concatenating sets if required.
If the new set does not overlap any existing sets it is added.
However if the new sets overlaps one or more existing sets, a superset is created combining all the overlapping sets. Existing overlapping sets are removed and only the new superset is added.
Parameters: - all_sets – List of Non overlapping sets
- new_set – A new set which may or may not overlap the previous sets.
-
pacman.utilities.algorithm_utilities.placer_algorithm_utilities.
create_vertices_groups
(vertices, same_group_as_function)[source]¶
-
pacman.utilities.algorithm_utilities.placer_algorithm_utilities.
get_same_chip_vertex_groups
(graph)[source]¶ Get a dictionary of vertex to list of vertices that must be placed on the same chip
Parameters: graph – The graph containing the vertices
-
pacman.utilities.algorithm_utilities.placer_algorithm_utilities.
get_vertices_on_same_chip
(vertex, graph)[source]¶ Get the vertices that must be on the same chip as the given vertex
Parameters: - vertex – The vertex to search with
- graph – The graph containing the vertex
-
pacman.utilities.algorithm_utilities.placer_algorithm_utilities.
group_vertices
(vertices, same_group_as_function)[source]¶ Group vertices according to some function that can indicate the groups that any vertex can be contained within
Parameters: - vertices – The vertices to group
- same_group_as_function – A function which takes a vertex and returns vertices that should be in the same group (excluding the original vertex)
Returns: A dictionary of vertex to list of vertices that are grouped with it
pacman.utilities.algorithm_utilities.routing_info_allocator_utilities module¶
-
class
pacman.utilities.algorithm_utilities.routing_info_allocator_utilities.
ConstraintGroup
(values)[source]¶ Bases:
list
-
constraint
¶
-
-
pacman.utilities.algorithm_utilities.routing_info_allocator_utilities.
check_types_of_edge_constraint
(machine_graph)[source]¶ Go through the graph for operations and checks that the constraints are compatible.
Parameters: machine_graph – the graph to search through Return type: None:
-
pacman.utilities.algorithm_utilities.routing_info_allocator_utilities.
get_edge_groups
(machine_graph, traffic_type)[source]¶ Utility method to get groups of edges using any
KeyAllocatorSameKeyConstraint
constraints. Note that no checking is done here about conflicts related to other constraints.Parameters: - machine_graph – the machine graph
- traffic_type – the traffic type to group
-
pacman.utilities.algorithm_utilities.routing_info_allocator_utilities.
get_fixed_mask
(same_key_group)[source]¶ Get a fixed mask from a group of edges if a
FixedMaskConstraint
constraint exists in any of the edges in the group.Parameters: same_key_group (iterable( pacman.model.graphs.machine.MachineEdge
)) – Set of edges that are to be assigned the same keys and masksReturns: The fixed mask if found, or None Raises: PacmanValueError – If two edges conflict in their requirements