spinn_front_end_common.interface.interface_functions package

Module contents


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

spinn_front_end_common.interface.interface_functions.application_runner(runtime, time_threshold, run_until_complete)[source]

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

  • runtime (int) –
  • time_threshold (int) –
  • run_until_complete (bool) –



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


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))

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

Parameters:n_sync_steps (int or None) –

Builds the notification protocol for GUI and external device interaction.


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

Return type:PowerUsed
Parameters:runtime (int) –
Returns:where the database is located
Return type:str

Reloads DSG regions where needed.


Converts the power usage information into provenance data.

Parameters:power_used (PowerUsed) – The computed basic power consumption information

Execute the data specs for all non-system targets.


Execute the data specs for all system targets.

class spinn_front_end_common.interface.interface_functions.FindApplicationChipsUsed[source]

Bases: object

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


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)

Extracts binaries to be executed.

Return type:ExecutableTargets
Parameters:placement_order (list(Placement)) – the optional order in which placements should be examined
Return type:DsSqlliteDatabase
Raises:ConfigurationException – If the DSG asks to use more SDRAM than is available.

Gets provenance information from the graph.


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

Entry point when using the PACMANAlgorithmExecutor.

Returns:compressed routing table entries
Return type:MulticastRoutingTables

Adds chip power monitors into a given graph.

param Placements placements:


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

Returns:vertex to Ethernet connection map, list of extra_monitor_vertices, vertex_to_chip_map
Return type:tuple( dict(tuple(int,int),DataSpeedUpPacketGatherMachineVertex), list(ExtraMonitorSupportMachineVertex), dict(tuple(int,int),ExtraMonitorSupportMachineVertex))

Split any LPG vertices found.

  • app_graph (ApplicationGraph) – The application graph
  • machine (Machine) – the SpiNNaker machine as discovered
  • system_placements (Placements) – existing placements to be added to

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


Load a set of fixed routes onto a SpiNNaker machine.

Parameters:transceiver (Transceiver) –

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


Builds a localised TDMA.

Builds a localised TDMA which allows a number of machine vertices of the same application vertex to fire at the same time. Ensures that other application vertices are not firing at the same time. Verifies if the total time required fits into the time scale factor and machine time step. Below are text diagrams to show how this works in principle.

Figure 1: bits needed to figure out time between spikes. Cores 0-4 have 2 atoms, core 5 has 1 atom:

#        0     1       2      3       4      5
# T2-[   X                    X
#    |         X                      X
#    |                 X                     X
#    [  X                     X
#       |------| T
#              X                      X
#                      X <- T3

T = time_between_cores
T2 = time_between_phases
T3 = end of TDMA (equiv of ((n_phases + 1) * T2))
cutoff = 2. n_phases = 3 max_atoms = 2

Constants etc just to get into head:

  • clock cycles = 200 Mhz = 200 = sv->cpu_clk
  • 1ms = 200000 for timer 1. = clock cycles
  • 200 per microsecond
  • machine time step = microseconds already.
  • __time_between_cores = microseconds.

Figure 2: initial offset (used to try to interleave packets from other app verts into the TDMA without extending the overall time, and trying to stop multiple packets in flight at same time).

Figure 3: bits needed to figure out time between spikes. Cores 0-4 have 2 atoms, core 5 has 1 atom:

#        0  .5   1   .5    2   .5   3    .5   4   .5   5  .5
# T2-[   X   Y                      X     Y
#    |           X   Y                        X    Y
#    |                     X    Y                      X   Y
#    [  X    Y                      X     Y
#       |-------| T
#               X    Y                        X    Y
#               |----| T4
#                   T3 ->  X    Y

T4 is the spreader between populations.
X is pop0 firing,
Y is pop1 firing

Discovers where applications of particular types need to be launched.

spinn_front_end_common.interface.interface_functions.machine_generator(bmp_details, board_version, auto_detect_bmp, scamp_connection_data, reset_machine_on_start_up)[source]

Makes a transceiver and a machine object.

  • 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) –
  • allocation_controller (MachineAllocationController) – The allocation controller; in some cases, we delegate the creation of the transceiver to it.

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, placements)[source]

Gets provenance information from placements.

  • 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

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


Reads compressed routing tables from a SpiNNaker machine.

Return type:MulticastRoutingTables

Initialises the routers.


This does not load any routes into them.

Parameters:transceiver (Transceiver) –

Loads routes into initialised routers.

Parameters:router_tables (MulticastRoutingTables) –
spinn_front_end_common.interface.interface_functions.spalloc_allocator(bearer_token: str = None) → Tuple[str, int, None, bool, bool, Dict[Tuple[int, int], str], None, spinn_front_end_common.abstract_models.impl.machine_allocation_controller.MachineAllocationController][source]

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
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)

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

Returns:routing tables, destination-to-key map, board-locn-to-timeout-key map
Return type:tuple(MulticastRoutingTables, dict(tuple(int,int),int), dict(tuple(int,int),int))

Loads tags onto the machine.


Generates a virtual machine with given dimensions and configuration.

Returns:The virtual machine.
Return type:Machine
Raises:Exception – If given bad arguments

Add command senders