pacman.data package

Module contents

class pacman.data.PacmanDataView[source]

Bases: spinn_machine.data.machine_data_view.MachineDataView

Adds the extra Methods to the View for PACMAN level.

See UtilsDataView for a more detailed description.

This class is designed to only be used directly within the PACMAN repository as all methods are available to subclasses

classmethod add_edge(edge, outgoing_edge_partition_name)[source]

Adds an Application edge to the user graph.

Syntactic sugar for get_graph().add_edge()

Parameters:
  • edge (AbstractEdge) – The edge to add
  • outgoing_edge_partition_name (str) – The name of the edge partition to add the edge to; each edge partition is the partition of edges that start at the same vertex
Return type:

AbstractEdgePartition

Raises:
classmethod add_vertex(vertex)[source]

Adds an Application vertex to the user graph.

Syntactic sugar for get_graph().add_vertex()

Parameters:

vertex (ApplicationVertex) – The vertex to add to the graph

Raises:
classmethod get_edges()[source]

Get all the edges in the graph.

Syntactic sugar for get_graph().edges

Return type:list(AbstractEdge)
classmethod get_n_machine_vertices()[source]

Gets the number of machine vertices via the application graph.

Return type:int
classmethod get_n_partitions()[source]

The partitions in the user application graph.

Syntactic sugar for get_graph().n_outgoing_edge_partitions

Return type:int
Raises:SpiNNUtilsException – If the graph is currently unavailable
classmethod get_n_placements()[source]

The number of placements.

Return type:int
Raises:SpiNNUtilsException – If the placements are currently unavailable
classmethod get_n_vertices()[source]

The number of vertices in the user application graph.

Syntactic sugar for get_graph().n_vertices

Return type:int
Raises:SpiNNUtilsException – If the graph is currently unavailable
classmethod get_outgoing_edge_partitions_starting_at_vertex(vertex)[source]

Get all the edge partitions that start at the given vertex.

Syntactic sugar for get_graph().get_outgoing_edge_partitions_starting_at_vertex()

Parameters:vertex (AbstractVertex) – The vertex at which the edge partitions to find starts
Return type:iterable(AbstractEdgePartition)
classmethod get_placement_of_vertex(vertex)[source]

Return the placement information for a vertex.

Syntactic sugar for get_placements().get_placement_of_vertex(vertex). Optimised for speed

Parameters:

vertex (MachineVertex) – The vertex to find the placement of

Returns:

The placement

Return type:

Placement

Raises:
classmethod get_placement_on_processor(x, y, p)[source]

Get the vertex on a specific processor, or raise an exception if the processor has not been allocated.

Parameters:
  • x (int) – the X coordinate of the chip
  • y (int) – the Y coordinate of the chip
  • p (int) – the processor on the chip
Returns:

the vertex placed on the given processor

Return type:

MachineVertex

Raises:
classmethod get_plan_n_timestep()[source]

The number of timesteps to plan for in an auto-pause-resume cycle.

Use by partitioners and such, but not to reserve data regions.

Return type:int or None
Returns:The planned number of timesteps, or None if run forever.
classmethod get_precompressed()[source]

Get the pre-compressed routing tables.

This may be the same object as the uncompressed ones if precompression is skipped or determined to be not needed.

Return type:MulticastRoutingTables
Returns:The routing tables after the range compressor or if not to be run the original tables
Raises:SpiNNUtilsException – If the tables is currently unavailable
classmethod get_routing_infos()[source]

The routing information, if known.

Raises:SpiNNUtilsException – If the routing_infos is currently unavailable
classmethod get_routing_table_by_partition()[source]

The MulticastRoutingTableByPartition, if it has been set.

Return type:MulticastRoutingTableByPartition
Raises:SpiNNUtilsException – If the tables is currently unavailable
classmethod get_tags()[source]

The Tags object if known.

Return type:Tags
Raises:SpiNNUtilsException – If the tags is currently unavailable
classmethod get_uncompressed()[source]

Get the uncompressed routing tables.

Return type:MulticastRoutingTables
Returns:The original routing tables
Raises:SpiNNUtilsException – If the tables is currently unavailable
classmethod get_vertices_by_type(vertex_type)[source]

The application vertices in the graph of the specific type.

Syntactic sugar for:

for vertex in get_graph().vertices
    if isinstance(vertex, vertex_type)
        ...

Note

The result is a generator so can only be used in a single loop

Parameters:vertex_type (type or iterable(type)) – The type(s) to filter the vertices on (can be anything acceptable to the isinstance built-in).
Return type:iterable(AbstractVertex)
Raises:SpiNNUtilsException – If the graph is currently unavailable
classmethod iterate_machine_vertices()[source]

Iterate over the Machine vertices via the application graph.

Return type:iterable(MachineVertex)
classmethod iterate_partitions()[source]

The partitions in the user application graphs as an iterator.

Syntactic sugar for get_graph().outgoing_edge_partitions

Return type:iterable(ApplicationEdgePartition)
Raises:SpiNNUtilsException – If the graph is currently unavailable
classmethod iterate_placemements()[source]

Iterates over the Placement objects.

Syntactic sugar for get_placements().placements

Return type:iterable(Placement)
classmethod iterate_placements_by_vertex_type(vertex_type)[source]

Iterate over placements on any chip with this vertex_type.

Parameters:vertex_type (type) – Class of vertex to find
Return type:iterable(Placement)
Raises:SpiNNUtilsException – If the placements are currently unavailable
classmethod iterate_placements_by_xy_and_type(x, y, vertex_type)[source]

Iterate over placements with this x, y and type.

Parameters:
  • x (int) – x coordinate to find placements for.
  • y (int) – y coordinate to find placements for.
  • vertex_type (type) – Class of vertex to find
Return type:

iterable(Placement)

Raises:

SpiNNUtilsException – If the placements are currently unavailable

classmethod iterate_placements_on_core(x, y)[source]

Iterate over placements with this x and y.

Parameters:
  • x (int) – x coordinate to find placements for.
  • y (int) – y coordinate to find placements for.
Return type:

iterable(Placement)

Raises:

SpiNNUtilsException – If the placements are currently unavailable

classmethod iterate_vertices()[source]

The vertices in the user application graph.

Syntactic sugar for get_graph().vertices except that the result is an iterable and not a list.

Return type:iterable(AbstractVertex)
Raises:SpiNNUtilsException – If the graph is currently unavailable