spinnaker_graph_front_end package

Submodules

spinnaker_graph_front_end.spinnaker module

class spinnaker_graph_front_end.spinnaker.SpiNNaker(executable_finder, host_name=None, graph_label=None, database_socket_addresses=None, dsg_algorithm=None, n_chips_required=None, extra_pre_run_algorithms=None, extra_post_run_algorithms=None, time_scale_factor=None, machine_time_step=None)[source]

Bases: spinn_front_end_common.interface.spinnaker_main_interface.SpinnakerMainInterface

add_socket_address(socket_address)[source]

Add a socket address to the list to be checked by the notification protocol

Parameters:socket_address – the socket address
Return type:None
get_machine_dimensions()[source]

Get the machine dimensions

is_allocated_machine
run(run_time)[source]

Module contents

class spinnaker_graph_front_end.LivePacketGather(ip_address, port, board_address=None, tag=None, strip_sdp=True, use_prefix=False, key_prefix=None, prefix_type=None, message_type=<EIEIOType.KEY_32_BIT: 2>, right_shift=0, payload_as_time_stamps=True, use_payload_prefix=True, payload_prefix=None, payload_right_shift=0, number_of_packets_sent_per_time_step=0, constraints=None, label=None)[source]

Bases: spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, pacman.model.graphs.application.impl.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_binary_uses_simulation_run.AbstractBinaryUsesSimulationRun

A model which stores all the events it receives during a timer tick and then compresses them into Ethernet packets and sends them out of a spinnaker machine.

create_machine_vertex(obj, *args, **kwargs)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice – The slice of atoms that the machine vertex will cover
  • resources_required – the resources used by the machine vertex
  • constraints – Constraints to be passed on to the machine vertex
generate_data_specification(spec, placement)[source]

Generate a data specification

Parameters:
Return type:

None

get_binary_file_name()[source]

Get the binary name to be run for vertices of this vertex

get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (pacman.model.graph.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
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Returns:The number of atoms
Return type:int
class spinnaker_graph_front_end.ReverseIpTagMultiCastSource(n_keys, label=None, constraints=None, max_atoms_per_core=9223372036854775807, board_address=None, receive_port=None, receive_sdp_port=1, receive_tag=None, receive_rate=10, virtual_key=None, prefix=None, prefix_type=None, check_keys=False, send_buffer_times=None, send_buffer_partition_id=None, send_buffer_max_space=1048576, send_buffer_space_before_notify=640, buffer_notification_ip_address=None, buffer_notification_port=None, buffer_notification_tag=None, reserve_reverse_ip_tag=False)[source]

Bases: pacman.model.graphs.application.impl.application_vertex.ApplicationVertex, spinn_front_end_common.abstract_models.abstract_generates_data_specification.AbstractGeneratesDataSpecification, spinn_front_end_common.abstract_models.abstract_has_associated_binary.AbstractHasAssociatedBinary, spinn_front_end_common.abstract_models.abstract_provides_outgoing_partition_constraints.AbstractProvidesOutgoingPartitionConstraints, spinn_front_end_common.abstract_models.abstract_binary_uses_simulation_run.AbstractBinaryUsesSimulationRun

A model which will allow events to be injected into a spinnaker machine and converted into multicast packets.

Parameters:
  • n_keys – The number of keys to be sent via this multicast source
  • label – The label of this vertex
  • constraints – Any initial constraints to this vertex
  • board_address – The IP address of the board on which to place this vertex if receiving data, either buffered or live (by default, any board is chosen)
  • receive_port – The port on the board that will listen for incoming event packets (default is to disable this feature; set a value to enable it)
  • receive_sdp_port – The SDP port to listen on for incoming event packets (defaults to 1)
  • receive_tag – The IP tag to use for receiving live events (uses any by default)
  • receive_rate – The estimated rate of packets that will be sent by this source
  • virtual_key – The base multicast key to send received events with (assigned automatically by default)
  • prefix – The prefix to “or” with generated multicast keys (default is no prefix)
  • prefix_type – Whether the prefix should apply to the upper or lower half of the multicast keys (default is upper half)
  • check_keys – True if the keys of received events should be verified before sending (default False)
  • send_buffer_times – An array of arrays of times at which keys should be sent (one array for each key, default disabled)
  • send_buffer_partition_id – The id of the partition containing the edges down which the events are to be sent
  • send_buffer_max_space – The maximum amount of space to use of the SDRAM on the machine (default is 1MB)
  • send_buffer_space_before_notify – The amount of space free in the sending buffer before the machine will ask the host for more data (default setting is optimised for most cases)
  • buffer_notification_ip_address – The IP address of the host that will send new buffers (must be specified if a send buffer is specified or if recording will be used)
  • buffer_notification_port – The port that the host that will send new buffers is listening on (must be specified if a send buffer is specified, or if recording will be used)
  • buffer_notification_tag – The IP tag to use to notify the host about space in the buffer (default is to use any tag)
create_machine_vertex(vertex_slice, resources_required, label=None, constraints=None)[source]

Create a machine vertex from this application vertex

Parameters:
  • vertex_slice – The slice of atoms that the machine vertex will cover
  • resources_required – the resources used by the machine vertex
  • constraints – Constraints to be passed on to the machine vertex
enable_recording(record_buffer_size=1048576, buffer_size_before_receive=16384, time_between_requests=0)[source]
generate_data_specification(spec, placement)[source]
get_binary_file_name()[source]

Get the binary name to be run for vertices of this vertex

get_outgoing_partition_constraints(partition)[source]

Get constraints to be added to the given edge that comes out of this vertex

Parameters:partition – An edge that comes out of this vertex
Returns:A list of constraints
Return type:list of pacman.model.constraints.abstract_constraint.AbstractConstraint
get_resources_used_by_atoms(vertex_slice)[source]

Get the separate resource requirements for a range of atoms

Parameters:vertex_slice (pacman.model.graph.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
Raises:None – this method does not raise any known exception
n_atoms

The number of atoms in the vertex

Returns:The number of atoms
Return type:int
send_buffer_times
class spinnaker_graph_front_end.MachineEdge(pre_vertex, post_vertex, traffic_type=<EdgeTrafficType.MULTICAST: 1>, label=None, traffic_weight=1)[source]

Bases: pacman.model.graphs.machine.abstract_machine_edge.AbstractMachineEdge

A simple implementation of a machine edge

Parameters:
label

The label of the item

Returns:The label
Return type:str
Raises:None – Raises no known exceptions
post_vertex

The vertex at the end of the edge

Return type:pacman.model.graphs.abstract_vertex.AbstractVertex
pre_vertex

The vertex at the start of the edge

Return type:pacman.model.graphs.abstract_vertex.AbstractVertex
traffic_type

The traffic type of the edge

Return type:py:class:pacman.model.graphs.common.edge_traffic_type.EdgeTrafficType
traffic_weight

The amount of traffic expected to go down this edge relative to other edges

spinnaker_graph_front_end.setup(hostname=None, graph_label=None, model_binary_module=None, model_binary_folder=None, database_socket_addresses=None, user_dsg_algorithm=None, n_chips_required=None, extra_pre_run_algorithms=None, extra_post_run_algorithms=None, time_scale_factor=None, machine_time_step=None)[source]
Parameters:
  • hostname (str) – the hostname of the SpiNNaker machine to operate on (over rides the machine_name from the cfg file).
  • graph_label (str) – a human readable label for the graph (used mainly in reports)
  • model_binary_module (python module) – the module where the binary files can be found for the c code that is being used in this application; mutually exclusive with the model_binary_folder.
  • model_binary_folder (str) – the folder where the binary files can be found for the c code that is being used in this application; mutually exclusive with the model_binary_module.
  • database_socket_addresses (list of SocketAddresses) – set of SocketAddresses that need to be added for the database notification functionality. This are over and above the ones used by the LiveEventConnection
  • user_dsg_algorithm (str) – an algorithm used for generating the application data which is loaded onto the machine. if not set, will use the data specification language algorithm required for the type of graph being used.
  • n_chips_required (int) – if you need to be allocated a machine (for spalloc) before building your graph, then fill this in with a general idea of the number of chips you need so that the spalloc system can allocate you a machine big enough for your needs.
  • extra_pre_run_algorithms (list of str) – algorithms which need to be ran after mapping and loading has occurred but before the system has ran. These are plugged directly into the work flow management.
  • extra_post_run_algorithms (list of str) – algorithms which need to be ran after the simulation has ran. These could be post processing of generated data on the machine for example.
spinnaker_graph_front_end.run(duration=None)[source]

Method to support running an application for a number of microseconds

Parameters:duration (int) – the number of microseconds the application should run for
spinnaker_graph_front_end.stop()[source]

Do any necessary cleaning up before exiting. Unregisters the controller

spinnaker_graph_front_end.read_xml_file(file_path)[source]

Reads a xml file and translates it into an application graph and machine graph (if required)

Parameters:file_path – the file path in absolute form
Return type:None
spinnaker_graph_front_end.add_vertex_instance(vertex_to_add)[source]
Parameters:vertex_to_add (instance of AbstractPartitionabelVertex) – vertex instance to add to the graph
Return type:None
spinnaker_graph_front_end.add_vertex(cellclass, cellparams, label=None, constraints=None)[source]
Parameters:
  • cellclass (python object) – the class object for creating the vertex
  • cellparams (dictionary of name and value) – the input params for the class object
  • constraints (list of AbstractConstraint) – any constraints to be applied to the vertex once built
  • label (str) – the label for this vertex
Returns:

the vertex instance object

spinnaker_graph_front_end.add_machine_vertex(cellclass, cellparams, label=None, constraints=None)[source]
Parameters:
  • cellclass (python object) – the class object for creating the vertex
  • cellparams (dictionary of name and value) – the input params for the class object
  • constraints (list of AbstractConstraint) – any constraints to be applied to the vertex once built
  • label (str) – the label for this vertex
Returns:

the vertex instance object

spinnaker_graph_front_end.add_machine_vertex_instance(vertex_to_add)[source]
Parameters:vertex_to_add – the vertex to add to the partitioned graph
Return type:None
spinnaker_graph_front_end.add_edge(cell_type, cellparams, semantic_label, label=None)[source]
spinnaker_graph_front_end.add_application_edge_instance(edge, partition_id)[source]
spinnaker_graph_front_end.add_machine_edge(cellclass, cellparams, semantic_label, label=None)[source]
spinnaker_graph_front_end.add_machine_edge_instance(edge, partition_id)[source]
spinnaker_graph_front_end.add_socket_address(database_ack_port_num, database_notify_host, database_notify_port_num)[source]

adds a socket address for the notification protocol

Parameters:
  • database_ack_port_num – port num to send acknowledgement to
  • database_notify_host – host ip to send notification to
  • database_notify_port_num – port that the external device will be notified on.
spinnaker_graph_front_end.get_txrx()[source]

returns the transceiver used by the tool chain

spinnaker_graph_front_end.get_machine_dimensions()[source]

returns the x and y dimension of the machine

spinnaker_graph_front_end.get_number_of_cores_on_machine()[source]

returns the number of cores on this machine

spinnaker_graph_front_end.has_ran()[source]
spinnaker_graph_front_end.machine_time_step()[source]
spinnaker_graph_front_end.no_machine_time_steps()[source]
spinnaker_graph_front_end.timescale_factor()[source]
spinnaker_graph_front_end.machine_graph()[source]
spinnaker_graph_front_end.application_graph()[source]
spinnaker_graph_front_end.routing_infos()[source]
spinnaker_graph_front_end.placements()[source]
spinnaker_graph_front_end.transceiver()[source]
spinnaker_graph_front_end.graph_mapper()[source]
spinnaker_graph_front_end.buffer_manager()[source]
Returns:the buffer manager being used for loading/extracting buffers
spinnaker_graph_front_end.machine()[source]
spinnaker_graph_front_end.is_allocated_machine()[source]