-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathcheck_debug.py
More file actions
135 lines (127 loc) · 5.42 KB
/
Copy pathcheck_debug.py
File metadata and controls
135 lines (127 loc) · 5.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright (c) 2017-2019 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from spinn_utilities.config_holder import get_config_bool
import spinn_front_end_common.utilities.report_functions.reports as \
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.drift_report import (
CLOCK_DRIFT_REPORT)
from spinn_front_end_common.utilities.report_functions.\
routing_table_from_machine_report import _FOLDER_NAME as \
routing_tables_from_machine_report
from spinn_front_end_common.utilities.report_functions.\
memory_map_on_host_report import _FOLDER_NAME as \
memory_map_on_host_report
# from spinn_front_end_common.utilities.report_functions.energy_report \
# import EnergyReport
from spinn_front_end_common.utilities.report_functions.board_chip_report \
import AREA_CODE_REPORT_NAME
from spinn_front_end_common.utility_models import \
DataSpeedUpPacketGatherMachineVertex
from spinnaker_testbase import BaseTestCase
from spynnaker.pyNN.data import SpynnakerDataView
from spynnaker.pyNN.extra_algorithms.\
spynnaker_neuron_network_specification_report import (
_GRAPH_NAME, _GRAPH_FORMAT)
import pyNN.spiNNaker as sim
class CheckDebug(BaseTestCase):
"""
that it does not crash in debug mode. All reports on.
"""
def debug(self):
# pylint: disable=protected-access
reports = [
# write_energy_report
# EnergyReport._DETAILED_FILENAME,
# EnergyReport._SUMMARY_FILENAME,
# write_text_specs = False
"data_spec_text_files",
# write_router_reports
reports_names._ROUTING_FILENAME,
# write_partitioner_reports
reports_names._PARTITIONING_FILENAME,
# write_application_graph_placer_report
reports_names._PLACEMENT_VTX_GRAPH_FILENAME,
reports_names._PLACEMENT_CORE_GRAPH_FILENAME,
reports_names._SDRAM_FILENAME,
# repeats reports_names._SDRAM_FILENAME,
# write_router_info_report
reports_names._VIRTKEY_FILENAME,
# write_routing_table_reports
reports_names._ROUTING_TABLE_DIR,
reports_names._C_ROUTING_TABLE_DIR,
reports_names._COMPARED_FILENAME,
# write_routing_tables_from_machine_report
routing_tables_from_machine_report,
# write_memory_map_report
memory_map_on_host_report,
# write_network_specification_report
network_specification_file_name,
# write_provenance_data
"provenance_data",
# write_tag_allocation_reports
reports_names._TAGS_FILENAME,
# write_drift_report_end or start
CLOCK_DRIFT_REPORT,
# write_board_chip_report
AREA_CODE_REPORT_NAME,
_GRAPH_NAME,
_GRAPH_NAME + "." +
_GRAPH_FORMAT,
]
sim.setup(1.0)
if (get_config_bool("Machine", "enable_advanced_monitor_support")
and not get_config_bool("Java", "use_java")):
# write_data_speed_up_report
reports.append(
DataSpeedUpPacketGatherMachineVertex.OUT_REPORT_NAME)
reports.append(DataSpeedUpPacketGatherMachineVertex.IN_REPORT_NAME)
pop = sim.Population(100, sim.IF_curr_exp, {}, label="pop")
pop.record("v")
inp = sim.Population(1, sim.SpikeSourceArray(
spike_times=[0]), label="input")
sim.Projection(inp, pop, sim.AllToAllConnector(),
synapse_type=sim.StaticSynapse(weight=5))
sim.run(0)
pop.get_data("v")
found = os.listdir(SpynnakerDataView.get_run_dir_path())
for report in reports:
self.assertIn(report, found)
self.assertIn("data.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()
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)
# No point in checking files they are already there
sim.reset()
SpynnakerDataView.set_requires_mapping()
sim.run(10)
pop.get_data("v")
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)
sim.end()