pacman.model.partitioner_splitters package¶

Module contents¶

class pacman.model.partitioner_splitters.SplitterOneAppOneMachine(splitter_name=None)[source]

Bases: pacman.model.partitioner_splitters.abstract_splitters.abstract_splitter_common.AbstractSplitterCommon

NOT_SUITABLE_VERTEX_ERROR = 'The vertex {} cannot be supported by the {} as the vertex does not implement AbstractOneAppOneMachineVertex'
create_machine_vertices(resource_tracker, machine_graph)[source]

method for specific splitter objects to use.

Parameters: resource_tracker (ResourceTracker) – machine resources machine_graph (MachineGraph) – machine graph true if successful, false otherwise bool
get_in_coming_slices()[source]

A best effort prediction of the slices of the input vertices.

If this method is called after create_machine_vertices the splitter should return the actual slices of the input vertices. The second value returned is then always True

If this method is called before create_machine_vertices the splitter will have to make an estimate unless the actual slices it will use are already known. The second value returned is True if and only if the slices will not be changed.

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Returns: the slices incoming to this vertex, bool if estimate or exact tuple(list(Slice), bool)
get_in_coming_vertices(edge, outgoing_edge_partition, src_machine_vertex)[source]

gets incoming vertices and their acceptable edge types

The input vertices are the ones that will serve as dest vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters: edge (ApplicationEdge) – app edge outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition src_machine_vertex (MachineVertex) – the src machine vertex dict of keys being machine vertices and values are a list of acceptable edge types. dict(MachineVertex,list(class))
get_out_going_slices()[source]

A best effort prediction of the slices of the output vertices.

If this method is called after create_machine_vertices the splitter should return the actual slices of the output vertices. The second value returned is then always True

If this method is called before create_machine_vertices the splitter will have to make an estimate unless the actual slices it will use are already known. The second value returned is True if and only if the slices will not be changed.

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/down-stream splitter.

Returns: list of Slices and bool of estimate or not tuple(list(Slice), bool)
get_out_going_vertices(edge, outgoing_edge_partition)[source]

gets pre vertices and their acceptable edge types

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters: edge (ApplicationEdge) – app edge outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition dict of keys being machine vertices and values are a list of acceptable edge types. dict(MachineVertex,list(class))
machine_vertices_for_recording(variable_to_record)[source]

Gets the machine vertices which are recording this variable.

Parameters: variable_to_record (str) – the variable to get machine verts for. list of machine vertices iterable(MachineVertex)
reset_called()[source]

reset the splitter to be as if it has not operated a splitting yet.

set_governed_app_vertex(app_vertex)[source]

Sets a app vertex to be governed by this splitter object. Once set it can’t be reset

Parameters: app_vertex (ApplicationVertex) – the app vertex to govern PacmanConfigurationException – if the app vertex has already been set.
class pacman.model.partitioner_splitters.SplitterOneToOneLegacy[source]

Bases: pacman.model.partitioner_splitters.abstract_splitters.abstract_splitter_common.AbstractSplitterCommon

NOT_API_WARNING = 'Your vertex is deprecated. Please add a Splitter or inherit from the class in pacman.model.partitioner_interfaces.legacy_partitioner_api'
NOT_SUITABLE_VERTEX_ERROR = 'The vertex {} cannot be supported by the {} as the vertex does not support the required method {} of LegacyPartitionerAPI. Please inherit from the class in pacman.model.partitioner_interfaces.legacy_partitioner_api and try again.'
create_machine_vertices(resource_tracker, machine_graph)[source]

method for specific splitter objects to use.

Parameters: resource_tracker (ResourceTracker) – machine resources machine_graph (MachineGraph) – machine graph true if successful, false otherwise bool
get_in_coming_slices()[source]

A best effort prediction of the slices of the input vertices.

If this method is called after create_machine_vertices the splitter should return the actual slices of the input vertices. The second value returned is then always True

If this method is called before create_machine_vertices the splitter will have to make an estimate unless the actual slices it will use are already known. The second value returned is True if and only if the slices will not be changed.

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Returns: the slices incoming to this vertex, bool if estimate or exact tuple(list(Slice), bool)
get_in_coming_vertices(edge, outgoing_edge_partition, src_machine_vertex)[source]

gets incoming vertices and their acceptable edge types

The input vertices are the ones that will serve as dest vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters: edge (ApplicationEdge) – app edge outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition src_machine_vertex (MachineVertex) – the src machine vertex dict of keys being machine vertices and values are a list of acceptable edge types. dict(MachineVertex,list(class))
get_out_going_slices()[source]

A best effort prediction of the slices of the output vertices.

If this method is called after create_machine_vertices the splitter should return the actual slices of the output vertices. The second value returned is then always True

If this method is called before create_machine_vertices the splitter will have to make an estimate unless the actual slices it will use are already known. The second value returned is True if and only if the slices will not be changed.

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/down-stream splitter.

Returns: list of Slices and bool of estimate or not tuple(list(Slice), bool)
get_out_going_vertices(edge, outgoing_edge_partition)[source]

gets pre vertices and their acceptable edge types

The output vertices are the ones that will serve as source vertices for external edges. If more than one set of vertices match this description the splitter should use the ones used by the most general edge type/ down stream splitter.

Parameters: edge (ApplicationEdge) – app edge outgoing_edge_partition (OutgoingEdgePartition) – outgoing edge partition dict of keys being machine vertices and values are a list of acceptable edge types. dict(MachineVertex,list(class))
machine_vertices_for_recording(variable_to_record)[source]

Gets the machine vertices which are recording this variable.

Parameters: variable_to_record (str) – the variable to get machine verts for. list of machine vertices iterable(MachineVertex)
reset_called()[source]

reset the splitter to be as if it has not operated a splitting yet.

set_governed_app_vertex(app_vertex)[source]

Sets a app vertex to be governed by this splitter object. Once set it can’t be reset

Parameters: app_vertex (ApplicationVertex) – the app vertex to govern PacmanConfigurationException – if the app vertex has already been set.
class pacman.model.partitioner_splitters.SplitterSliceLegacy(splitter_name=None)[source]

Bases: pacman.model.partitioner_splitters.abstract_splitters.abstract_splitter_slice.AbstractSplitterSlice

NOT_API_WARNING = 'Your vertex is deprecated. Please add a Splitter or inherit from the class in pacman.model.partitioner_interfaces.legacy_partitioner_api'
NOT_SUITABLE_VERTEX_ERROR = 'The vertex {} cannot be supported by the {} as the vertex does not support the required method {} of LegacyPartitionerAPI. Please inherit from the class in pacman.model.partitioner_interfaces.legacy_partitioner_api and try again.'
SPLITTER_NAME = 'SplitterSliceLegacy'
create_machine_vertex(vertex_slice, resources, label, remaining_constraints)[source]

creates a machine vertex

Parameters: vertex_slice (Slice) – vertex slice resources (ResourceTracker) – resources label (str) – human readable label for machine vertex. remaining_constraints (iterable(AbstractConstraint)) – none partitioner constraints. machine vertex MachineVertex
get_resources_used_by_atoms(vertex_slice)[source]

gets the resources of a slice of atoms from a given app vertex.

Parameters: vertex_slice (Slice) – the slice to find the resources of. Resource container. ResourceContainer
set_governed_app_vertex(app_vertex)[source]

Sets a app vertex to be governed by this splitter object. Once set it can’t be reset

Parameters: app_vertex (ApplicationVertex) – the app vertex to govern PacmanConfigurationException – if the app vertex has already been set.