spinn_front_end_common.interface.ds package¶
Module contents¶
-
class
spinn_front_end_common.interface.ds.
DataRowReader
(data)[source]¶ Bases:
spinn_storage_handlers.abstract_classes.abstract_data_reader.AbstractDataReader
,spinn_storage_handlers.abstract_classes.abstract_context_manager.AbstractContextManager
-
read
(n_bytes=None)[source]¶ Read some bytes of data from the underlying storage. Will block until some bytes are available, but might not return the full n_bytes. The size of the returned array indicates how many bytes were read.
Parameters: n_bytes (int) – The number of bytes to read; if unspecified, read all remaining bytes Returns: The data that was read Return type: bytearray Raises: IOError – If an error occurs reading from the underlying storage
-
-
class
spinn_front_end_common.interface.ds.
DataRowWriter
(x, y, p, targets)[source]¶ Bases:
spinn_storage_handlers.abstract_classes.abstract_data_writer.AbstractDataWriter
,spinn_storage_handlers.abstract_classes.abstract_context_manager.AbstractContextManager
-
class
spinn_front_end_common.interface.ds.
DataSpecificationTargets
(machine, report_folder, init=None, clear=True)[source]¶ Bases:
_abcoll.MutableMapping
Parameters: - machine (Machine) –
- report_folder (str) –
-
get_app_id
(x, y, p)[source]¶ Gets the app_id set for this core
Parameters: - x – core x
- y – core y
- p – core p
Return type: int
-
get_database
()[source]¶ Expose the database so it can be shared
Return type: DsAbstractDatabase
-
iteritems
()¶ D.items() -> list of D’s (key, value) pairs, as 2-tuples
-
keys
()[source]¶ Yields the keys.
As the more typical call is iteritems this makes use of that
Return type: iterable(tuple(int,int,int))
-
n_targets
()¶ TEMP implementation
Returns:
-
class
spinn_front_end_common.interface.ds.
DsAbstractDatabase
[source]¶ Bases:
object
Interface supported by all database implementations that store data specifications.
-
close
()[source]¶ Signals that the database can be closed and will not be reused.
Note
Once this is called any other method in this API is allowed to raise any kind of exception.
-
ds_get_app_id
(x, y, p)[source]¶ Gets the app_id set for this core
Parameters: - x (int) – core x
- y (int) – core y
- p (int) – core p
Return type: int
-
ds_iteritems
()[source]¶ Yields the keys and values for the DS data
Returns: Yields the (x, y, p) and saved ds pairs Return type: iterable(tuple(tuple(int, int, int), bytearray))
-
ds_mark_as_system
(core_list)[source]¶ Flags a list of processors as running system binaries.
Parameters: core_list (iterable(tuple(int,int,int))) – list of (core x, core y, core p)
-
ds_set_app_id
(app_id)[source]¶ Sets the same app_id for all rows that have ds content
Parameters: app_id (int) – value to set
-
get_ds
(x, y, p)[source]¶ Retrieves the data spec as byte code for this core.
Parameters: - x (int) – core x
- y (int) – core y
- p (int) – core p
Returns: data spec as byte code
Return type: bytearray
-
get_write_info
(x, y, p)[source]¶ Gets the provenance returned by the Data Spec executor
Parameters: - x (int) – core x
- y (int) – core y
- p (int) – core p
Return type:
-
info_iteritems
()[source]¶ Yields the keys and values for the Info data. Note that a DB transaction may be held while this iterator is processing.
Returns: Yields the (x, y, p) and DataWritten Return type: iterable(tuple(tuple(int, int, int), DataWritten))
-
save_ds
(core_x, core_y, core_p, ds)[source]¶ Parameters: - core_x (int) – x of the core ds applies to
- core_y (int) – y of the core ds applies to
- p (int) – p of the core ds applies to
- ds (bytearray) – the data spec as byte code
-
set_write_info
(x, y, p, info)[source]¶ Sets the provenance returned by the Data Spec executor.
Parameters: - x (int) – core x
- y (int) – core y
- p (int) – core p
- info (DataWritten) – DataWritten
-