pacman.model.partitioner_splitters package

Submodules

pacman.model.partitioner_splitters.splitter_reset module

Module contents

Basic implementations of a selection of splitters. Splitters are responsible for taking an application vertex and creating one or more machine vertices that implement the functionality, together with the edges to internally connect those vertices up (if needed).

class pacman.model.partitioner_splitters.AbstractSplitterCommon

Bases: Generic[V]

Common base class for vertex splitters, defining some utility methods.

abstract create_machine_vertices(chip_counter: ChipCounter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

abstract get_in_coming_slices() Sequence[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

abstract get_in_coming_vertices(partition_id: str) Sequence[MachineVertex][source]

Get machine post-vertices for a given partition.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method returns all that could be used for any source machine vertex in the given partition.

Parameters:

partition_id (str) – The identifier of the incoming partition

Return type:

list(MachineVertex)

get_internal_multicast_partitions() Sequence[MulticastEdgePartition][source]

Get edge partitions between machine vertices that are to be handled by Multicast. Returns empty by default, override if there are Multicast connections between internal vertices

Return type:

list(MulticastEdgePartition)

get_internal_sdram_partitions() Sequence[AbstractSDRAMPartition][source]

Get edge partitions between machine vertices that are to be handled by SDRAM. Returns empty by default, override if there are SDRAM connections between internal vertices

Return type:

list(AbstractSDRAMPartition)

abstract get_out_going_slices() Sequence[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

abstract get_out_going_vertices(partition_id: str) Sequence[MachineVertex][source]

Get machine pre-vertices.

The output vertices are the ones that will serve as source vertices for external edges.

Parameters:

partition_id (str) – The identifier of the outgoing partition

Return type:

list(MachineVertex)

get_same_chip_groups() Sequence[Tuple[Sequence[MachineVertex], AbstractSDRAM]][source]

Get a list of lists of vertices and SDRAM which must be allocated on the same chip. By default this returns a list of each machine vertex and its SDRAM; override if there are groups of machine vertices on the same chip.

Return type:

list(list(MachineVertex), AbstractSDRAM)

get_source_specific_in_coming_vertices(source_vertex: ApplicationVertex, partition_id: str) Sequence[Tuple[MachineVertex, Sequence[MachineVertex | ApplicationVertex]]][source]

Get machine post-vertices for a given source.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method allows filtering of the targets for a specific source machine vertex.

This default method makes every machine vertex a target for the source. This should be overridden if there are specific machine vertices for any given source vertex.

Parameters:
  • source_vertex (ApplicationVertex) – The source to get incoming vertices for

  • partition_id (str) – The identifier of the incoming partition

Returns:

A list of tuples of (target machine vertex, list of source machine or application vertices that should hit the target)

Return type:

list(tuple(MachineVertex, list(MachineVertex or ApplicationVertex)))

property governed_app_vertex: V

The app vertex to be governed by this splitter object.

Return type:

ApplicationVertex

Raises:

PacmanConfigurationException – if the app vertex has not been been set.

abstract machine_vertices_for_recording(variable_to_record: str) Iterable[MachineVertex][source]

Gets the machine vertices which are recording this variable.

Parameters:

variable_to_record (str) – the variable to get machine vertices for.

Returns:

list of machine vertices

Return type:

iterable(MachineVertex)

abstract reset_called() None[source]

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

set_governed_app_vertex(app_vertex: V)[source]

Sets a application 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.

class pacman.model.partitioner_splitters.SplitterExternalDevice

Bases: AbstractSplitterCommon

A splitter for handling external devices.

create_machine_vertices(chip_counter: ChipCounter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices() List[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id: str) List[MachineVertex][source]

Get machine post-vertices for a given partition.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method returns all that could be used for any source machine vertex in the given partition.

Parameters:

partition_id (str) – The identifier of the incoming partition

Return type:

list(MachineVertex)

get_out_going_slices() List[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id: str) List[MachineVertex][source]

Get machine pre-vertices.

The output vertices are the ones that will serve as source vertices for external edges.

Parameters:

partition_id (str) – The identifier of the outgoing partition

Return type:

list(MachineVertex)

machine_vertices_for_recording(variable_to_record: str) List[MachineVertex][source]

Gets the machine vertices which are recording this variable.

Parameters:

variable_to_record (str) – the variable to get machine vertices for.

Returns:

list of machine vertices

Return type:

iterable(MachineVertex)

reset_called() None[source]

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

set_governed_app_vertex(app_vertex: ApplicationFPGAVertex | ApplicationSpiNNakerLinkVertex)[source]

Sets a application 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.

class pacman.model.partitioner_splitters.SplitterFixedLegacy

Bases: AbstractSplitterCommon[V], Generic[V]

Splitter for old-style vertices.

Note

Only to be used with ApplicationVertex objects that also implement LegacyPartitionerAPI.

create_machine_vertices(chip_counter: ChipCounter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices() List[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id: str) List[MachineVertex][source]

Get machine post-vertices for a given partition.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method returns all that could be used for any source machine vertex in the given partition.

Parameters:

partition_id (str) – The identifier of the incoming partition

Return type:

list(MachineVertex)

get_out_going_slices() List[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id: str) List[MachineVertex][source]

Get machine pre-vertices.

The output vertices are the ones that will serve as source vertices for external edges.

Parameters:

partition_id (str) – The identifier of the outgoing partition

Return type:

list(MachineVertex)

machine_vertices_for_recording(variable_to_record: str) List[MachineVertex][source]

Gets the machine vertices which are recording this variable.

Parameters:

variable_to_record (str) – the variable to get machine vertices for.

Returns:

list of machine vertices

Return type:

iterable(MachineVertex)

reset_called() None[source]

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

set_governed_app_vertex(app_vertex: V)[source]

Sets a application 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.

class pacman.model.partitioner_splitters.SplitterOneAppOneMachine

Bases: AbstractSplitterCommon[AV], Generic[AV, MV]

Splitter that handles AbstractOneAppOneMachineVertex vertices.

create_machine_vertices(chip_counter: ChipCounter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices() List[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id: str) List[MV][source]

Get machine post-vertices for a given partition.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method returns all that could be used for any source machine vertex in the given partition.

Parameters:

partition_id (str) – The identifier of the incoming partition

Return type:

list(MachineVertex)

get_out_going_slices() List[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id: str) List[MV][source]

Get machine pre-vertices.

The output vertices are the ones that will serve as source vertices for external edges.

Parameters:

partition_id (str) – The identifier of the outgoing partition

Return type:

list(MachineVertex)

machine_vertices_for_recording(variable_to_record: str) List[MV][source]

Gets the machine vertices which are recording this variable.

Parameters:

variable_to_record (str) – the variable to get machine vertices for.

Returns:

list of machine vertices

Return type:

iterable(MachineVertex)

reset_called() None[source]

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

set_governed_app_vertex(app_vertex: AV)[source]

Sets a application 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.

class pacman.model.partitioner_splitters.SplitterOneToOneLegacy

Bases: AbstractSplitterCommon[ApplicationVertex]

A Splitter which hands an vertex with the LegacyPartitionerAPI

The assumption is that each ApplicationVertex will get just one Machine vertex

create_machine_vertices(chip_counter: ChipCounter)[source]

Method for specific splitter objects to override.

Parameters:

chip_counter (ChipCounter) – counter of used chips

get_in_coming_slices() List[Slice][source]

The slices of the input vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_in_coming_vertices(partition_id: str) List[MachineVertex][source]

Get machine post-vertices for a given partition.

The input vertices are the ones that will serve as target vertices for external edges.

Note

This method returns all that could be used for any source machine vertex in the given partition.

Parameters:

partition_id (str) – The identifier of the incoming partition

Return type:

list(MachineVertex)

get_out_going_slices() List[Slice][source]

The slices of the output vertices.

Returns:

list of Slices

Return type:

list(Slice)

get_out_going_vertices(partition_id: str) List[MachineVertex][source]

Get machine pre-vertices.

The output vertices are the ones that will serve as source vertices for external edges.

Parameters:

partition_id (str) – The identifier of the outgoing partition

Return type:

list(MachineVertex)

machine_vertices_for_recording(variable_to_record: str) List[MachineVertex][source]

Gets the machine vertices which are recording this variable.

Parameters:

variable_to_record (str) – the variable to get machine vertices for.

Returns:

list of machine vertices

Return type:

iterable(MachineVertex)

reset_called() None[source]

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

set_governed_app_vertex(app_vertex: ApplicationVertex)[source]

Sets a application 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.