Skip to content

Commit

Permalink
Merge pull request #398 from SpiNNakerManchester/p_list
Browse files Browse the repository at this point in the history
Chip takes lists of Processors
  • Loading branch information
rowleya authored Apr 26, 2024
2 parents 084e7d8 + ac5e1f8 commit a54e3c4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
10 changes: 3 additions & 7 deletions spinnman/messages/sdp/sdp_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,13 +330,9 @@ def get_physical_cpu_id(self) -> str:
:rtype: str
"""
if SpiNNManDataView.has_machine():
chip = SpiNNManDataView.get_machine().get_chip_at(
self._destination_chip_x, self._destination_chip_y)
if chip is not None:
return chip.get_physical_core_string(
self._destination_cpu)
return ""
return SpiNNManDataView.get_physical_core_string(
(self._destination_chip_x, self._destination_chip_y),
self._destination_cpu)

def update_for_send(self, source_x: int, source_y: int):
"""
Expand Down
23 changes: 14 additions & 9 deletions spinnman/processes/get_machine_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,15 +116,20 @@ def _make_chip(self, chip_info: ChipSummaryInfo, machine: Machine) -> Chip:
n_cores = min(chip_info.n_cores, n_cores)
core_states = chip_info.core_states
down_cores = self._ignore_cores_map.get(
(chip_info.x, chip_info.y), None)
(chip_info.x, chip_info.y), set())
if 0 in down_cores:
raise NotImplementedError(
"Declaring scamp core (0) as down is not supported")
cores = list()
for i in range(1, n_cores):
if core_states[i] != CPUState.IDLE:
if i in down_cores:
pass
elif core_states[i] != CPUState.IDLE:
self._report_ignore(
"Not using core {}, {}, {} in state {}",
chip_info.x, chip_info.y, i, core_states[i])
if down_cores is None:
down_cores = set()
down_cores.add(i)
else:
cores.append(i)

# Create the router
router = self._make_router(chip_info, machine)
Expand All @@ -139,14 +144,13 @@ def _make_chip(self, chip_info: ChipSummaryInfo, machine: Machine) -> Chip:

# Create the chip
return Chip(
x=chip_info.x, y=chip_info.y, n_processors=n_cores,
x=chip_info.x, y=chip_info.y, scamp_processors=[0],
placable_processors=cores,
router=router, sdram=sdram_size,
ip_address=chip_info.ethernet_ip_address,
nearest_ethernet_x=chip_info.nearest_ethernet_x,
nearest_ethernet_y=chip_info.nearest_ethernet_y,
down_cores=down_cores, parent_link=chip_info.parent_link,
v_to_p_map=self._virtual_to_physical_map.get(
(chip_info.x, chip_info.y)))
parent_link=chip_info.parent_link)

def _make_router(
self, chip_info: ChipSummaryInfo, machine: Machine) -> Router:
Expand Down Expand Up @@ -255,6 +259,7 @@ def get_machine_details(
ReadMemory((x, y, 0), P_TO_V_ADDR, P_MAPS_SIZE),
functools.partial(self._receive_p_maps, x, y))
self._progress.end()
SpiNNManDataView.set_v_to_p_map(self._virtual_to_physical_map)

# Warn about unexpected missing chips
for (x, y) in p2p_table.iterchips():
Expand Down

0 comments on commit a54e3c4

Please sign in to comment.