Skip to content

Commit

Permalink
chip get_user_processors_ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Oct 9, 2023
1 parent 9d60961 commit dd10414
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 19 deletions.
6 changes: 2 additions & 4 deletions pacman/operations/placer_algorithms/application_placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,7 @@ def _do_fixed_location(vertices, sdram, placements, machine, next_chip_space):
f"Constrained to chip {x, y} but no such chip")
on_chip = placements.placements_on_chip(x, y)
cores_used = {p.p for p in on_chip}
cores = set(p.processor_id for p in chip.processors
if not p.is_monitor) - cores_used
cores = set(chip.get_user_processors_ids()) - cores_used
next_cores = iter(cores)
for vertex in vertices:
next_core = None
Expand Down Expand Up @@ -576,8 +575,7 @@ class _ChipWithSpace(object):

def __init__(self, chip, used_processors, used_sdram):
self.chip = chip
self.cores = set(p.processor_id for p in chip.processors
if not p.is_monitor)
self.cores = set(p.processor_id for p in chip.user_processors)
self.cores -= used_processors
self.sdram = chip.sdram - used_sdram

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,9 @@ def do_too_many_ip_tags_for_1_board(self, machine):
eth_chips = machine.ethernet_connected_chips
eth_chip = eth_chips[0]
eth_chip_2 = machine.get_chip_at(eth_chip.x + 1, eth_chip.y + 1)
eth_procs = [
proc.processor_id for proc in eth_chip.processors
if not proc.is_monitor]
procs = [proc for proc in eth_chip_2.processors if not proc.is_monitor]
eth2_procs = [proc.processor_id for proc in procs]
proc = procs[-1]
eth_procs = list(eth_chip.get_user_processors_ids())
eth2_procs = list(eth_chip_2.get_user_processors_ids())
proc = eth2_procs[-1]
eth_vertices = [
SimpleMachineVertex(
sdram=ConstantSDRAM(0),
Expand Down Expand Up @@ -125,9 +122,7 @@ def test_fixed_tag(self):
machine = virtual_machine(8, 8)
writer.set_machine(machine)
chip00 = machine.get_chip_at(0, 0)
procs = [
proc.processor_id for proc in chip00.processors
if not proc.is_monitor]
procs = list(chip00.get_user_processors_ids())
placements = Placements()
for i in range(5):
vertex = SimpleMachineVertex(
Expand All @@ -146,9 +141,7 @@ def do_fixed_repeat_tag(self, machine):
writer = PacmanDataWriter.mock()
writer.set_machine(machine)
chip00 = machine.get_chip_at(0, 0)
procs = [
proc.processor_id for proc in chip00.processors
if not proc.is_monitor]
procs = list(chip00.get_user_processors_ids())
placements = Placements()
for i in range(3):
vertex = SimpleMachineVertex(
Expand Down Expand Up @@ -182,9 +175,7 @@ def do_reverse(self, machine):
writer = PacmanDataWriter.mock()
writer.set_machine(machine)
chip00 = machine.get_chip_at(0, 0)
procs = [
proc.processor_id for proc in chip00.processors
if not proc.is_monitor]
procs = list(chip00.get_user_processors_ids())
placements = Placements()
vertex = SimpleMachineVertex(
sdram=ConstantSDRAM(0),
Expand Down

0 comments on commit dd10414

Please sign in to comment.