Skip to content

Commit 4abf5e4

Browse files
authored
Merge pull request #1663 from SpiNNakerManchester/categories
Energy Cleanup
2 parents b1fd59b + 6fe29a2 commit 4abf5e4

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

spynnaker/pyNN/spinnaker.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -325,13 +325,12 @@ def stop(self) -> None:
325325
"""
326326
End running of the simulation. Notifying each Population of the end.
327327
"""
328+
super().stop()
329+
328330
# pylint: disable=protected-access
329-
FecTimer.start_category(TimerCategory.SHUTTING_DOWN)
330331
for population in self.__writer.iterate_populations():
331332
population._end()
332333

333-
super().stop()
334-
335334
@staticmethod
336335
def register_binary_search_path(search_path: str) -> None:
337336
"""
@@ -359,13 +358,17 @@ def _execute_synapse_expander(self) -> None:
359358
with FecTimer("Synapse expander", TimerWork.SYNAPSE) as timer:
360359
if timer.skip_if_virtual_board():
361360
return
361+
FecTimer.start_category(TimerCategory.DATA_SPEC_SYNAPSE)
362362
synapse_expander()
363+
FecTimer.end_category(TimerCategory.DATA_SPEC_SYNAPSE)
363364

364365
def _execute_neuron_expander(self) -> None:
365366
with FecTimer("Neuron expander", TimerWork.SYNAPSE) as timer:
366367
if timer.skip_if_virtual_board():
367368
return
369+
FecTimer.start_category(TimerCategory.DATA_SPEC_SYNAPSE)
368370
neuron_expander()
371+
FecTimer.end_category(TimerCategory.DATA_SPEC_SYNAPSE)
369372

370373
def _execute_finish_connection_holders(self) -> None:
371374
with FecTimer("Finish connection holders", TimerWork.OTHER):

spynnaker_integration_tests/test_power_monitoring/test_power_mon.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@
3737

3838
class TestPowerMonitoring(BaseTestCase):
3939

40-
def assert_report(self, n_run: int) -> None:
41-
path = get_report_path("path_energy_report", n_run=n_run)
40+
def assert_report(self) -> None:
41+
path = get_report_path("path_energy_report")
4242
if not os.path.exists(path):
43-
raise AssertionError(f"Unable to find report for run {n_run}")
43+
raise AssertionError("Unable to find report")
4444

4545
def do_run(self) -> None:
4646
synfire_run.do_run(n_neurons, neurons_per_core=neurons_per_core,
@@ -54,9 +54,7 @@ def do_run(self) -> None:
5454
self.assertIsNotNone(hist, "must have a histogram")
5555

5656
# Did we build the report file like we asked for in config file?
57-
self.assert_report(1)
58-
self.assert_report(2)
59-
self.assert_report(3)
57+
self.assert_report()
6058

6159
# Did we output power provenance data, as requested?
6260
exec_times = set()
@@ -66,7 +64,8 @@ def do_run(self) -> None:
6664
"FROM power_provenance "
6765
"WHERE description = 'Exec time (seconds)'"):
6866
exec_times.add(row[0])
69-
self.assertEqual(exec_times, set([0.01, 0.03, 0.06]))
67+
# combined
68+
self.assertEqual(exec_times, set([0.06]))
7069

7170
def test_power_monitoring(self) -> None:
7271
self.runsafe(self.do_run)

0 commit comments

Comments
 (0)