spinn_front_end_common.interface.interface_functions package

Module contents

spinn_front_end_common.interface.interface_functions.application_finisher(app_id, txrx, executable_types)[source]

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

Parameters:
Raises:

ExecutableFailedToStopException

spinn_front_end_common.interface.interface_functions.application_runner(buffer_manager, notification_interface, executable_types, app_id, txrx, runtime, no_sync_changes, time_threshold, machine, run_until_complete=False)[source]

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

Parameters:
Returns:

Number of synchronisation changes

Return type:

int

Raises:

ConfigurationException

spinn_front_end_common.interface.interface_functions.buffer_extractor(machine_graph, placements, buffer_manager)[source]

Extracts data in between runs.

Parameters:
spinn_front_end_common.interface.interface_functions.buffer_manager_creator(placements, tags, txrx, extra_monitor_to_chip_mapping=None, packet_gather_cores_to_ethernet_connection_map=None, machine=None, fixed_routes=None, java_caller=None)[source]

Creates a buffer manager.

Parameters:
Return type:

BufferManager

spinn_front_end_common.interface.interface_functions.chip_io_buf_clearer(transceiver, executable_types)[source]

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

Parameters:
spinn_front_end_common.interface.interface_functions.chip_io_buf_extractor(transceiver, executable_targets, executable_finder)[source]

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

Parameters:
Returns:

error_entries, warn_entries

Return type:

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

spinn_front_end_common.interface.interface_functions.chip_provenance_updater(txrx, app_id, all_core_subsets)[source]
spinn_front_end_common.interface.interface_functions.chip_runtime_updater(txrx, app_id, executable_types, run_until_timesteps, current_timesteps, n_sync_steps)[source]

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

Parameters:
spinn_front_end_common.interface.interface_functions.create_notification_protocol(socket_addresses, database_file_path)[source]

Builds the notification protocol for GUI and external device interaction.

Parameters:
spinn_front_end_common.interface.interface_functions.compute_energy_used(placements, machine, version, runtime, buffer_manager, machine_allocation_controller=None)[source]

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

Parameters:
  • placements (Placements) –
  • machine (Machine) –
  • version (int) – The version of the SpiNNaker boards in use.
  • runtime (float) –
  • buffer_manager (BufferManager) –
  • mapping_time (float) – From simulator via FinaliseTimingData.
  • load_time (float) – From simulator via FinaliseTimingData.
  • execute_time (float) – From simulator via FinaliseTimingData.
  • dsg_time (float) – From simulator via FinaliseTimingData.
  • extraction_time (float) – From simulator via FinaliseTimingData.
  • spalloc_server (str or None) – (optional)
  • remote_spinnaker_url (str or None) – (optional)
  • machine_allocation_controller (MachineAllocationController) – (optional)
Return type:

PowerUsed

spinn_front_end_common.interface.interface_functions.database_interface(machine_graph, tags, runtime, machine, data_n_timesteps, placements, routing_infos, router_tables, app_id, application_graph=None)[source]

Writes a database of the graph(s) and other information.

Parameters:
Returns:

Database interface, where the database is located

Return type:

tuple(DatabaseInterface, str)

spinn_front_end_common.interface.interface_functions.dsg_region_reloader(transceiver, placements, hostname)[source]
spinn_front_end_common.interface.interface_functions.edge_to_n_keys_mapper(machine_graph)[source]

Works out the number of keys needed for each edge.

Parameters:machine_graph (MachineGraph) –
Return type:DictBasedMachinePartitionNKeysMap
Raises:ConfigurationException – If no graph is available
spinn_front_end_common.interface.interface_functions.energy_provenance_reporter(power_used, placements)[source]

Converts the power usage information into provenance data.

Parameters:
  • power_used (PowerUsed) – The computed basic power consumption information
  • placements (Placements) – Used for describing what a core was actually doing
spinn_front_end_common.interface.interface_functions.execute_application_data_specs(transceiver, machine, app_id, dsg_targets, executable_targets, placements=None, extra_monitor_cores=None, extra_monitor_cores_to_ethernet_connection_map=None, java_caller=None)[source]

Execute the data specs for all non-system targets.

Parameters:
  • machine (Machine) – the python representation of the SpiNNaker machine
  • transceiver (Transceiver) – the spinnman instance
  • app_id (int) – the application ID of the simulation
  • dsg_targets (DataSpecificationTargets) – map of placement to file path
  • uses_advanced_monitors (bool) – whether to use fast data in protocol
  • executable_targets (ExecutableTargets) – what core will running what binary
  • placements (Placements) – where vertices are located
  • extra_monitor_cores (list(ExtraMonitorSupportMachineVertex)) – the deployed extra monitors, if any
  • extra_monitor_cores_to_ethernet_connection_map (dict(tuple(int,int), DataSpeedUpPacketGatherMachineVertex)) – how to talk to extra monitor cores
spinn_front_end_common.interface.interface_functions.execute_system_data_specs(transceiver, machine, app_id, dsg_targets, executable_targets, java_caller=None)[source]

Execute the data specs for all system targets.

Parameters:
  • transceiver (Transceiver) – the spinnman instance
  • machine (Machine) – the python representation of the spinnaker machine
  • app_id (int) – the application ID of the simulation
  • dsg_targets (dict(tuple(int,int,int),str)) – map of placement to file path
  • executable_targets (ExecutableTargets) – the map between binaries and locations and executable types
  • java_caller (JavaCaller) –
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.

__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(placements, graph, executable_finder)[source]

Extracts binaries to be executed.

Parameters:
Return type:

ExecutableTargets

spinn_front_end_common.interface.interface_functions.graph_data_specification_writer(placements, hostname, machine, app_id, data_n_timesteps, placement_order=None)[source]
Parameters:
  • placements (Placements) – placements of machine graph to cores
  • hostname (str) – SpiNNaker machine name
  • machine (Machine) – the python representation of the SpiNNaker machine
  • data_n_timesteps (int) – The number of timesteps for which data space will been reserved
  • placement_order (list(Placement)) – the optional order in which placements should be examined
Returns:

DSG targets

Return type:

DataSpecificationTargets

Raises:

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

spinn_front_end_common.interface.interface_functions.graph_measurer(machine_graph, machine, plan_n_timesteps)[source]

Works out how many chips a machine graph needs.

Parameters:
  • machine_graph (MachineGraph) – The machine_graph to measure.
  • machine (Machine) – The machine with respect to which to partition the application graph.
  • plan_n_timesteps (int) – Number of timesteps to plan for.
Returns:

The size of the graph in number of chips.

Return type:

int

spinn_front_end_common.interface.interface_functions.graph_provenance_gatherer(machine_graph, application_graph=None)[source]

Gets provenance information from the graphs.

Parameters:
spinn_front_end_common.interface.interface_functions.hbp_allocator(total_run_time, n_chips=None, n_boards=None)[source]

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
  • n_chips (int) – The number of chips required. Only used if n_boards is None
  • n_boards (int) – The number of boards required
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(router_tables, machine, placements, transceiver, machine_graph, routing_infos)[source]

Entry point when using the PACMANAlgorithmExecutor

Parameters:
Returns:

compressed routing table entries

Return type:

MulticastRoutingTables

spinn_front_end_common.interface.interface_functions.hbp_max_machine_generator(total_run_time)[source]

Generates a virtual machine of the width and height of the maximum machine a given HBP server can generate.

Parameters:total_run_time (int) – The total run time to request
Return type:Machine
spinn_front_end_common.interface.interface_functions.insert_chip_power_monitors_to_graphs(machine, machine_graph, sampling_frequency, application_graph=None)[source]

Adds chip power monitor vertices on Ethernet connected chips as required.

Parameters:
  • machine (Machine) – the SpiNNaker machine as discovered
  • machine_graph (MachineGraph) – the machine graph
  • sampling_frequency (int) –
  • application_graph (ApplicationGraph) – the application graph
spinn_front_end_common.interface.interface_functions.insert_edges_to_extra_monitor_functionality(machine_graph, placements, machine, vertex_to_ethernet_connected_chip_mapping, application_graph=None)[source]

Inserts edges between vertices who use MC speed up and its local MC data gatherer.

Parameters:
spinn_front_end_common.interface.interface_functions.insert_edges_to_live_packet_gatherers(live_packet_gatherer_parameters, placements, live_packet_gatherers_to_vertex_mapping, machine, machine_graph, application_graph=None, n_keys_map=None)[source]

Add edges from the recorded vertices to the local Live PacketGatherers.

Parameters:
spinn_front_end_common.interface.interface_functions.insert_extra_monitor_vertices_to_graphs(machine, machine_graph, application_graph=None)[source]

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

Parameters:
  • machine (Machine) – spinnMachine instance
  • machine_graph (MachineGraph) – machine graph
  • n_cores_to_allocate (int) – number of cores to allocate for reception
  • application_graph (ApplicationGraph) – app graph
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.insert_live_packet_gatherers_to_graphs(live_packet_gatherer_parameters, machine, machine_graph, application_graph=None)[source]

Add LPG vertices on Ethernet connected chips as required.

Parameters:
Returns:

mapping between LPG parameters and LPG application and machine vertices

Return type:

dict(LivePacketGatherParameters, tuple(LivePacketGather or None, dict(tuple(int,int),LivePacketGatherMachineVertex)))

spinn_front_end_common.interface.interface_functions.load_app_images(executable_targets, app_id, transceiver)[source]

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

Parameters:
spinn_front_end_common.interface.interface_functions.load_fixed_routes(fixed_routes, transceiver, app_id)[source]

Load a set of fixed routes onto a SpiNNaker machine.

Parameters:
spinn_front_end_common.interface.interface_functions.load_sys_images(executable_targets, app_id, transceiver)[source]

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

Parameters:
spinn_front_end_common.interface.interface_functions.local_tdma_builder(machine_graph, n_keys_map, application_graph=None)[source]

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
Parameters:
spinn_front_end_common.interface.interface_functions.locate_executable_start_type(graph, placements)[source]

Discovers where applications of particular types need to be launched.

Parameters:
Return type:

dict(ExecutableType,CoreSubsets or None)

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

Makes a transceiver and a machine object.

Parameters:
  • hostname (str) – the hostname or IP address of the SpiNNaker machine
  • bmp_details (str) – the details of the BMP connections
  • downed_chips (set(tuple(int,int))) – the chips that are down which SARK thinks are alive
  • downed_cores (set(tuple(int,int,int))) – the cores that are down which SARK thinks are alive
  • downed_links (set(tuple(int,int,int))) – the links that are down which SARK thinks are alive
  • 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
  • boot_port_num (int) – the port number used for the boot connection
  • 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(transceiver, placements)[source]

Gets provenance information from vertices on the machine.

Parameters:
  • transceiver (Transceiver) – the SpiNNMan interface object
  • placements (Placements) – The placements of the vertices
class spinn_front_end_common.interface.interface_functions.PreAllocateForBitFieldRouterCompressor[source]

Bases: object

Preallocates resources required for bitfield router compression.

__call__(machine, pre_allocated_resources)[source]
Parameters:
Returns:

preallocated resources

Return type:

PreAllocatedResourceContainer

spinn_front_end_common.interface.interface_functions.preallocate_resources_for_chip_power_monitor(pre_allocated_resources)[source]

Adds chip power monitor resources as required

Parameters:
Returns:

preallocated resources

Return type:

PreAllocatedResourceContainer

spinn_front_end_common.interface.interface_functions.pre_allocate_resources_for_extra_monitor_support(pre_allocated_resources)[source]

Allocates resources for the extra monitors.

Parameters:pre_allocated_resources (PreAllocatedResourceContainer) – resources already preallocated
spinn_front_end_common.interface.interface_functions.preallocate_resources_for_live_packet_gatherers(live_packet_gatherer_parameters, machine, pre_allocated_resources)[source]

Adds Live Packet Gatherer resources as required for a machine.

Parameters:
Returns:

preallocated resources

Return type:

PreAllocatedResourceContainer

spinn_front_end_common.interface.interface_functions.process_partition_constraints(machine_graph)[source]

Adds constraints to partitions if the vertices at either end of the partition request it.

Parameters:machine_graph (MachineGraph) –
spinn_front_end_common.interface.interface_functions.profile_data_gatherer(transceiver, placements)[source]

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

Parameters:
  • transceiver (Transceiver) – the SpiNNMan interface object
  • placements (Placements) – The placements of the vertices
spinn_front_end_common.interface.interface_functions.read_routing_tables_from_machine(transceiver, routing_tables, app_id)[source]

Reads compressed routing tables from a SpiNNaker machine.

Parameters:
Return type:

MulticastRoutingTables

spinn_front_end_common.interface.interface_functions.router_provenance_gatherer(transceiver, machine, router_tables, extra_monitor_vertices=None, placements=None)[source]
Parameters:
spinn_front_end_common.interface.interface_functions.routing_setup(router_tables, app_id, transceiver, machine)[source]

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

Parameters:
spinn_front_end_common.interface.interface_functions.routing_table_loader(router_tables, app_id, transceiver, machine)[source]

Loads routes into initialised routers.

Parameters:
spinn_front_end_common.interface.interface_functions.sdram_outgoing_partition_allocator(machine_graph, placements, app_id, transceiver=None)[source]
spinn_front_end_common.interface.interface_functions.spalloc_allocator(n_chips=None, n_boards=None)[source]

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

Parameters:
  • n_chips (int or None) – The number of chips required. IGNORED if n_boards is not None
  • n_boards (int or None) – The number of boards required
Return type:

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

spinn_front_end_common.interface.interface_functions.spalloc_max_machine_generator()[source]

Generates a maximum virtual machine a given allocation server can generate.

Returns:A virtual machine
Return type:Machine
spinn_front_end_common.interface.interface_functions.system_multicast_routing_generator(machine, extra_monitor_cores, placements)[source]

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

Parameters:
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(transceiver, tags)[source]

Loads tags onto the machine.

Parameters:
  • transceiver (Transceiver) – the transceiver object
  • tags (Tags) – the tags object which contains IP and reverse IP tags; could be None if these are being given in separate lists
spinn_front_end_common.interface.interface_functions.virtual_machine_generator()[source]

Generates a virtual machine with given dimensions and configuration.

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