pacman.model.partitioner_splitters.abstract_splitters package

Module contents

class pacman.model.partitioner_splitters.abstract_splitters.AbstractDependentSplitter(other_splitter, splitter_name)[source]

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

splitter that defines it needs to be run after another splitter.

Creates a splitter that must be done after the other unless None.

Parameters:
  • other_splitter (AbstractSplitterCommon or None) – the other splitter to depend upon
  • splitter_name (str) –
CIRCULAR_ERROR_MESSAGE = 'Circular dependency found when setting splitter {} to be dependent on splitter {}'
check_circular(upstream)[source]
other_splitter

the other splitter

Return type:AbstractSplitterCommon or None
class pacman.model.partitioner_splitters.abstract_splitters.AbstractSplitterCommon(splitter_name=None)[source]

Bases: object

Parameters:splitter_name (str) –
DEFAULT_SPLITTER_NAME = 'AbstractSplitterCommon'
FIXED_ABOVE_MAX = 'Illegal attempt to set fixed atoms per core to {} as that is above a previously set max atoms of {}'
FIX_ATOMS_RESET = 'Illegal attempt to set fixed atoms per core to {} as it was already set to {}'
MAX_BELOW_FIXED = 'Illegal attempt to set max atoms per core to {} as that is lower than the previously set fixed of {}'
SETTING_SPLITTER_ERROR_MSG = 'The app vertex {} is already governed by this {}. And so cannot govern app vertex {}. Please fix and try again.'
STR_MESSAGE = '{} governing app vertex {}'
check_supported_constraints()[source]
Raises:PacmanInvalidParameterException – When partitioner constraints other than MaxVertexAtomsConstraint and FixedVertexAtomsConstraint are used.
create_machine_vertices(resource_tracker, machine_graph)[source]

method for specific splitter objects to use.

Parameters:
Returns:

true if successful, false otherwise

Return type:

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
Return type: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
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

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
Return type: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
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

dict(MachineVertex,list(class))

governed_app_vertex
Return type:ApplicationVertex
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.
Returns:list of machine vertices
Return type: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
Raises:PacmanConfigurationException – if the app vertex has already been set.
set_max_atoms_per_core(max_atoms_per_core, is_fixed_atoms)[source]

sets max atoms per core for this splitter object

Parameters:
  • max_atoms_per_core (int) – max atoms per core for this splitter.
  • is_fixed_atoms (bool) – is this a hard constraint or soft.
Raises:

PacmanConfigurationException – If the new setting clash with a previous setting

split(resource_tracker, machine_graph)[source]

executes splitting

Parameters:
Returns:

true if successful, false otherwise

Return type:

bool

class pacman.model.partitioner_splitters.abstract_splitters.AbstractSplitterSlice(splitter_name)[source]

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

Contains default logic for splitting by slice.

FAIL_TO_ALLOCATE_RESOURCES = "Unable to allocate requested resources available to vertex '{}':\n{}"
MACHINE_LABEL = '{}:{}:{}'
NOT_SUITABLE_VERTEX_ERROR = 'The vertex {} cannot be supported by the {} as the vertex does not support the required API of LegacyPartitionerAPI. Please inherit from the class in pacman.model.partitioner_interfaces.legacy_partitioner_api and try again.'
NO_MORE_RESOURCE_AVAILABLE_ERROR = "No more of vertex '{}' would fit on the board:\n Allocated so far: {} atoms\n Request for SDRAM: {}\n Largest SDRAM space: {}"
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.
Returns:

machine vertex

Return type:

MachineVertex

create_machine_vertices(resource_tracker, machine_graph)[source]

method for specific splitter objects to use.

Parameters:
Returns:

true if successful, false otherwise

Return type:

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
Return type: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
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

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
Return type: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
Returns:

dict of keys being machine vertices and values are a list of acceptable edge types.

Return type:

dict(MachineVertex,list(class))

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.
Returns:Resource container.
Return type:ResourceContainer
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.
Returns:list of machine vertices
Return type:iterable(MachineVertex)
reset_called()[source]

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