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, progress_text, result_register)[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()[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()[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()[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

spinn_front_end_common.interface.interface_functions.machine_bit_field_router_compressor module

spinn_front_end_common.interface.interface_functions.machine_bit_field_router_compressor.SIZE_OF_SDRAM_ADDRESS_IN_BYTES = 148

sdram allocation for addresses

spinn_front_end_common.interface.interface_functions.machine_bit_field_router_compressor.machine_bit_field_ordered_covering_compressor(compress_as_much_as_possible=False)[source]

compression with bit field and ordered covering

Parameters:compress_as_much_as_possible (bool) – whether to compress as much as possible
Returns:where the compressors ran
spinn_front_end_common.interface.interface_functions.machine_bit_field_router_compressor.machine_bit_field_pair_router_compressor(compress_as_much_as_possible=False)[source]

compression with bit field and ordered covering

Parameters:compress_as_much_as_possible (bool) – whether to compress as much as possible
Returns:where the compressors ran

Module contents

spinn_front_end_common.interface.interface_functions.application_finisher()

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, time_threshold, run_until_complete)

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

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

spinn_front_end_common.interface.interface_functions.chip_io_buf_extractor()

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)
spinn_front_end_common.interface.interface_functions.chip_runtime_updater(n_sync_steps)

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.create_notification_protocol()

Builds the notification protocol for GUI and external device interaction.

spinn_front_end_common.interface.interface_functions.compute_energy_used()

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.database_interface(runtime)
Parameters:tags (Tags) –
Returns:Database interface, where the database is located
Return type:tuple(DatabaseInterface, str)
spinn_front_end_common.interface.interface_functions.reload_dsg_regions()

Reloads DSG regions where needed

spinn_front_end_common.interface.interface_functions.energy_provenance_reporter(power_used)

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.execute_application_data_specs()

Execute the data specs for all non-system targets.

spinn_front_end_common.interface.interface_functions.execute_system_data_specs()

Execute the data specs for all system targets.

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)[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.graph_binary_gatherer()

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
Return type:DataSpecificationTargets
Raises:ConfigurationException – If the DSG asks to use more SDRAM than is available.
spinn_front_end_common.interface.interface_functions.graph_provenance_gatherer()

Gets provenance information from the graph.

spinn_front_end_common.interface.interface_functions.hbp_allocator(total_run_time)

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

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)

Adds chip power monitors into a given graph.

param Placements placements:

spinn_front_end_common.interface.interface_functions.insert_extra_monitor_vertices_to_graphs(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))
spinn_front_end_common.interface.interface_functions.split_lpg_vertices(system_placements)

Split any LPG vertices found

Parameters:
  • app_graph (ApplictiongGraph) – The application graph
  • machine (Machine) – the SpiNNaker machine as discovered
  • system_placements (Placements) – exiting placements to be added to
spinn_front_end_common.interface.interface_functions.load_app_images()

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

Load a set of fixed routes onto a SpiNNaker machine.

Parameters:transceiver (Transceiver) –
spinn_front_end_common.interface.interface_functions.load_sys_images()

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.local_tdma_builder()

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
spinn_front_end_common.interface.interface_functions.locate_executable_start_type()

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)

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

Gets provenance information from 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 dont use View
Returns:

spinn_front_end_common.interface.interface_functions.profile_data_gatherer()

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

Reads compressed routing tables from a SpiNNaker machine.

Return type:MulticastRoutingTables
spinn_front_end_common.interface.interface_functions.router_provenance_gatherer()
spinn_front_end_common.interface.interface_functions.routing_setup()

Initialises the routers. Note that this does not load any routes into them.

Parameters:transceiver (Transceiver) –
spinn_front_end_common.interface.interface_functions.routing_table_loader(router_tables)

Loads routes into initialised routers.

Parameters:
spinn_front_end_common.interface.interface_functions.sdram_outgoing_partition_allocator()
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.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
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.system_multicast_routing_generator()

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))
spinn_front_end_common.interface.interface_functions.tags_loader()

Loads tags onto the machine.

spinn_front_end_common.interface.interface_functions.virtual_machine_generator()

Generates a virtual machine with given dimensions and configuration.

Returns:The virtual machine.
Return type:Machine
Raises:Exception – If given bad arguments
spinn_front_end_common.interface.interface_functions.add_command_senders(system_placements)

Add command senders