Skip to content

Commit

Permalink
Merge pull request #920 from SpiNNakerManchester/missing
Browse files Browse the repository at this point in the history
access missing/ dead processors
  • Loading branch information
rowleya authored Feb 15, 2022
2 parents 9653073 + 343d893 commit 6e58fda
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,11 +283,12 @@ def __get_chip_power_monitor(chip, placements):
# it is its responsibility, but needs the self-partitioning

# start at top, as more likely it was placed on the top
for processor_id in range(chip.n_processors):
if placements.is_processor_occupied(chip.x, chip.y, processor_id):
for processor in chip.processors:
if placements.is_processor_occupied(
chip.x, chip.y, processor.processor_id):
# check if vertex is a chip power monitor
vertex = placements.get_vertex_on_processor(
chip.x, chip.y, processor_id)
chip.x, chip.y, processor.processor_id)
if isinstance(vertex, ChipPowerMonitorMachineVertex):
return vertex

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ def get_bit_field_sdram_base_addresses(
"""
# locate the bitfields in a chip level scope
base_addresses = dict()
n_processors_on_chip = machine.get_chip_at(chip_x, chip_y).n_processors
for p in range(0, n_processors_on_chip):
for p in range(0, Machine.max_cores_per_chip()):
if placements.is_processor_occupied(chip_x, chip_y, p):
vertex = placements.get_vertex_on_processor(chip_x, chip_y, p)

Expand Down Expand Up @@ -327,9 +326,7 @@ def _run(
# read in bitfields.
self._read_in_bit_fields(
transceiver, router_table.x, router_table.y,
bit_field_chip_base_addresses, machine_graph,
placements, machine.get_chip_at(
router_table.x, router_table.y).n_processors)
bit_field_chip_base_addresses, machine_graph, placements)

# execute binary search
self._start_binary_search(router_table, key_atom_map)
Expand Down Expand Up @@ -421,15 +418,14 @@ def _bit_for_neuron_id(self, bit_field, neuron_id):

def _read_in_bit_fields(
self, transceiver, chip_x, chip_y, bit_field_chip_base_addresses,
machine_graph, placements, n_processors_on_chip):
machine_graph, placements):
""" reads in the bitfields from the cores
:param ~.Transceiver transceiver: SpiNNMan instance
:param int chip_x: chip x coord
:param int chip_y: chip y coord
:param ~.MachineGraph machine_graph: machine graph
:param ~.Placements placements: the placements
:param int n_processors_on_chip: the number of processors on this chip
:param dict(int,int) bit_field_chip_base_addresses:
maps core id to base address
:return: dict of lists of processor id to bitfields.
Expand Down Expand Up @@ -488,11 +484,11 @@ def _read_in_bit_fields(
# use the ordered process to find the best ones to do first
self._order_bit_fields(
bit_fields_by_coverage, machine_graph, chip_x, chip_y, placements,
n_processors_on_chip, processor_coverage_by_bitfield)
processor_coverage_by_bitfield)

def _order_bit_fields(
self, bit_fields_by_coverage, machine_graph, chip_x, chip_y,
placements, n_processors_on_chip, processor_coverage_by_bitfield):
placements, processor_coverage_by_bitfield):
"""
Orders the bit fields by redundancy setting the sorted index
Expand All @@ -503,14 +499,13 @@ def _order_bit_fields(
:param int chip_x:
:param int chip_y:
:param ~.Placements placements:
:param int n_processors_on_chip:
:param dict(int,list(int)) processor_coverage_by_bitfield:
"""
sort_index = 0

# get incoming bandwidth for the cores
most_costly_cores = dict()
for processor_id in range(0, n_processors_on_chip):
for processor_id in range(0, Machine.max_cores_per_chip()):
if placements.is_processor_occupied(chip_x, chip_y, processor_id):
vertex = placements.get_vertex_on_processor(
chip_x, chip_y, processor_id)
Expand Down

0 comments on commit 6e58fda

Please sign in to comment.