spinn_front_end_common.interface.ds package

Module contents

class spinn_front_end_common.interface.ds.DataRowWriter(x, y, p, targets)[source]

Bases: io.RawIOBase

close()[source]

Closes the writer if not already closed.

fileno()[source]

Returns underlying file descriptor if one exists.

OSError is raised if the IO object does not use a file descriptor.

readable()[source]

Return whether object was opened for reading.

If False, read() will raise OSError.

seekable()[source]

Return whether object supports random access.

If False, seek(), tell() and truncate() will raise OSError. This method may need to do a test seek().

truncate(size=None)[source]

Truncate file to size bytes.

File pointer is left unchanged. Size defaults to the current IO position as reported by tell(). Returns the new size.

writable()[source]

Return whether object was opened for writing.

If False, write() will raise OSError.

write(data)[source]
class spinn_front_end_common.interface.ds.DsSqlliteDatabase(init=None)[source]

Bases: spinn_front_end_common.utilities.sqlite_db.SQLiteDB

Parameters:init (bool or None) –
app_items()[source]

Yields the keys and values for the DS data for application cores.

Note

Do not use the database for anything else while iterating.

Returns:Yields the (x, y, p) and saved ds pairs
Return type:iterable(tuple(tuple(int,int,int),RawIOBase, int))
clear_write_info()[source]

Clears the provenance for all rows.

create_data_spec(x, y, p)[source]
Parameters:
Return type:

DataRowWriter

classmethod default_database_file()[source]
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
Return type:

int

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_n_app_cores()[source]

Returns the number for application cores there is a ds saved for.

Return type:int
Raises:DsDatabaseException
ds_n_cores()[source]

Returns the number for cores there is a ds saved for.

Return type:int
Raises:DsDatabaseException
ds_n_system_cores()[source]

Returns the number for system cores there is a ds saved for.

Return type:int
Raises:DsDatabaseException
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
Returns:

start_address, memory_used, memory_written

Return type:

DataWritten

info_iteritems()[source]

Yields the keys and values for the Info data.

Note

A DB transaction may be held while this iterator is processing. Reentrant use of this class is not supported.

Returns:Yields the (x, y, p), start_address, memory_used and memory_written
Return type:iterable(tuple(tuple(int, int, int), int, int, int))
info_n_cores()[source]

Returns the number for cores there is a info saved for.

Return type:int
Raises:DsDatabaseException
items()[source]

Yields the keys and values for the DS data.

Note

Do not use the database for anything else while iterating.

Returns:Yields the (x, y, p) and saved ds pairs
Return type:iterable(tuple(tuple(int,int,int),RawIOBase))
keys()[source]

Yields the keys.

Note

Do not use the database for anything else while iterating.

Returns:Yields the (x, y, p)
Return type:iterable(tuple(int,int,int))
mark_system_cores(core_subsets)[source]
Parameters:core_subsets (CoreSubsets) –
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
set_size_info(x, y, p, memory_used)[source]
set_write_info(x, y, p, start, used, written)[source]

Sets the provenance returned by the Data Spec executor.

Parameters:
  • x (int) – core x
  • y (int) – core y
  • p (int) – core p
  • start (int) – base_address:
  • used (int) – size_allocated:
  • written (int) – bytes_written:
system_items()[source]

Yields the keys and values for the DS data for system cores.

Note

Do not use the database for anything else while iterating.

Returns:Yields the (x, y, p), saved ds and region_size triples
Return type:iterable(tuple(tuple(int,int,int),RawIOBase, int))
write_data_spec(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
write_session_credentials_to_db()[source]

Write Spalloc session credentials to the database if in use