From fdbfdfdc059dacf077072d0352e8e6786ef99ca8 Mon Sep 17 00:00:00 2001 From: "Christian Y. Brenninkmeijer" Date: Fri, 6 Dec 2024 11:41:02 +0000 Subject: [PATCH] insert_monitor_value --- .../interface/provenance/provenance_writer.py | 19 +++++++++++++++++-- .../chip_power_monitor_machine_vertex.py | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/spinn_front_end_common/interface/provenance/provenance_writer.py b/spinn_front_end_common/interface/provenance/provenance_writer.py index 52a76768c5..21be6adc7b 100644 --- a/spinn_front_end_common/interface/provenance/provenance_writer.py +++ b/spinn_front_end_common/interface/provenance/provenance_writer.py @@ -96,13 +96,28 @@ def insert_monitor( """ Inserts data into the `monitor_provenance` table. + Will only save data is write_provance is on. + + :param int x: X coordinate of the chip + :param int y: Y coordinate of the chip + :param str description: type of value + :param int the_value: data + """ + if get_config_bool("Reports", "write_provenance"): + self.insert_monitor_value(x, y, description, the_value) + + def insert_monitor_value( + self, x: int, y: int, description: str, the_value: _SqliteTypes): + """ + Inserts data into the `monitor_provenance` table. + + Always saves the data even if write_provence is off. + :param int x: X coordinate of the chip :param int y: Y coordinate of the chip :param str description: type of value :param int the_value: data """ - if not get_config_bool("Reports", "write_provenance"): - return self.execute( """ INSERT INTO monitor_provenance( diff --git a/spinn_front_end_common/utility_models/chip_power_monitor_machine_vertex.py b/spinn_front_end_common/utility_models/chip_power_monitor_machine_vertex.py index bfa760ce6f..4235f24d18 100644 --- a/spinn_front_end_common/utility_models/chip_power_monitor_machine_vertex.py +++ b/spinn_front_end_common/utility_models/chip_power_monitor_machine_vertex.py @@ -225,5 +225,5 @@ def _deduce_sdram_requirements_per_timer_tick(self) -> int: def __write_recording_metadata(self, placement: Placement) -> None: with ProvenanceWriter() as db: - db.insert_monitor( + db.insert_monitor_value( placement.x, placement.y, PROVENANCE_CORE_KEY, placement.p)