pacman.utilities.algorithm_utilities package

Submodules

pacman.utilities.algorithm_utilities.element_allocator_algorithm module

class pacman.utilities.algorithm_utilities.element_allocator_algorithm.ElementAllocatorAlgorithm(size_begin, size_end)[source]

Bases: object

Abstract element allocator algorithm which allocates elements from a pool of a given size

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.field_based_system_utilities.deduce_types(graph)[source]

Deducing the number of applications required for this key space.

Parameters:graph
pacman.utilities.algorithm_utilities.field_based_system_utilities.handle_flexi_field(constraint, seen_fields, known_fields)[source]
Parameters:
  • constraint
  • seen_fields
  • known_fields
Return type:

None:

pacman.utilities.algorithm_utilities.machine_algorithm_utilities module

pacman.utilities.algorithm_utilities.machine_algorithm_utilities.create_virtual_chip(machine, link_data, virtual_chip_x, virtual_chip_y)[source]

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:
pacman.utilities.algorithm_utilities.partition_algorithm_utilities.get_remaining_constraints(vertex)[source]

Gets the rest of the constraints from a vertex after removing partitioning constraints

pacman.utilities.algorithm_utilities.partition_algorithm_utilities.get_same_size_vertex_groups(vertices)[source]

Get a dictionary of vertex to vertex that must be partitioned the same size

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.placer_algorithm_utilities.sort_vertices_by_known_constraints(vertices)[source]

Sort vertices to be placed by constraint so that those with more restrictive constraints come first.

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 masks
Returns:The fixed mask if found, or None
Raises:PacmanValueError – If two edges conflict in their requirements

Module contents

class pacman.utilities.algorithm_utilities.ElementAllocatorAlgorithm(size_begin, size_end)[source]

Bases: object

Abstract element allocator algorithm which allocates elements from a pool of a given size