Skip to content

Commit

Permalink
Merge pull request #275 from SpiNNakerManchester/area_code_report
Browse files Browse the repository at this point in the history
report stating what chips reside on what board given ip address.
  • Loading branch information
rowleya committed Feb 22, 2018
2 parents 68aa471 + 8aa00d8 commit eb63fce
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spinn_front_end_common/interface/abstract_spinnaker_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -671,6 +671,11 @@ def _adjust_config(self, runtime):
"EnergySavings", "turn_off_board_after_discovery", "False")
logger.info("[EnergySavings]turn_off_board_after_discovery has"
" been set to False as s using virtual boards")
if self._config.getboolean(
"Reports", "write_board_chip_report") is True:
self._config.set("Reports", "write_board_chip_report", "False")
logger.info("[Reports]write_board_chip_report has been set to"
" False as using virtual boards")

def _set_up_output_folders(self):
""" Sets up the outgoing folders (reports and app data) by creating\
Expand Down Expand Up @@ -1619,6 +1624,10 @@ def _do_mapping(self, run_time, n_machine_time_steps, total_run_time):
optional_algorithms.append(
"RoutingTableFromMachineReport")

# only add board chip report if requested
if self._config.getboolean("Reports", "write_board_chip_report"):
algorithms.append("BoardChipReport")

# only add partitioner report if using an application graph
if (self._config.getboolean(
"Reports", "write_partitioner_reports") and
Expand Down
1 change: 1 addition & 0 deletions spinn_front_end_common/interface/spinnaker.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ write_provenance_data = True
write_tag_allocation_reports = True
write_algorithm_timings = True
write_reload_steps = False
write_board_chip_report = True

# NOTE ***that for bespoke file paths, folders will not be automatically deleted***
# options are DEFAULT or a file path
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import os
from spinn_utilities.progress_bar import ProgressBar


class BoardChipReport(object):
""" Report on memory usage
"""

AREA_CODE_REPORT_NAME = "board_chip_report.txt"

def __call__(self, report_default_directory, machine):
""" creates a report that states where in sdram each region is
:param report_default_directory: the folder where reports are written
:param machine: python representation of the machine
:rtype: None
"""

# create file path
directory_name = os.path.join(
report_default_directory, self.AREA_CODE_REPORT_NAME)

# create the progress bar for end users
progress_bar = ProgressBar(
len(machine.ethernet_connected_chips),
"Writing the board chip report")

# iterate over ethernet chips and then the chips on that board
with open(directory_name, "w") as writer:
for ethernet_connected_chip in \
progress_bar.over(machine.ethernet_connected_chips):
chips = machine.get_chips_on_board(ethernet_connected_chip)
writer.write(
"board with ip address : {} : has chips {}\n".format(
ethernet_connected_chip.ip_address, list(chips)))
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://github.com/SpiNNakerManchester/PACMAN
https://raw.githubusercontent.com/SpiNNakerManchester/PACMAN/master/pacman/operations/algorithms_metadata_schema.xsd">
<algorithm name="BoardChipReport">
<python_module>spinn_front_end_common.utilities.report_functions.board_chip_report</python_module>
<python_class>BoardChipReport</python_class>
<input_definitions>
<parameter>
<param_name>report_default_directory</param_name>
<param_type>ReportFolder</param_type>
</parameter>
<parameter>
<param_name>machine</param_name>
<param_type>MemoryExtendedMachine</param_type>
</parameter>
</input_definitions>
<required_inputs>
<param_name>report_default_directory</param_name>
<param_name>machine</param_name>
</required_inputs>
</algorithm>
<algorithm name="FixedRouteFromMachineReport">
<python_module>spinn_front_end_common.utilities.report_functions.fixed_route_from_machine_report</python_module>
<python_class>FixedRouteFromMachineReport</python_class>
Expand Down

0 comments on commit eb63fce

Please sign in to comment.