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 None PyNN repositories unittests as all methods are available to subclasses

Creates a new writer clearing all previous data and sets the state

Parameters:state (Data_Status) – State writer should be in
classmethod add_vertex(vertex)[source]

Adds an Application vertex to the user graph

Semantic 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

finish_run()[source]

Puts all data into the state expected after sim.run ends

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 – The timesteps for this do_run loop
Rtype increment:
 int or None
next_run_step()[source]

Starts or increases the run step count.

Run steps start at 1

Returns:The next step number
Return type:int
reset_sync_signal()[source]

Retruns the snyc signal to the default value

set_allocation_controller(allocation_controller)[source]

Sets the allocation controller variable

Parameters:buffer_manager (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

set_dsg_targets(dsg_targets)[source]

Sets the data Spec targets database

set_executable_targets(executable_targets)[source]

Sets the executable_targets

set_executable_types(executable_types)[source]
set_fixed_routes(fixed_routes)[source]
set_gatherer_map(gatherer_map)[source]

Sets the map of x,y to Gatherer Vertices

set_ipaddress(ipaddress)[source]
Parameters:ipaddress (str) –
set_java_caller(java_caller)[source]
Parameters:java_caller (JavaCaller) –
set_live_packet_gatherer_parameters(params)[source]

testing method will not work outside of mock

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

set_n_chips_in_graph(n_chips_in_graph)[source]

Sets the number of chips needed by the graph

Parameters:n_chips_in_graph
Returns:
set_n_required(n_boards_required, n_chips_required)[source]

Sets (if not None) the number of boards/chips requested by the user

Parameters:
  • n_boards_required (int or None) – None or the number of boards requested by the user
  • n_chips_required (int or None) – None or the number of chips requested by the user
set_notification_protocol(notification_protocol)[source]

Sets the notification_protocol

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:MulticastRoutingTables, dict) data (tuple(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 config
  • time_scale_factor (float or None) – An explicitly specified time scale factor for the simulation. If None, the value is read from the config
  • default_time_scale_factor (float or None) – A back up time scale factor for the simulation. Only used if time_scale_factor param and cfg are both None If None, the value is based on simulation_time_step

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 none 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)) –
Raises:TypeError – if database_socket_address is not a iterable(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 Application Graph is used the vertex must be an Application Vertex 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

Rtpye: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.

Semantic 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

Rtpye: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

Rtpye:int or None
classmethod get_data_in_multicast_key_to_chip_map()[source]

Retreive 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

Rtpye: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]

DataSpeedUpPacketGatherMachineVertex for core x, y

Return type:

DataSpeedUpPacketGatherMachineVertex

Raises:
classmethod get_hardware_time_step_ms()[source]

The hardware timestep, in milliseconds

Semantic 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

Semantic 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 ipaddress of the board with chip 0,0 if it has been set

Return type:str
Raises:SpiNNUtilsException – If the ipaddress 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

Rtpye: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(live_packet_gatherer_params, (vertex, 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 ued to indicate the number of timesteps the vertex can and therefore should reserve memry 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]

ExtraMonitorSupportMachineVertex for core x, y

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 a none_labelled_edge

Rtpye int:
classmethod get_next_sync_signal()[source]

Returns alteratively Signal.SYNC0 and Signal.SYNC1

Rtpye ~spinnman.messages.scp.enums.signal.Signal:
 
classmethod get_notification_protocol()[source]

binaries to be executed.

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

Rtpye: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

Returns:
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 (ie 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
classmethod get_run_number()[source]

Get the number of this or the next run.

Run numbers start at 1

Returns:
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

Semantic 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

Semantic sugar for 1000 / simulation_time_step_us

Return type:float
Raises:SpiNNUtilsExceptionn – 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

Semantic 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

Semantic 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 know 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]

Retreive 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

Rtpye:str
Raises:SpiNNUtilsException – If the simulation_time_step is currently unavailable
classmethod get_time_scale_factor()[source]
Return type:

int or float

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 timestamped director in the reports directory

..note: In unittest mode this returns a tempdir shared by all path methods

Rtpye: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 ipaddress of the board with chip 0,0 if known

Returns:
classmethod has_java_caller()[source]

Reports if there is a Java called that can be used.

Equivellent 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

:rtype 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:set((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