spinn_front_end_common.data package

Module contents

class spinn_front_end_common.data.FecDataView[source]

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 an ApplicationVertex. If not, it must be a MachineVertex.

Parameters:
  • live_packet_gatherer_params (LivePacketGatherParameters) – params to look for a LPG
  • 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 app 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 unittest mode this returns a tempdir 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]

Retreive 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_dsg_targets()[source]

Data Spec targets database.

Return type:DsSqlliteDatabase
Raises:SpiNNUtilsException – If the dsg_targets 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:
  • x (int) – X coordinate of chip
  • y (int) – Y coordinate of chip
Return type:

DataSpeedUpPacketGatherMachineVertex

Raises:
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 unittest mode this returns a tempdir 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:
  • x (int) – X coordinate of chip
  • y (int) – Y coordinate of chip
Return type:

ExtraMonitorSupportMachineVertex

Raises:
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_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 unittest mode this returns a tempdir 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 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 unittest mode this returns a tempdir 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:

int or float

Raises:
classmethod get_timestamp_dir_path()[source]

Returns path to existing timestamped director in the reports directory.

Note

In unittest mode this returns a tempdir 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_scale_factor()[source]
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