spinn_front_end_common.data package¶
Submodules¶
spinn_front_end_common.data.fec_data_writer module¶
-
class
spinn_front_end_common.data.fec_data_writer.
FecDataWriter
(state)[source]¶ Bases:
pacman.data.pacman_data_writer.PacmanDataWriter
,spinnman.data.spinnman_data_writer.SpiNNManDataWriter
,spinn_front_end_common.data.FecDataView
See
UtilsDataWriter
.This class is designed to only be used directly by
AbstractSpinnakerBase
and within the Non-PyNN repositories unit tests as all methods are available to subclasses.Parameters: state (DataStatus) – State writer should be in -
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: - PacmanConfigurationException – when both graphs contain vertices
- PacmanConfigurationException – If there is an attempt to add the same vertex more than once
- SpiNNUtilsException – If the graph is currently unavailable
- SimulatorNotSetupException – If called before sim.setup
- SimulatorShutdownException – If called after sim.end
-
clear_notification_protocol
()[source]¶ Closes an existing notification_protocol and sets the value to None.
If no notification_protocol exist this method silently returns.
If the close causes an Exception it is logged and ignored
-
clear_run_steps
()[source]¶ Clears the run step.
get_run_step will go back to returning None
next_run_step will restart at 1
-
increment_current_run_timesteps
(increment)[source]¶ Increment the current_run_timesteps and sets first_machine_time_step.
A None increment signals run_forever
Parameters: increment (int or None) – The timesteps for this do_run loop
-
next_run_step
()[source]¶ Starts or increases the run step count.
Run steps start at 1
Returns: The next step number Return type: int
-
set_allocation_controller
(allocation_controller)[source]¶ Sets the allocation controller variable.
Parameters: allocation_controller (AbstractMachineAllocationController) –
-
set_buffer_manager
(buffer_manager)[source]¶ Sets the Buffer manager variable.
Parameters: buffer_manager (BufferManager) –
-
set_database_file_path
(database_file_path)[source]¶ Sets the database_file_path variable. Possibly to None.
Parameters: database_file_path (str or None) –
-
set_executable_targets
(executable_targets)[source]¶ Sets the executable_targets
Parameters: executable_targets (ExecutableTargets) –
-
set_executable_types
(executable_types)[source]¶ Parameters: executable_types (dict( ExecutableType, CoreSubsets or None)) –
-
set_fixed_routes
(fixed_routes)[source]¶ Parameters: fixed_routes (dict(tuple(int,int), FixedRouteEntry)) –
-
set_gatherer_map
(gatherer_map)[source]¶ Sets the map of (x,y) to Gatherer Vertices.
Parameters: gatherer_map (dict((int, int), DataSpeedUpPacketGatherMachineVertex)) –
-
set_java_caller
(java_caller)[source]¶ Parameters: java_caller (JavaCaller) –
-
set_max_run_time_steps
(max_run_time_steps)[source]¶ Sets the max_run_time_steps value
Parameters: max_run_time_steps (int) – new value
-
set_monitor_map
(monitor_map)[source]¶ Sets the map of (x,y) to Monitor Vertices.
Parameters: monitor_map (dict((int, int), ExtraMonitorSupportMachineVertex)) –
-
set_n_chips_in_graph
(n_chips_in_graph)[source]¶ Sets the number of chips needed by the graph.
Parameters: n_chips_in_graph (int) –
-
set_n_required
(n_boards_required, n_chips_required)[source]¶ Sets (if not None) the number of boards/chips requested by the user.
Parameters:
-
set_notification_protocol
(notification_protocol)[source]¶ Sets the notification_protocol.
Parameters: notification_protocol (NotificationProtocol) –
-
set_system_multicast_routing_data
(data)[source]¶ Sets the system_multicast_routing_data.
These are: data_in_multicast_routing_tables, data_in_multicast_key_to_chip_map, system_multicast_router_timeout_keys
Parameters: data (tuple(MulticastRoutingTables, dict, dict)) – new value
-
set_up_timings
(simulation_time_step_us, time_scale_factor, default_time_scale_factor=None)[source]¶ Set up timings for the simulation.
Parameters: - simulation_time_step_us (int or None) – An explicitly specified time step for the simulation in . If None, the value is read from the configuration
- time_scale_factor (float or None) – An explicitly specified time scale factor for the simulation. If None, the value is read from the configuration
- default_time_scale_factor (float or None) – A back up time scale factor for the simulation. Only used if time_scale_factor parameter and configuration are both None. If None, the value is based on simulation_time_step
-
classmethod
Module contents¶
-
class
spinn_front_end_common.data.
FecDataView
¶ Bases:
pacman.data.pacman_data_view.PacmanDataView
,spinnman.data.spinnman_data_view.SpiNNManDataView
Adds the extra Methods to the View for spinn_front_end_commom level.
See
UtilsDataView
for a more detailed description.This class is designed to only be used directly within non-PyNN repositories as all methods are available to subclasses
-
classmethod
add_database_socket_address
(database_socket_address)[source]¶ Adds a socket address to the list of known addresses.
Parameters: database_socket_address (SocketAddress) – Raises: TypeError – if database_socket_address is not a SocketAddress
-
classmethod
add_database_socket_addresses
(database_socket_addresses)[source]¶ Adds all socket addresses to the list of known addresses.
Parameters: database_socket_addresses (iterable(SocketAddress)) – The addresses to add Raises: TypeError – if database_socket_address is not a iterable of SocketAddress
-
classmethod
add_live_output_vertex
(vertex, partition_id)[source]¶ Add a vertex that is to be output live, and so wants its atom IDs recorded in the database.
Parameters: - vertex (ApplicationVertex) – The vertex to add
- partition_id (str) – The partition to get the IDs of
-
classmethod
add_live_packet_gatherer_parameters
(live_packet_gatherer_params, vertex_to_record_from, partition_ids)[source]¶ Adds parameters for a new LPG if needed, or adds to the tracker for parameters.
Note
If the
ApplicationGraph
is used, the vertex must be anApplicationVertex
. If not, it must be aMachineVertex
.Parameters: - live_packet_gatherer_params (LivePacketGatherParameters) – parameters for an LPG to look for or create
- vertex_to_record_from (AbstractVertex) – the vertex that needs to send to a given LPG
- partition_ids (iterable(str)) – the IDs of the partitions to connect from the vertex
-
classmethod
get_allocation_controller
()[source]¶ Returns the allocation controller if known.
Return type: AbstractMachineAllocationController Raises: SpiNNUtilsException – If the buffer manager unavailable
-
classmethod
get_app_provenance_dir_path
()[source]¶ Returns the path to the directory that holds all application provenance files.
This will be the path used by the last run call or to be used by the next run if it has not yet been called.
Note
In unit-test mode this returns a temporary directory shared by all path methods.
Return type: str Raises: SimulatorNotSetupException – If the simulator has not been setup
-
classmethod
get_buffer_manager
()[source]¶ Returns the buffer manager if known.
Return type: BufferManager Raises: SpiNNUtilsException – If the buffer manager unavailable
-
classmethod
get_current_run_time_ms
()[source]¶ The end of this or the previous do__run loop time in ms.
Syntactic sugar for current_run_timesteps * simulation_time_step_ms
Will be zero if not yet run and not yet in the do_run_loop
Will be zero if in run forever mode
Return type: float
-
classmethod
get_current_run_timesteps
()[source]¶ The end of this or the previous do__run loop time in steps.
Will be zero if not yet run and not yet in the do_run_loop
Will be None if in run forever mode
Return type: int or None
-
classmethod
get_data_in_multicast_key_to_chip_map
()[source]¶ Retrieve the data_in_multicast_key_to_chip_map if known.
Return type: dict Raises: SpiNNUtilsException – If the data_in_multicast_key_to_chip_map is currently unavailable
-
classmethod
get_data_in_multicast_routing_tables
()[source]¶ Retrieve the data_in_multicast_routing_tables if known
Return type: MulticastRoutingTables Raises: SpiNNUtilsException – If the data_in_multicast_routing_tables is currently unavailable
-
classmethod
get_database_file_path
()[source]¶ Will return the database_file_path if set or None if not set or set to None
Return type: str or None
-
classmethod
get_ds_database_path
()[source]¶ Gets the path for the Data Spec database.
Return type: str Raises: SpiNNUtilsException – If the ds_database is currently unavailable
-
classmethod
get_executable_targets
()[source]¶ Binaries to be executed.
Return type: ExecutableTargets Raises: SpiNNUtilsException – If the executable_targets is currently unavailable
-
classmethod
get_executable_types
()[source]¶ Gets the _executable_types if they have been created.
Return type: dict( ExecutableType, CoreSubsets) Raises: SpiNNUtilsException – If the executable_types is currently unavailable
-
classmethod
get_first_machine_time_step
()[source]¶ The start of this or the next do_run loop time in steps.
Will be None if in run forever mode
Return type: int or None
-
classmethod
get_fixed_routes
()[source]¶ Gets the fixed routes if they have been created.
Return type: dict(tuple(int,int), FixedRouteEntry) Raises: SpiNNUtilsException – If the fixed_routes is currently unavailable
-
classmethod
get_gatherer_by_xy
(x, y)[source]¶ The DataSpeedUpPacketGatherMachineVertex for chip (x,y).
Parameters: Return type: Raises: - SpiNNUtilsException – If the gatherers are currently unavailable
- KeyError – If chip (x,y) does not have a monitor
-
classmethod
get_hardware_time_step_ms
()[source]¶ The hardware timestep, in milliseconds.
Syntactic sugar for simulation_time_step_ms * time_scale_factor
Return type: float Raises: SpiNNUtilsException – If the hardware_time_step is currently unavailable
-
classmethod
get_hardware_time_step_us
()[source]¶ The hardware timestep, in microseconds.
Syntactic sugar for simulation_time_step_us * time_scale_factor
Return type: int Raises: SpiNNUtilsException – If the hardware_time_step is currently unavailable
-
classmethod
get_ipaddress
()[source]¶ Gets the IP address of the board with chip 0,0 if it has been set.
Return type: str Raises: SpiNNUtilsException – If the IP address is currently unavailable
-
classmethod
get_java_caller
()[source]¶ Gets the Java_caller.
Return type: str Raises: SpiNNUtilsException – If the java_caller is currently unavailable
-
classmethod
get_json_dir_path
()[source]¶ Returns the path to the directory that holds all JSON files.
This will be the path used by the last run call or to be used by the next run if it has not yet been called.
Note
In unit-test mode this returns a temporary directory shared by all path methods.
Return type: str Raises: SpiNNUtilsException – If the simulation_time_step is currently unavailable
-
classmethod
get_live_packet_recorder_params
()[source]¶ Mapping of live_packet_gatherer_params to a list of tuples (vertex and list of ids)).
Return type: dict(LivePacketGatherParameters, tuple(AbstractVertex, list(str)) Raises: SpiNNUtilsException – If the _live_packet_recorder_params is currently unavailable
-
classmethod
get_max_run_time_steps
()[source]¶ Returns the calculated longest time this or a future run loop could be.
Mainly used to indicate the number of timesteps the vertex can and therefore should reserve memory for
Guaranteed to be positive int if available
Return type: int Raises: SpiNNUtilsException – If the max run time is currently unavailable
-
classmethod
get_monitor_by_xy
(x, y)[source]¶ The ExtraMonitorSupportMachineVertex for chip (x,y).
Parameters: Return type: Raises: - SpiNNUtilsException – If the monitors are currently unavailable
- KeyError – If chip (x,y) does not have a monitor
-
classmethod
get_n_boards_required
()[source]¶ Gets the number of boards requested by the user during setup if known.
Guaranteed to be positive
Return type: int Raises: SpiNNUtilsException – If the n_boards_required is currently unavailable
-
classmethod
get_n_chips_needed
()[source]¶ Gets the number of chips needed, if set.
This will be the number of chips requested by the user during setup, even if this is less that what the partitioner reported.
If the partitioner has run and the user has not specified a number, this will be what the partitioner requested.
Guaranteed to be positive if set
Return type: int Raises: SpiNNUtilsException – If data for n_chips_needed is not available
-
classmethod
get_n_database_socket_addresses
()[source]¶ Number of registered database_socket_addresses.
Return type: int
-
classmethod
get_n_gathers
()[source]¶ Number of DataSpeedUpPacketGatherMachineVertex(s).
Return type: int Raises: SpiNNUtilsException – If the gathers are currently unavailable
-
classmethod
get_n_monitors
()[source]¶ Number of ExtraMonitorSupportMachineVertexs.
Return type: int Raises: SpiNNUtilsException – If the monitors are currently unavailable
-
classmethod
get_next_ds_references
(number)[source]¶ Get a a list of unigue ds references
These will be Unigue since the last hard reset
Parameters: number – number of values in the list Return type: list(inrt)
-
classmethod
get_next_none_labelled_edge_number
()[source]¶ Returns an unused number for labelling an unlabelled edge.
Return type: int
-
classmethod
get_next_sync_signal
()[source]¶ Returns alternately Signal.SYNC0 and Signal.SYNC1.
Return type: Signal
-
classmethod
get_notification_protocol
()[source]¶ The notification protocol handler.
Return type: NotificationProtocol Raises: SpiNNUtilsException – If the notification_protocol is currently unavailable
-
classmethod
get_provenance_dir_path
()[source]¶ Returns the path to the directory that holds all provenance files.
This will be the path used by the last run call or to be used by the next run if it has not yet been called.
Note
In unit-test mode this returns a temporary directory shared by all path methods.
Return type: str Raises: SpiNNUtilsException – If the simulation_time_step is currently unavailable
-
classmethod
get_reset_number
()[source]¶ Get the number of times a reset has happened.
Only counts the first reset after each run.
So resets that are first soft then hard are ignored. Double reset calls without a run and resets before run are ignored.
Reset numbers start at zero
Return type: int Raises: SpiNNUtilsException – If the run_number is currently unavailable
-
classmethod
get_reset_str
()[source]¶ Get the number of times a reset has happened as a string.
An empty string is returned if the system has never been reset (i.e., the reset number is 0)
Only counts the first reset after each run.
So resets that are first soft then hard are ignored. Double reset calls without a run and resets before run are ignored.
Reset numbers start at zero
Raises: SpiNNUtilsException – If the run_number is currently unavailable Return type: str
-
classmethod
get_run_number
()[source]¶ Get the number of this or the next run.
Run numbers start at 1
Return type: int Raises: SpiNNUtilsException – If the run_number is currently unavailable
-
classmethod
get_run_step
()[source]¶ Get the auto pause and resume step currently running if any.
If and only if currently in an auto pause and resume loop this will report the number of the step. Starting at 1
In most cases this will return None, including when running without steps.
Return type: None or int
-
classmethod
get_simulation_time_step_ms
()[source]¶ The simulation time step, in milliseconds.
Syntactic sugar for simulation_time_step_us / 1000.
Return type: float Raises: SpiNNUtilsException – If the simulation_time_step_ms is currently unavailable
-
classmethod
get_simulation_time_step_per_ms
()[source]¶ The number of simulation time steps in a millisecond.
Syntactic sugar for 1000 / simulation_time_step_us
Return type: float Raises: SpiNNUtilsException – If the simulation_time_step is currently unavailable
-
classmethod
get_simulation_time_step_per_s
()[source]¶ The number of simulation time steps in a seconds.
Syntactic sugar for 1,000,000 / simulation_time_step_us
Return type: float Raises: SpiNNUtilsException – If the simulation_time_step is currently unavailable
-
classmethod
get_simulation_time_step_s
()[source]¶ The simulation timestep, in seconds.
Syntactic sugar for simulation_time_step() / 1,000,000.
Return type: float Raises: SpiNNUtilsException – If the simulation_time_step_ms is currently unavailable
-
classmethod
get_simulation_time_step_us
()[source]¶ The simulation timestep, in microseconds.
Previously known as “machine_time_step”
Return type: int Raises: SpiNNUtilsException – If the simulation_time_step_us is currently unavailable
-
classmethod
get_system_multicast_router_timeout_keys
()[source]¶ Retrieve the system_multicast_router_timeout_keys if known.
Return type: dict Raises: SpiNNUtilsException – If the system_multicast_router_timeout_keys is currently unavailable
-
classmethod
get_system_provenance_dir_path
()[source]¶ Returns the path to the directory that holds system provenance files.
This will be the path used by the last run call or to be used by the next run if it has not yet been called.
Note
In unit-test mode this returns a temporary directory shared by all path methods.
Return type: str Raises: SpiNNUtilsException – If the simulation_time_step is currently unavailable
-
classmethod
get_time_scale_factor
()[source]¶ Return type: Raises: - SpiNNUtilsException – If the time_scale_factor is currently unavailable
- SpiNNUtilsException – If the time_scale_factor is currently unavailable
-
classmethod
get_timestamp_dir_path
()[source]¶ Returns path to existing time-stamped directory in the reports directory.
Note
In unit-test mode this returns a temporary directory shared by all path methods.
Return type: str Raises: SpiNNUtilsException – If the simulation_time_step is currently unavailable
-
classmethod
has_allocation_controller
()[source]¶ Reports if an AllocationController object has already been set.
Returns: True if and only if an AllocationController has been added and not reset. Return type: bool
-
classmethod
has_buffer_manager
()[source]¶ Reports if a BufferManager object has already been set.
Returns: True if and only if a BufferManager has been added and not reset Return type: bool
-
classmethod
has_ipaddress
()[source]¶ Detects if the IP address of the board with chip 0,0 is known.
Return type: bool
-
classmethod
has_java_caller
()[source]¶ Reports if there is a Java called that can be used.
Equivalent to get_config_bool(“Java”, “use_java”) as the writer will have created the caller during setup
The behaviour when Mocked is currently to always return False.
Return type: bool
-
classmethod
has_live_packet_recorder_params
()[source]¶ Reports if there are live_packet_recorder_params.
If True the live_packet_recorder_params not be empty
Return type: bool
-
classmethod
has_max_run_time_steps
()[source]¶ Indicates if max_run_time_steps is currently available.
Return type: bool
-
classmethod
has_monitors
()[source]¶ Detect is ExtraMonitorSupportMachineVertex(s) have been created.
Return type: bool
-
classmethod
has_n_boards_required
()[source]¶ Reports if a user has sets the number of boards requested during setup.
Return type: bool Raises: SpiNNUtilsException – If n_boards_required is not set or set to None
-
classmethod
has_n_chips_needed
()[source]¶ Detects if the number of chips needed has been set.
This will be the number of chips requested by the use during setup or what the partitioner requested.
Return type: bool
-
classmethod
has_time_step
()[source]¶ Check if any/all of the time_step values are known.
True When all simulation/hardware_time_step methods are known False when none of the simulation/hardware_time_step values are known. There is never a case when some are known and others not
Return type: bool
-
classmethod
iterate_database_socket_addresses
()[source]¶ Iterates over the registered database_socket_addresses.
Return type: iterable(SocketAddress)
-
classmethod
iterate_gather_items
()[source]¶ Iterates over the (x,y) and DataSpeedUpPacketGatherMachineVertex.
get_n_gathers returns the number of items this iterable will provide
Return type: iterable(tuple(tuple(int,int), DataSpeedUpPacketGatherMachineVertex)) Raises: SpiNNUtilsException – If the gathers are currently unavailable
-
classmethod
iterate_gathers
()[source]¶ Iterates over the DataSpeedUpPacketGatherMachineVertex(s).
Return type: iterable(DataSpeedUpPacketGatherMachineVertex) Raises: SpiNNUtilsException – If the gathers are currently unavailable
-
classmethod
iterate_live_output_vertices
()[source]¶ Get an iterator over the live output vertices and partition IDs.
Return type: iterable(tuple(ApplicationVertex, str))
-
classmethod
iterate_monitor_items
()[source]¶ Iterates over the (x,y) and ExtraMonitorSupportMachineVertex.
get_n_monitors returns the number of items this iterable will provide.
Return type: iterable(tuple(tuple(int,int), ExtraMonitorSupportMachineVertex)) Raises: SpiNNUtilsException – If the monitors are currently unavailable
-
classmethod
iterate_monitors
()[source]¶ Iterates over the ExtraMonitorSupportMachineVertex(s).
Return type: iterable(ExtraMonitorSupportMachineVertex) Raises: SpiNNUtilsException – If the monitors are currently unavailable
-
classmethod