spinn_front_end_common.interface.interface_functions package

Submodules

spinn_front_end_common.interface.interface_functions.host_no_bitfield_router_compression module

class spinn_front_end_common.interface.interface_functions.host_no_bitfield_router_compression.Compression(binary_path: str, progress_text: str, result_register: UserRegister)[source]

Bases: object

Compression algorithm implementation that uses a on-chip router compressor in order to parallelise.

Parameters:
  • binary_path (str) – What binary to run

  • machine (Machine) – The machine model

  • progress_text (str) – Text to use in progress bar

  • result_register (int) – number of the user register to check for the result code

compress() None[source]

Apply the on-machine compression algorithm.

Raises:

SpinnFrontEndException – If compression fails

spinn_front_end_common.interface.interface_functions.host_no_bitfield_router_compression.ordered_covering_compression() None[source]

Load routing tables and compress then using the unordered Algorithm.

To the best of our knowledge this is the same algorithm as mundy_on_chip_router_compression(), except this one is still buildable and can be maintained.

Raises:

SpinnFrontEndException – If compression fails

spinn_front_end_common.interface.interface_functions.host_no_bitfield_router_compression.pair_compression() None[source]

Load routing tables and compress then using the Pair Algorithm.

See pacman/operations/router_compressors/pair_compressor.py which is the exact same algorithm implemented in Python.

Raises:

SpinnFrontEndException – If compression fails

Module contents

class spinn_front_end_common.interface.interface_functions.FindApplicationChipsUsed

Bases: object

Builds a set of stats on how many chips were used for application cores.

__call__(placements: Placements) Tuple[int, int, int, float][source]

Finds how many application chips there were and the cost on each chip

Parameters:

placements (Placements) – placements

Returns:

a tuple with 4 elements.

  1. how many chips were used

  2. the max application cores on any given chip

  3. the lowest number of application cores on any given chip

  4. the average number of application cores on any given chip

Return type:

tuple(int,int,int,float)

spinn_front_end_common.interface.interface_functions.add_command_senders(system_placements: Placements) List[CommandSender]

Add command senders

Returns:

The command senders that were added

Return type:

list(CommandSender)

spinn_front_end_common.interface.interface_functions.application_finisher() None

Handles finishing the running of an application, collecting the status of the cores that the application was running on.

Raises:

ExecutableFailedToStopException

spinn_front_end_common.interface.interface_functions.application_runner(runtime: float | None, time_threshold: float | None, run_until_complete: bool)

Ensures all cores are initialised correctly, ran, and completed successfully.

Parameters:
  • runtime (int) –

  • time_threshold (int) –

  • run_until_complete (bool) –

Raises:

ConfigurationException

spinn_front_end_common.interface.interface_functions.chip_io_buf_clearer() None

Clears the logging output buffer of an application running on a SpiNNaker machine.

spinn_front_end_common.interface.interface_functions.chip_io_buf_extractor() Tuple[Sequence[str], Sequence[str]]

Extract the logging output buffers from the machine, and separates lines based on their prefix.

Returns:

error_entries, warn_entries

Return type:

tuple(list(str),list(str))

spinn_front_end_common.interface.interface_functions.chip_provenance_updater(all_core_subsets: CoreSubsets)

Forces all cores to generate provenance data, and then exit.

Parameters:

all_core_subsets (CoreSubsets) –

spinn_front_end_common.interface.interface_functions.chip_runtime_updater(n_sync_steps: int)

Updates the runtime of an application running on a SpiNNaker machine.

Parameters:

n_sync_steps (int or None) –

spinn_front_end_common.interface.interface_functions.compute_energy_used() PowerUsed

This algorithm does the actual work of computing energy used by a simulation (or other application) running on SpiNNaker.

Return type:

PowerUsed

spinn_front_end_common.interface.interface_functions.create_notification_protocol() NotificationProtocol

Builds the notification protocol for GUI and external device interaction.

Return type:

NotificationProtocol

spinn_front_end_common.interface.interface_functions.database_interface(runtime: float | None) str | None
Parameters:

runtime (int) –

Returns:

where the database is located, if one is made

Return type:

str or None

spinn_front_end_common.interface.interface_functions.energy_provenance_reporter(power_used: PowerUsed)

Converts the power usage information into provenance data.

Parameters:

power_used (PowerUsed) – The computed basic power consumption information

spinn_front_end_common.interface.interface_functions.graph_binary_gatherer() ExecutableTargets

Extracts binaries to be executed.

Return type:

ExecutableTargets

spinn_front_end_common.interface.interface_functions.graph_data_specification_writer(placement_order=None)
Parameters:

placement_order (list(Placement)) – the optional order in which placements should be examined

Returns:

Path to DSG targets database

Return type:

str

Raises:

ConfigurationException – If the DSG asks to use more SDRAM than is available.

spinn_front_end_common.interface.interface_functions.graph_provenance_gatherer() None

Gets provenance information from the graph.

spinn_front_end_common.interface.interface_functions.hbp_allocator(total_run_time: float | None) Tuple[str, int, str | None, bool, bool, None, MachineAllocationController]

Request a machine from the HBP remote access server that will fit a number of chips.

Parameters:

total_run_time (int) – The total run time to request

Returns:

machine name, machine version, BMP details (if any), reset on startup flag, auto-detect BMP, SCAMP connection details, boot port, allocation controller

Return type:

tuple(str, int, object, bool, bool, object, object, MachineAllocationController)

Raises:

PacmanConfigurationException – If neither n_chips or n_boards provided

spinn_front_end_common.interface.interface_functions.host_based_bit_field_router_compressor() MulticastRoutingTables

Entry point when using the PACMANAlgorithmExecutor.

Returns:

compressed routing table entries

Return type:

MulticastRoutingTables

spinn_front_end_common.interface.interface_functions.insert_chip_power_monitors_to_graphs(placements: Placements)

Adds chip power monitors into a given graph.

Parameters:

placements (Placements) –

spinn_front_end_common.interface.interface_functions.insert_extra_monitor_vertices_to_graphs(placements: Placements) Tuple[Dict[Chip, DataSpeedUpPacketGatherMachineVertex], Dict[Chip, ExtraMonitorSupportMachineVertex]]

Inserts the extra monitor vertices into the graph that correspond to the extra monitor cores required.

Parameters:

placements (Placements) –

Returns:

mapping from Ethernet-enabled chip locations to their gatherer, mapping from all chip locations to their extra monitor

Return type:

tuple( dict(Chip,DataSpeedUpPacketGatherMachineVertex), dict(Chip,ExtraMonitorSupportMachineVertex))

spinn_front_end_common.interface.interface_functions.load_app_images() None

Go through the executable targets and load each binary to everywhere and then send a start request to the cores that actually use it.

spinn_front_end_common.interface.interface_functions.load_application_data_specs() None

Load the data specs for all non-system targets.

spinn_front_end_common.interface.interface_functions.load_fixed_routes() None

Load the set of fixed routes onto a SpiNNaker machine.

spinn_front_end_common.interface.interface_functions.load_sys_images() None

Go through the executable targets and load each binary to everywhere and then send a start request to the cores that actually use it.

spinn_front_end_common.interface.interface_functions.load_system_data_specs() None

Load the data specs for all system targets.

spinn_front_end_common.interface.interface_functions.locate_executable_start_type() Dict[ExecutableType, CoreSubsets]

Discovers where applications of particular types need to be launched.

spinn_front_end_common.interface.interface_functions.machine_generator(bmp_details: str | None, board_version: int | None, auto_detect_bmp: bool, scamp_connection_data: Dict[Tuple[int, int], str] | None, reset_machine_on_start_up: bool) Tuple[Machine, Transceiver]

Makes a transceiver and a machine object.

Parameters:
  • bmp_details (str) – the details of the BMP connections

  • board_version (int) – the version of the boards being used within the machine (1, 2, 3, 4 or 5)

  • auto_detect_bmp (bool) – Whether the BMP should be automatically determined

  • scamp_connection_data (dict((int,int), str) or None) – Job.connection dict, a String SC&MP connection data or None

  • reset_machine_on_start_up (bool) –

Returns:

Transceiver, and description of machine it is connected to

Return type:

tuple(Machine, Transceiver)

spinn_front_end_common.interface.interface_functions.placements_provenance_gatherer(n_placements: int, placements: Iterable[Placement])

Gets provenance information from the specified placements.

Parameters:
  • n_placements (int) – Number of placements to gather

  • placements (iterator(Placement)) – The placements of the vertices to gather data form. May not be all placements so don’t use View

spinn_front_end_common.interface.interface_functions.profile_data_gatherer() None

Gets all the profiling data recorded by vertices and writes it to files.

spinn_front_end_common.interface.interface_functions.read_routing_tables_from_machine() MulticastRoutingTables

Reads compressed routing tables from a SpiNNaker machine.

Return type:

MulticastRoutingTables

spinn_front_end_common.interface.interface_functions.reload_dsg_regions() None

Reloads DSG regions where needed.

spinn_front_end_common.interface.interface_functions.router_provenance_gatherer() None

Gathers diagnostics from the routers.

spinn_front_end_common.interface.interface_functions.routing_setup() None

Initialises the routing diagnostic filters.

Note

This does not load any routes into them.

spinn_front_end_common.interface.interface_functions.routing_table_loader(router_tables: MulticastRoutingTables)

Loads routes into initialised routers.

Parameters:

router_tables (MulticastRoutingTables) –

spinn_front_end_common.interface.interface_functions.sdram_outgoing_partition_allocator() None

Goes through all vertices to see if sdram has to be allocated.

spinn_front_end_common.interface.interface_functions.spalloc_allocator(bearer_token: str | None = None, group: str | None = None, collab: str | None = None, nmpi_job: int | str | None = None, nmpi_user: str | None = None) Tuple[str, int, None, bool, bool, Dict[Tuple[int, int], str], MachineAllocationController]

Request a machine from a SPALLOC server that will fit the given number of chips.

Parameters:
  • bearer_token (str or None) – The bearer token to use

  • group (str or None) – The group to associate with or None for no group

  • collab (str or None) – The collab to associate with or None for no collab

  • nmpi_job (str or None) – The NMPI Job to associate with or None for no job

  • nmpi_user (str or None) – The NMPI username to associate with or None for no user

Returns:

host, board version, BMP details, reset on startup flag, auto-detect BMP flag, board address map, allocation controller

Return type:

tuple(str, int, object, bool, bool, dict(tuple(int,int),str), MachineAllocationController)

spinn_front_end_common.interface.interface_functions.split_lpg_vertices(system_placements: Placements)

Split any LPG vertices found.

Parameters:

system_placements (Placements) – existing placements to be added to

spinn_front_end_common.interface.interface_functions.system_multicast_routing_generator() Tuple[MulticastRoutingTables, Dict[Tuple[int, int], int], Dict[Tuple[int, int], int]]

Generates routing table entries used by the data-in processes with the extra monitor cores.

Returns:

routing tables, destination-to-key map, board-location-to-timeout-key map

Return type:

tuple(MulticastRoutingTables, dict(tuple(int,int),int), dict(tuple(int,int),int))

spinn_front_end_common.interface.interface_functions.tags_loader() None

Loads tags onto the machine.

spinn_front_end_common.interface.interface_functions.virtual_machine_generator() Machine

Generates a virtual machine with given dimensions and configuration.

Returns:

The virtual machine.

Return type:

Machine

Raises:

Exception – If given bad arguments