diff --git a/spinn_front_end_common/interface/interface_functions/compute_energy_used.py b/spinn_front_end_common/interface/interface_functions/compute_energy_used.py index 0fd1ebf675..8bc546121e 100644 --- a/spinn_front_end_common/interface/interface_functions/compute_energy_used.py +++ b/spinn_front_end_common/interface/interface_functions/compute_energy_used.py @@ -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 diff --git a/spinn_front_end_common/interface/interface_functions/host_bit_field_router_compressor.py b/spinn_front_end_common/interface/interface_functions/host_bit_field_router_compressor.py index 882b3b3c2e..6b7e47c6ad 100644 --- a/spinn_front_end_common/interface/interface_functions/host_bit_field_router_compressor.py +++ b/spinn_front_end_common/interface/interface_functions/host_bit_field_router_compressor.py @@ -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) @@ -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) @@ -421,7 +418,7 @@ 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 @@ -429,7 +426,6 @@ def _read_in_bit_fields( :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. @@ -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 @@ -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)