Skip to content

Commit

Permalink
Merge branch 'better_energy_checkpointing' into fix_pause
Browse files Browse the repository at this point in the history
  • Loading branch information
rowleya committed Nov 13, 2024
2 parents 72cb5df + 4a891a9 commit 2e37bcd
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1250,7 +1250,8 @@ static void timer_callback(UNUSED uint unused0, UNUSED uint unused1) {
if (recording_flags > 0) {
recording_finalise();
}

// clear the next buffer time
next_buffer_time = 0;
log_debug("Last time of stop notification request: %d",
last_stop_notification_request);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def test_database_interface():

_make_m_vertices(app_vertex_1, 10, 10)
_make_m_vertices(app_vertex_2, 20, 20)
params = LivePacketGatherParameters(label="LiveSpikeReceiver")
params = LivePacketGatherParameters(
label="LiveSpikeReceiver", port=10000, hostname="localhost")
lpg_vertex = LivePacketGather(params, label="LiveSpikeReceiver")
writer.add_vertex(lpg_vertex)
writer.add_edge(ApplicationEdge(app_vertex_1, lpg_vertex), "Test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def test_that_3_lpgs_are_generated_on_3_board_app_graph(self):
'payload_prefix': None,
'payload_right_shift': 0,
'number_of_packets_sent_per_time_step': 0,
'hostname': None,
'port': None,
'hostname': 'localhost',
'port': 1000,
'strip_sdp': None,
'tag': None,
'label': "Test"}
Expand Down
7 changes: 6 additions & 1 deletion spinn_front_end_common/utilities/sqlite_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,12 @@ def __init__(
# https://stackoverflow.com/a/21794758/301832
self.__db = sqlite3.connect(
f"{db_uri}?mode=ro", uri=True, timeout=timeout)
# can not run a DDL file
ddl_file = None
else:
if os.path.exists(database_file):
# No need to run the DDL file again
ddl_file = None
self.__db = sqlite3.connect(database_file, timeout=timeout)

# We want to assume control over transactions ourselves
Expand All @@ -131,7 +136,7 @@ def __init__(
if text_factory is not None:
self.__db.text_factory = text_factory

if not read_only and ddl_file:
if ddl_file:
with open(ddl_file, encoding="utf-8") as f:
sql = f.read()
self.__db.executescript(sql)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ class LivePacketGatherParameters(object):
"_received_key_mask", "_translate_keys", "_translated_key_right_shift")

def __init__(
self, port: Optional[int] = None, hostname: Optional[str] = None,
tag=None, strip_sdp=True,
self, port: int, hostname: str, tag=None, strip_sdp=True,
use_prefix=False, key_prefix=None, prefix_type=None,
message_type=EIEIOType.KEY_32_BIT, right_shift=0,
payload_as_time_stamps=True, use_payload_prefix=True,
Expand Down Expand Up @@ -89,7 +88,7 @@ def __init__(
self._translated_key_right_shift = translated_key_right_shift

@property
def port(self) -> Optional[int]:
def port(self) -> int:
"""
Where to send data from SpiNNaker:
the port of the listening UDP socket.
Expand All @@ -99,7 +98,7 @@ def port(self) -> Optional[int]:
return self._port

@property
def hostname(self) -> Optional[str]:
def hostname(self) -> str:
"""
Where to send data from SpiNNaker: the host name of the listening UDP
socket.
Expand Down
4 changes: 2 additions & 2 deletions unittests/data/test_simulator_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,8 +454,8 @@ def test_live_packet_recorder_params(self):
self.assertFalse(FecDataView.has_live_packet_recorder_params())
with self.assertRaises(DataNotYetAvialable):
FecDataView.get_live_packet_recorder_params()
lpg1 = LivePacketGatherParameters(1)
lpg2 = LivePacketGatherParameters(2)
lpg1 = LivePacketGatherParameters(1, hostname="localhost")
lpg2 = LivePacketGatherParameters(2, hostname="localhost")
vertex1 = SimpleTestVertex(1, "1")
vertex2 = SimpleTestVertex(2, "2")
vertex3 = SimpleTestVertex(3, "3")
Expand Down

0 comments on commit 2e37bcd

Please sign in to comment.