-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from SpiNNakerManchester/area_code_report
report stating what chips reside on what board given ip address.
- Loading branch information
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
spinn_front_end_common/utilities/report_functions/board_chip_report.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters