Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chip simplification #548

Merged
merged 10 commits into from
Mar 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions pacman/operations/placer_algorithms/application_placer.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _place_error(
n_placed = placements.n_placements_on_chip(x, y)
system_placed = system_placements.n_placements_on_chip(x, y)
if n_placed - system_placed == 0:
n_procs = machine[x, y].n_user_processors
n_procs = machine[x, y].n_placable_processors
f.write(f" {x}, {y} ({n_procs - system_placed}"
" free cores)\n")

Expand Down Expand Up @@ -237,7 +237,7 @@ def _check_could_fit(
PacmanDataView.get_all_monitor_sdram().get_total_sdram(
PacmanDataView.get_plan_n_timestep()))
max_cores = (
version.max_cores_per_chip - version.n_non_user_cores -
version.max_cores_per_chip - version.n_scamp_cores -
PacmanDataView.get_all_monitor_cores())
n_cores = len(vertices_to_place)
if sdram <= max_sdram and n_cores <= max_cores:
Expand All @@ -257,7 +257,7 @@ def _check_could_fit(
if n_cores > version.max_cores_per_chip:
message += " is more vertices than the number of cores on a chip."
raise PacmanTooBigToPlace(message)
user_cores = version.max_cores_per_chip - version.n_non_user_cores
user_cores = version.max_cores_per_chip - version.n_scamp_cores
if n_cores > user_cores:
message += (
f"is more vertices than the user cores ({user_cores}) "
Expand Down Expand Up @@ -300,7 +300,7 @@ def _do_fixed_location(
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(chip.user_processors_ids) - cores_used
cores = set(chip.placable_processors_ids) - cores_used
next_cores = iter(cores)
for vertex in vertices:
next_core = None
Expand Down Expand Up @@ -553,7 +553,7 @@ def __init__(
:param int used_sdram:
"""
self.chip = chip
self.cores = set(chip.user_processors_ids)
self.cores = set(chip.placable_processors_ids)
self.cores -= used_processors
self.sdram = chip.sdram - used_sdram

Expand Down
2 changes: 1 addition & 1 deletion pacman/utilities/utility_objs/chip_counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ChipCounter(object):
def __init__(self):
version = PacmanDataView.get_machine_version()
self.__n_cores_per_chip = (
version.max_cores_per_chip - version.n_non_user_cores -
version.max_cores_per_chip - version.n_scamp_cores -
PacmanDataView.get_all_monitor_cores())
self.__sdram_per_chip = (
version.max_sdram_per_chip -
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +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 = list(eth_chip.user_processors_ids)
procs = list(eth_chip_2.user_processors)
eth2_procs = [proc.processor_id for proc in procs]
proc = procs[-1]
eth_procs = list(eth_chip.placable_processors_ids)
eth2_procs = list(eth_chip_2.placable_processors_ids)
proc = eth2_procs[-1]
eth_vertices = [
SimpleMachineVertex(
sdram=ConstantSDRAM(0),
Expand Down Expand Up @@ -123,15 +122,15 @@ def test_fixed_tag(self):
machine = virtual_machine(8, 8)
writer.set_machine(machine)
chip00 = machine.get_chip_at(0, 0)
procs = chip00.user_processors_ids
procs = chip00.placable_processors_ids
placements = Placements()
for i in range(5):
vertex = SimpleMachineVertex(
sdram=ConstantSDRAM(0),
iptags=[IPtagResource(
"127.0.0.1", port=10000 + i, strip_sdp=True, tag=1+i)],
label="Vertex {i}")
placements.add_placement(Placement(vertex, 0, 0, next(procs)))
placements.add_placement(Placement(vertex, 0, 0, procs[i]))
writer.set_placements(placements)
writer.set_plan_n_timesteps(1000)
tags = basic_tag_allocator()
Expand All @@ -142,7 +141,7 @@ def do_fixed_repeat_tag(self, machine):
writer = PacmanDataWriter.mock()
writer.set_machine(machine)
chip00 = machine.get_chip_at(0, 0)
procs = chip00.user_processors_ids
procs = chip00.placable_processors_ids
placements = Placements()
for i in range(3):
vertex = SimpleMachineVertex(
Expand All @@ -152,7 +151,7 @@ def do_fixed_repeat_tag(self, machine):
IPtagResource("127.45.0.1", port=10000 + i,
strip_sdp=True, tag=1+i)],
label=f"Vertex {i}")
placements.add_placement(Placement(vertex, 0, 0, next(procs)))
placements.add_placement(Placement(vertex, 0, 0, procs[i]))
writer.set_placements(placements)
writer.set_plan_n_timesteps(1000)
tags = basic_tag_allocator()
Expand All @@ -176,7 +175,7 @@ def do_reverse(self, machine):
writer = PacmanDataWriter.mock()
writer.set_machine(machine)
chip00 = machine.get_chip_at(0, 0)
processor = chip00.get_first_none_monitor_processor()
processor = chip00.placable_processors_ids[0]
placements = Placements()
vertex = SimpleMachineVertex(
sdram=ConstantSDRAM(0),
Expand Down
Loading