diff --git a/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py b/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py
index 6180f116d48..aef2ae2dd45 100644
--- a/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py
+++ b/spynnaker/pyNN/extra_algorithms/redundant_packet_count_report.py
@@ -66,7 +66,6 @@
"FROM redundancy_by_core")
-_FILE_NAME = "redundant_packet_count.rpt"
_N_PROV_ITEMS_NEEDED = 4
_MAX = 100
@@ -76,7 +75,9 @@ def redundant_packet_count_report():
:return:
"""
- file_name = os.path.join(SpynnakerDataView.get_run_dir_path(), _FILE_NAME)
+ file_name = os.path.join(
+ SpynnakerDataView.get_run_dir_path(),
+ f"redundant_packet_count{SpynnakerDataView.get_reset_str()}.rpt")
try:
_create_views()
@@ -95,23 +96,23 @@ def _create_views():
def _write_report(output):
- reader = ProvenanceReader()
- for data in reader.run_query("select * from redundancy_by_core"):
- (_, _, _, source, _, filtered, invalid, _,
- redundant, total, percent) = data
- output.write(f"\ncore {source} \n")
- output.write(f" {total} packets received. \n")
- output.write(f" {redundant} were detected as "
- "redundant packets by the bitfield filter. \n")
- output.write(
- f" {filtered} were detected as having no targets "
- f"after the DMA stage. \n")
- output.write(
- f" {invalid} were detected as packets which "
- f"we should not have received in the first place. \n")
- output.write(f" Overall this makes a redundant percentage of "
- f"{percent}\n")
- data = reader.run_query("select * from redundancy_summary")
+ with ProvenanceReader() as db:
+ for data in db.run_query("select * from redundancy_by_core"):
+ (_, _, _, source, _, filtered, invalid, _,
+ redundant, total, percent) = data
+ output.write(f"\ncore {source} \n")
+ output.write(f" {total} packets received. \n")
+ output.write(f" {redundant} were detected as "
+ "redundant packets by the bitfield filter. \n")
+ output.write(
+ f" {filtered} were detected as having no targets "
+ f"after the DMA stage. \n")
+ output.write(
+ f" {invalid} were detected as packets which "
+ f"we should not have received in the first place. \n")
+ output.write(f" Overall this makes a redundant percentage of "
+ f"{percent}\n")
+ data = db.run_query("select * from redundancy_summary")
(sum_total, max_total, min_total, avg_total,
sum_reduant, max_redundant, min_redundant, avg_redundant,
max_percent, min_percent, avg_percent, global_percent) = data[0]
diff --git a/spynnaker/pyNN/spinnaker.py b/spynnaker/pyNN/spinnaker.py
index 4582b5be8ab..1552d114622 100644
--- a/spynnaker/pyNN/spinnaker.py
+++ b/spynnaker/pyNN/spinnaker.py
@@ -29,7 +29,7 @@
from spinn_front_end_common.interface.abstract_spinnaker_base import (
AbstractSpinnakerBase)
from spinn_front_end_common.interface.provenance import (
- FecTimer, ProvenanceWriter, TimerCategory, TimerWork)
+ FecTimer, GlobalProvenance, TimerCategory, TimerWork)
from spinn_front_end_common.utilities.constants import (
MICRO_TO_MILLISECOND_CONVERSION)
from spinn_front_end_common.utilities.exceptions import ConfigurationException
@@ -116,7 +116,7 @@ def __init__(
# set up machine targeted data
self._set_up_timings(timestep, min_delay, time_scale_factor)
- with ProvenanceWriter() as db:
+ with GlobalProvenance() as db:
db.insert_version("sPyNNaker_version", _version.__version__)
db.insert_version("pyNN_version", pynn_version)
db.insert_version("quantities_version", quantities_version)
diff --git a/spynnaker_integration_tests/test_debug_mode/check_debug.py b/spynnaker_integration_tests/test_debug_mode/check_debug.py
index d79c4ce4dfe..edd0ba438d1 100644
--- a/spynnaker_integration_tests/test_debug_mode/check_debug.py
+++ b/spynnaker_integration_tests/test_debug_mode/check_debug.py
@@ -31,6 +31,8 @@
# import EnergyReport
from spinn_front_end_common.utilities.report_functions.board_chip_report \
import AREA_CODE_REPORT_NAME
+from spinn_front_end_common.utilities.report_functions.timer_report import (
+ TIMER_FILENAME)
from spinn_front_end_common.utility_models import \
DataSpeedUpPacketGatherMachineVertex
from spinnaker_testbase import BaseTestCase
@@ -105,24 +107,44 @@ def debug(self):
found = os.listdir(SpynnakerDataView.get_run_dir_path())
for report in reports:
self.assertIn(report, found)
+ self.assertIn("data.sqlite3", found)
+ self.assertIn("ds.sqlite3", found)
+ self.assertIn("redundant_packet_count.rpt", found)
sim.run(10)
pop.get_data("v")
# No point in checking files they are already there
sim.reset()
+ found = os.listdir(SpynnakerDataView.get_run_dir_path())
+ self.assertIn("chip_active_report.rpt", found)
pop.get_data("v")
SpynnakerDataView.set_requires_data_generation()
sim.run(10)
pop.get_data("v")
+ found = os.listdir(SpynnakerDataView.get_run_dir_path())
+ self.assertIn("data1.sqlite3", found)
+ self.assertIn("redundant_packet_count1.rpt", found)
+ self.assertIn("ds1.sqlite3", found)
# No point in checking files they are already there
+ old_run = SpynnakerDataView.get_run_dir_path()
sim.reset()
+ found = os.listdir(old_run)
+ self.assertIn("chip_active_report1.rpt", found)
+
SpynnakerDataView.set_requires_mapping()
sim.run(10)
pop.get_data("v")
+ sim.end()
+
found = os.listdir(SpynnakerDataView.get_run_dir_path())
for report in reports:
self.assertIn(report, found)
+ self.assertIn("data2.sqlite3", found)
+ self.assertIn("redundant_packet_count2.rpt", found)
+ self.assertIn("ds2.sqlite3", found)
+ self.assertIn("chip_active_report2.rpt", found)
- sim.end()
+ found = os.listdir(SpynnakerDataView.get_timestamp_dir_path())
+ self.assertIn(TIMER_FILENAME, found)
diff --git a/spynnaker_integration_tests/test_many_boards/many_boards.py b/spynnaker_integration_tests/test_many_boards/many_boards.py
index cf64ead5ab9..d9fe9cd4861 100644
--- a/spynnaker_integration_tests/test_many_boards/many_boards.py
+++ b/spynnaker_integration_tests/test_many_boards/many_boards.py
@@ -15,7 +15,7 @@
import time
from unittest import SkipTest
from spinn_utilities.config_holder import get_config_bool
-from spinn_front_end_common.interface.provenance import ProvenanceReader
+from spinn_front_end_common.interface.provenance import GlobalProvenance
from spynnaker.pyNN.exceptions import ConfigurationException
import pyNN.spiNNaker as sim
from spynnaker_integration_tests.scripts import check_data
@@ -87,7 +87,8 @@ def do_run(self):
for pop in self._pops:
check_data(pop, self._expected_spikes, self.simtime)
t_after_check = time.time()
- results = ProvenanceReader().get_run_time_of_BufferExtractor()
+ with GlobalProvenance() as db:
+ results = db.get_run_time_of_BufferExtractor()
self.report(results, report_file)
self.report(
"machine run time was: {} seconds\n".format(
diff --git a/spynnaker_integration_tests/test_onchip_compressor/many_routes.py b/spynnaker_integration_tests/test_onchip_compressor/many_routes.py
index 829217b776b..5d36cb9565d 100644
--- a/spynnaker_integration_tests/test_onchip_compressor/many_routes.py
+++ b/spynnaker_integration_tests/test_onchip_compressor/many_routes.py
@@ -14,7 +14,7 @@
# along with this program. If not, see .
import math
from unittest import SkipTest
-from spinn_front_end_common.interface.provenance import ProvenanceReader
+from spinn_front_end_common.interface.provenance import GlobalProvenance
from spynnaker.pyNN.exceptions import ConfigurationException
import pyNN.spiNNaker as sim
from spynnaker.pyNN.extra_algorithms.splitter_components import (
@@ -76,6 +76,7 @@ def do_run():
receptor_type="inhibitory")
sim.run(1)
- t = ProvenanceReader().get_timer_provenance("Routing table loader")
+ with GlobalProvenance() as db:
+ t = db.get_timer_provenance("Routing table loader")
assert t == "", "Routing table loader should not have run"
sim.end()
diff --git a/spynnaker_integration_tests/test_onchip_compressor/one_route.py b/spynnaker_integration_tests/test_onchip_compressor/one_route.py
index e87fa74bc4d..35aa45a6c9e 100644
--- a/spynnaker_integration_tests/test_onchip_compressor/one_route.py
+++ b/spynnaker_integration_tests/test_onchip_compressor/one_route.py
@@ -14,7 +14,7 @@
# along with this program. If not, see .
import math
from unittest import SkipTest
-from spinn_front_end_common.interface.provenance import ProvenanceReader
+from spinn_front_end_common.interface.provenance import GlobalProvenance
from spynnaker.pyNN.exceptions import ConfigurationException
import pyNN.spiNNaker as sim
from spynnaker.pyNN.extra_algorithms.splitter_components import (
@@ -80,6 +80,7 @@ def do_one_run():
receptor_type="inhibitory")
sim.run(1)
- t = ProvenanceReader().get_timer_provenance("Routing table loader")
+ with GlobalProvenance() as db:
+ t = db.get_timer_provenance("Routing table loader")
assert t == "", "Routing table loader should not have run"
sim.end()
diff --git a/unittests/test_using_virtual_board/test_debug_mode/test_debug.py b/unittests/test_using_virtual_board/test_debug_mode/test_debug.py
index e01e676ec71..4795ec1614b 100644
--- a/unittests/test_using_virtual_board/test_debug_mode/test_debug.py
+++ b/unittests/test_using_virtual_board/test_debug_mode/test_debug.py
@@ -19,6 +19,8 @@
reports_names
from spinn_front_end_common.utilities.report_functions.network_specification \
import _FILENAME as network_specification_file_name
+from spinn_front_end_common.utilities.report_functions.timer_report import (
+ TIMER_FILENAME)
from spinnaker_testbase import BaseTestCase
from spynnaker.pyNN.data import SpynnakerDataView
from spynnaker.pyNN.extra_algorithms.\
@@ -64,7 +66,7 @@ def debug(self):
# write_network_specification_report
network_specification_file_name,
# write_provenance_data
- "provenance_data",
+ "data.sqlite3",
# write_tag_allocation_reports
reports_names._TAGS_FILENAME,
# write_algorithm_timings
@@ -75,7 +77,7 @@ def debug(self):
# DataSpeedUpPacketGatherMachineVertex.REPORT_NAME
_GRAPH_NAME,
# TODO why svg when default is png
- _GRAPH_NAME + ".svg",
+ _GRAPH_NAME + ".svg"
]
sim.setup(1.0)
pop = sim.Population(100, sim.IF_curr_exp, {}, label="pop")
@@ -88,10 +90,14 @@ def debug(self):
pop.get_data("v")
sim.end()
+ # Check stuff in the run directory
found = os.listdir(SpynnakerDataView.get_run_dir_path())
- print(found)
for report in reports:
self.assertIn(report, found)
+ self.assertIn("ds.sqlite3", found)
+ # check stuff outside of the run directory
+ found = os.listdir(SpynnakerDataView.get_timestamp_dir_path())
+ self.assertIn(TIMER_FILENAME, found)
def test_debug(self):
self.runsafe(self.debug)