These pages document the python code for the SpiNNakerGraphFrontEnd module which is part of the SpiNNaker Project.
This code depends on SpiNNUtils, SpiNNMachine, SpiNNMan, PACMAN, SpiNNFrontEndCommon (Combined_documentation).
SpiNNakerGraphFrontEnd¶
The API for running SpiNNaker simulations based on a basic (non-neural) graph.
The general usage pattern for this API something like is:
import spinnaker_graph_front_end as gfe
# Uses information from your configuration file
# You might need to specify how many SpiNNaker boards to allocate
gfe.setup()
# Make the bits that do the computation
for each vertex to add:
gfe.add_vertex_instance(vertex)
# Connect them together so computations are coordinated
for each edge to add:
gfe.add_edge_instance(edge)
# Actually plan and run the simulation
gfe.run(number_of_steps)
# Get the results back; what this means can be complex
for each vertex:
results += vertex.retrieve_relevant_results()
# Shut everything down
# Only your retrieved results really exist after this
gfe.stop()
# Analyse/render the results; totally application-specific!
It is possible to use GFE-style vertices in a neural graph (e.g., to simulate the external world). Talk to the SpiNNaker team for more details.
- class spinnaker_graph_front_end.ReverseIpTagMultiCastSource(n_keys: int, label: str | None = None, max_atoms_per_core: int | Tuple[int, ...] | None = 9223372036854775807, receive_port: int | None = None, receive_sdp_port: int = 1, receive_tag: IPTag | None = None, receive_rate: int = 10, virtual_key: int | None = None, prefix: int | None = None, prefix_type: EIEIOPrefix | None = None, check_keys: bool = False, send_buffer_times: ndarray | List[ndarray] | None = None, reserve_reverse_ip_tag: bool = False, splitter: AbstractSplitterCommon | None = None)[source]
For full documentation see
ReverseIpTagMultiCastSource.- Parameters:
n_keys – The number of keys to be sent via this multicast source
label – The label of this vertex
max_atoms_per_core – The max number of atoms that can be placed on a core for each dimension, used in partitioning. If the vertex is n-dimensional, with n > 1, the value must be a tuple with a value for each dimension. If it is single-dimensional the value can be a 1-tuple or an int.
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)
reserve_reverse_ip_tag – Extra flag for input without a reserved port
splitter – the splitter object needed for this vertex
- spinnaker_graph_front_end.add_edge_instance(edge: ApplicationEdge, partition_id: str) None[source]
Add an edge to the unpartitioned graph.
- Parameters:
edge – The edge to add.
partition_id – The ID of the partition that the edge belongs to.
- spinnaker_graph_front_end.add_socket_address(database_ack_port_num: int | None, database_notify_host: str | None, database_notify_port_num: int | None) None[source]
Add a socket address for the notification protocol.
- Parameters:
database_ack_port_num – port number 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.add_vertex_instance(vertex_to_add: ApplicationVertex) None[source]
Add an existing application vertex to the unpartitioned graph.
- Parameters:
vertex_to_add – vertex instance to add to the graph
- spinnaker_graph_front_end.buffer_manager() BufferManager[source]
- Returns:
The buffer manager being used for loading/extracting buffers.
- spinnaker_graph_front_end.get_number_of_available_cores_on_machine() int[source]
- Returns:
The number of cores on this machine that are available to the
simulation.
- spinnaker_graph_front_end.has_ran() bool[source]
- Returns:
True if and only if the simulation has already run.
- spinnaker_graph_front_end.is_allocated_machine() bool[source]
- Returns:
True if and only if a machine is allocated.
- spinnaker_graph_front_end.machine() Machine[source]
- Returns:
The model of the attached/allocated machine.
- spinnaker_graph_front_end.placements() Never[source]
Get the placements.
Deprecated since version 7.0: No Longer supported! Use View iterate_placements instead
Instead of:
front_end.placements().placements
Use:
FecDataView.iterate_placemements()
FecDataViewcan be imported from spinn_front_end_common.data
- spinnaker_graph_front_end.routing_infos() RoutingInfo[source]
- Returns:
The information about how messages are routed on the machine.
- spinnaker_graph_front_end.run(duration: int | None = None) None[source]
Run a simulation for a number of microseconds.
- Parameters:
duration – the number of microseconds the application code should run for
- spinnaker_graph_front_end.setup(model_binary_module: ModuleType | None = None, model_binary_folder: str | None = None, database_socket_addresses: Iterable[SocketAddress] | None = (), n_chips_required: int | None = None, n_boards_required: int | None = None, time_scale_factor: int | None = None, *, timestep: int | None = None) None[source]
Set up a graph, ready to have vertices and edges added to it, and the simulator engine that will execute the graph.
Note
This must be called before the other functions in this API.
- Parameters:
model_binary_module – the Python module where the binary files (
.aplx) can be found for the compiled C code that is being used in this application; mutually exclusive with themodel_binary_folder.model_binary_folder – 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 – set of SocketAddresses to be added for the database notification system. These are over and above the ones used by the
LiveEventConnectionn_chips_required – Deprecated! Use
n_boards_requiredinstead. Must beNoneifn_boards_requiredspecified.n_boards_required – 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 boards you need so that the spalloc system can allocate you a machine big enough for your needs.
time_scale_factor – multiplicative factor to the machine time step (does not affect the models accuracy)
timestep – the time step of the simulations in microseconds; if None, the configuration value is used
- Raises:
ConfigurationException – if mutually exclusive options are given.
- spinnaker_graph_front_end.stop() None[source]
Do any necessary cleaning up before exiting. Unregisters the controller.
Contents: