pacman.model.partitioner_interfaces package

Submodules

pacman.model.partitioner_interfaces.abstract_slices_connect module

Module contents

class pacman.model.partitioner_interfaces.AbstractSlicesConnect

Bases: object

An object that can check if a pre-slice and a post-slice could connect.

Typically used to determine if a Machine Edge should be created by checking that at least one of the indexes in the source slice could connect to at least one of the indexes in the destination slice.

could_connect(src_machine_vertex, dest_machine_vertex)[source]

Determine if there is a chance that one of the indexes in the pre-slice could connect to at least one of the indexes in the post-slice.

Note

This method should never return a false negative, but may return a false positives

Parameters:
Returns:

True if a connection could be possible

Return type:

bool

class pacman.model.partitioner_interfaces.AbstractSplitterPartitioner

Bases: object

Splitter API to allow other Partitioner’s to add more stuff to the edge creation process.

This makes sure that the methods the superclass expects to be there are not removed.

create_machine_edge(src_machine_vertex, dest_machine_vertex, common_edge_type, app_edge, machine_graph, app_outgoing_edge_partition, resource_tracker)[source]

Create the machine edge (if needed) and add it to the graph.

Some implementations of this method are able to detect that the requested edge is not actually needed so never create or add it.

Parameters:
  • src_machine_vertex (MachineVertex) – Src machine vertex of a edge
  • dest_machine_vertex (MachineVertex) – Dest machine vertex of a edge
  • common_edge_type (MachineEdge) – The edge type to build
  • app_edge (ApplicationEdge) – The app edge this machine edge is to be associated with.
  • machine_graph (MachineGraph) – Machine graph to add edge to.
  • app_outgoing_edge_partition (OutgoingEdgePartition) – Partition
  • resource_tracker (ResourceTracker) – The resource tracker.
class pacman.model.partitioner_interfaces.LegacyPartitionerAPI

Bases: object

API used by the vertices which dont have their own splitters but use what master did before the self partitioning stuff came to be.

create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex.

Parameters:
  • vertex_slice (Slice) – The slice of atoms that the machine vertex will cover.
  • resources_required (ResourceContainer) – The resources used by the machine vertex.
  • label (str or None) – human readable label for the machine vertex
  • constraints (iterable(AbstractConstraint)) – Constraints to be passed on to the machine vertex.
Returns:

The created machine vertex

Return type:

MachineVertex

get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms.

Parameters:vertex_slice (Slice) – the low value of atoms to calculate resources from
Returns:a resource container that contains a CPUCyclesPerTickResource, DTCMResource and SDRAMResource
Return type:ResourceContainer
n_atoms

The number of atoms in the vertex

Returns:The number of atoms
Return type:int