spinnman.processes package

Module contents

class spinnman.processes.AbstractMultiConnectionProcessConnectionSelector[source]

Bases: object

A connection selector for multi-connection processes.

get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message (AbstractSCPRequest) – The SCP message to be sent
Return type:SCAMPConnection
class spinnman.processes.FixedConnectionSelector(connection)[source]

Bases: spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector

A connection selector that only uses a single connection.

Parameters:connection (SCAMPConnection) – The connection to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message (AbstractSCPRequest) – The SCP message to be sent
Return type:SCAMPConnection
class spinnman.processes.MostDirectConnectionSelector(connections)[source]

Bases: spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector

A selector that goes for the most direct connection for the message.

Parameters:connections (list(SCAMPConnection)) – The connections to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message (AbstractSCPRequest) – The SCP message to be sent
Return type:SCAMPConnection
class spinnman.processes.RoundRobinConnectionSelector(connections)[source]

Bases: spinnman.processes.abstract_multi_connection_process_connection_selector.AbstractMultiConnectionProcessConnectionSelector

A connection selector that just spreads work as evenly as possible.

Parameters:connections (list(SCAMPConnection)) – The connections to be used
get_next_connection(message)[source]

Get the index of the next connection for the process from a list of connections.

Parameters:message (AbstractSCPRequest) – The SCP message to be sent
Return type:SCAMPConnection
class spinnman.processes.AbstractMultiConnectionProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: object

A process for talking to SpiNNaker efficiently that uses multiple connections in communication if relevant.

Parameters:
  • next_connection_selector (AbstractMultiConnectionProcessConnectionSelector) – How to choose the connection.
  • n_retries (int) – The number of retries of a message to use. Passed to SCPRequestPipeLine
  • timeout (float) – The timeout, in seconds. Passed to SCPRequestPipeLine
  • n_channels (int) – The maximum number of channels to use when talking to a particular SCAMP instance. Passed to SCPRequestPipeLine
  • intermediate_channel_waits (int) – The maximum number of outstanding message/reply pairs to have on a particular connection. Passed to SCPRequestPipeLine
check_for_error(print_exception=False)[source]
connection_selector

The connection selector of the process.

Return type:AbstractMultiConnectionProcessConnectionSelector
is_error()[source]
class spinnman.processes.ApplicationRunProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Parameters:
  • next_connection_selector (AbstractMultiConnectionProcessConnectionSelector) – How to choose the connection.
  • n_retries (int) – The number of retries of a message to use. Passed to SCPRequestPipeLine
  • timeout (float) – The timeout, in seconds. Passed to SCPRequestPipeLine
  • n_channels (int) – The maximum number of channels to use when talking to a particular SCAMP instance. Passed to SCPRequestPipeLine
  • intermediate_channel_waits (int) – The maximum number of outstanding message/reply pairs to have on a particular connection. Passed to SCPRequestPipeLine
run(app_id, core_subsets, wait)[source]
class spinnman.processes.ApplicationCopyRunProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Process to start a binary on a subset of cores on a subset of chips of a machine, performed by, on each chip, copying the data from an adjacent chip and then starting the binary. This goes to each chip in turn, and so detects failures early on, as well as ensuring that the copy and execution is done in the case of success i.e. this ensures that if all commands are successful, the full binary has been copied and started.

Note

The binary must have been loaded to the boot chip before this is called!

Parameters:
  • next_connection_selector (AbstractMultiConnectionProcessConnectionSelector) – How to choose the connection.
  • n_retries (int) – The number of retries of a message to use. Passed to SCPRequestPipeLine
  • timeout (float) – The timeout, in seconds. Passed to SCPRequestPipeLine
  • n_channels (int) – The maximum number of channels to use when talking to a particular SCAMP instance. Passed to SCPRequestPipeLine
  • intermediate_channel_waits (int) – The maximum number of outstanding message/reply pairs to have on a particular connection. Passed to SCPRequestPipeLine
run(size, app_id, core_subsets, chksum, wait)[source]

Run the process.

Parameters:
  • size (int) – The size of the binary to copy
  • app_id (int) – The application id to assign to the running binary
  • core_subsets (CoreSubsets) – The cores to load the binary on to
  • chksum (int) – The checksum of the data to test against
  • wait (bool) – Whether to put the binary in “wait” mode or run it straight away
class spinnman.processes.DeAllocSDRAMProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Warning

This class is currently deprecated and untested as there is no known use except for Transceiver.free_sdram and free_sdram_by_app_id which are both themselves deprecated.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
de_alloc_sdram(x, y, app_id, base_address=None)[source]
Parameters:
no_blocks_freed
Return type:int
class spinnman.processes.GetCPUInfoProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
get_cpu_info(core_subsets)[source]
Parameters:core_subsets (CoreSubsets) –
Return type:list(CPUInfo)
class spinnman.processes.GetHeapProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
get_heap(chip_address, pointer=<SystemVariableDefinition.sdram_heap_address: _Definition(offset=76, data_type=<_DataType.INT: 4>, default=0, array_size=None, doc='The base address of the user SDRAM heap')>)[source]
Parameters:
Return type:

list(HeapElement)

class spinnman.processes.GetMachineProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for getting the machine details over a set of connections.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
get_machine_details(boot_x, boot_y, width, height)[source]
Parameters:
  • boot_x (int) –
  • boot_y (int) –
  • width (int) –
  • height (int) –
Return type:

Machine

class spinnman.processes.GetMultiCastRoutesProcess(connection_selector, app_id=None)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading the multicast routing table of a SpiNNaker chip.

Parameters:
get_routes(x, y, base_address)[source]
Parameters:
  • x (int) –
  • y (int) –
  • base_address (int) –
Return type:

list(MulticastRoutingEntry)

class spinnman.processes.GetTagsProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
get_tags(connection)[source]
Parameters:connection (SCAMPConnection) –
Return type:list(IPTag or ReverseIPTag)
class spinnman.processes.GetVersionProcess(connection_selector, n_retries=10)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for getting the version of the machine.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
get_version(x, y, p)[source]
Parameters:
Return type:

VersionInfo

class spinnman.processes.LoadFixedRouteRoutingEntryProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Load a fixed route routing entry onto a chip.

Parameters:
  • next_connection_selector (AbstractMultiConnectionProcessConnectionSelector) – How to choose the connection.
  • n_retries (int) – The number of retries of a message to use. Passed to SCPRequestPipeLine
  • timeout (float) – The timeout, in seconds. Passed to SCPRequestPipeLine
  • n_channels (int) – The maximum number of channels to use when talking to a particular SCAMP instance. Passed to SCPRequestPipeLine
  • intermediate_channel_waits (int) – The maximum number of outstanding message/reply pairs to have on a particular connection. Passed to SCPRequestPipeLine
load_fixed_route(x, y, fixed_route, app_id=0)[source]
Parameters:
  • x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions.
  • y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions.
  • fixed_route (FixedRouteEntry) – the fixed route entry
  • app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
class spinnman.processes.LoadMultiCastRoutesProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for loading the multicast routing table on a SpiNNaker chip.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
load_routes(x, y, routes, app_id)[source]
Parameters:
class spinnman.processes.MallocSDRAMProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for allocating a block of SDRAM on a SpiNNaker chip.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
base_address

The address of the allocated memory block.

Return type:int
malloc_sdram(x, y, size, app_id, tag)[source]

Allocate space in the SDRAM space.

Parameters:
class spinnman.processes.ReadFixedRouteRoutingEntryProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading a fixed route routing table entry.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) – the SC&MP connection selector
read_fixed_route(x, y, app_id=0)[source]

Read the fixed route entry installed on a particular chip’s router.

Parameters:
  • x (int) – The x-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
  • y (int) – The y-coordinate of the chip, between 0 and 255; this is not checked due to speed restrictions
  • app_id (int) – The ID of the application with which to associate the routes. If not specified, defaults to 0.
Return type:

FixedRouteEntry

class spinnman.processes.ReadIOBufProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading IOBUF memory (mostly log messages) from a SpiNNaker core.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
read_iobuf(iobuf_size, core_subsets)[source]
Parameters:
Return type:

iterable(IOBuffer)

class spinnman.processes.ReadMemoryProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading memory on a SpiNNaker chip.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
Parameters:
  • x (int) –
  • y (int) –
  • p (int) –
  • link (int) –
  • base_address (int) –
  • length (int) –
Return type:

bytearray

read_memory(x, y, p, base_address, length)[source]
Parameters:
  • x (int) –
  • y (int) –
  • p (int) –
  • base_address (int) –
  • length (int) –
Return type:

bytearray

class spinnman.processes.ReadRouterDiagnosticsProcess(connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for reading the diagnostic data block from a SpiNNaker router.

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
get_router_diagnostics(x, y)[source]
Parameters:
Return type:

RouterDiagnostics

class spinnman.processes.SendSingleCommandProcess(connection_selector, n_retries=3, timeout=1.0)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

Parameters:connection_selector (AbstractMultiConnectionProcessConnectionSelector) –
execute(request)[source]
Parameters:request (AbstractSCPRequest) –
Return type:AbstractSCPResponse
class spinnman.processes.WriteMemoryFloodProcess(next_connection_selector)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for writing memory on multiple SpiNNaker chips at once.

write_memory_from_bytearray(nearest_neighbour_id, base_address, data, offset, n_bytes=None)[source]
Parameters:
write_memory_from_reader(nearest_neighbour_id, base_address, reader, n_bytes)[source]
Parameters:
class spinnman.processes.WriteMemoryProcess(next_connection_selector, n_retries=10, timeout=1.0, n_channels=8, intermediate_channel_waits=7)[source]

Bases: spinnman.processes.abstract_multi_connection_process.AbstractMultiConnectionProcess

A process for writing memory on a SpiNNaker chip.

Parameters:
  • next_connection_selector (AbstractMultiConnectionProcessConnectionSelector) – How to choose the connection.
  • n_retries (int) – The number of retries of a message to use. Passed to SCPRequestPipeLine
  • timeout (float) – The timeout, in seconds. Passed to SCPRequestPipeLine
  • n_channels (int) – The maximum number of channels to use when talking to a particular SCAMP instance. Passed to SCPRequestPipeLine
  • intermediate_channel_waits (int) – The maximum number of outstanding message/reply pairs to have on a particular connection. Passed to SCPRequestPipeLine

Writes memory onto a neighbour of a SpiNNaker chip from a bytearray.

Parameters:
  • x (int) – The x-coordinate of the chip where the memory is to be written to
  • y (int) – The y-coordinate of the chip where the memory is to be written to
  • p (int) – The processor of the chip where the memory is to be written to
  • link (int) – Along which link is the neighbour.
  • base_address (int) – the address in SDRAM to start writing
  • data (bytearray or bytes) – the data to write
  • offset (int) – where in the data to start writing from
  • n_bytes (int) – how much data to write
  • get_sum (bool) – whether to return a checksum or 0
Returns:

the data checksum or 0 if get_sum is False

Return type:

int

Writes memory onto a neighbour of a SpiNNaker chip from a reader.

Parameters:
  • x (int) – The x-coordinate of the chip where the memory is to be written to
  • y (int) – The y-coordinate of the chip where the memory is to be written to
  • p (int) – The processor of the chip where the memory is to be written to
  • link (int) – Along which link is the neighbour.
  • base_address (int) – the address in SDRAM to start writing
  • reader (RawIOBase or BufferedIOBase) – the readable object containing the data to write
  • n_bytes (int) – how much data to write
  • get_sum (bool) – whether to return a checksum or 0
Returns:

the data checksum or 0 if get_sum is False

Return type:

int

write_memory_from_bytearray(x, y, p, base_address, data, offset, n_bytes, get_sum=False)[source]

Writes memory onto a SpiNNaker chip from a bytearray.

Parameters:
  • x (int) – The x-coordinate of the chip where the memory is to be written to
  • y (int) – The y-coordinate of the chip where the memory is to be written to
  • p (int) – The processor of the chip where the memory is to be written to
  • base_address (int) – the address in SDRAM to start writing
  • data (bytearray or bytes) – the data to write
  • offset (int) – where in the data to start writing from
  • n_bytes (int) – how much data to write
  • get_sum (bool) – whether to return a checksum or 0
Returns:

the data checksum or 0 if get_sum is False

Return type:

int

write_memory_from_reader(x, y, p, base_address, reader, n_bytes, get_sum=False)[source]

Writes memory onto a SpiNNaker chip from a reader.

Parameters:
  • x (int) – The x-coordinate of the chip where the memory is to be written to
  • y (int) – The y-coordinate of the chip where the memory is to be written to
  • p (int) – The processor of the chip where the memory is to be written to
  • base_address (int) – the address in SDRAM to start writing
  • reader (RawIOBase or BufferedIOBase) – the readable object containing the data to write
  • n_bytes (int) – how much data to write
  • get_sum (bool) – whether to return a checksum or 0
Returns:

the data checksum or 0 if get_sum is False

Return type:

int