SpiNNakerManchester / PACMAN

Partition and Configuration Manager for SpiNNaker
Apache License 2.0
9 stars 7 forks source link

Do we need "Placements" Object #415

Closed Christian-B closed 2 years ago

Christian-B commented 2 years ago

The question is do we need the Placements object not do we need Placement.

The placements object is a Map from vertex to Placement and from core to Placements and indirectly vertex

This is typically used to iterate over the cores after Placement.

The from Vertex to placement direction could easily be done by storing the placement in the vertex. Likely just as x,y, p This is by far the most common direction

Instead of iterating over the Placements could we not iterate over the Vertices?

Sightly harder to replace is the use of the mappings from core to Placement/vertex

The use case of core to Placement are: FixedRouteRouter is_processor_occupied get_vertex_on_processor

HostBasedBitFieldRouterCompressor is_processor_occupied get_placement_of_vertex

BufferManager get_vertex_on_processor

compute_energy_used is_processor_occupied

reports._write_one_chip_application_placement is_processor_occupied

reports._write_one_chip_machine_placement is_processor_occupied

abstract_spnnaker_base.__recover_from_error get_placement_on_processor

energy_report Usage here is not ideal and should be replaced with https://github.com/SpiNNakerManchester/SpiNNFrontEndCommon/pull/907

rowleya commented 2 years ago

If that many things make use of the map from processor to vertex, the map may be needed. This will require more analysis for a full conclusion though, since some minor reordering might make the need go away...

Christian-B commented 2 years ago

Addressed for a major part in https://github.com/SpiNNakerManchester/PACMAN/pull/453 which hides Placements from classes that use the data. Decided to keep the Placements object to avoid putting to much into the View

Also thinking about https://github.com/SpiNNakerManchester/SpiNNFrontEndCommon/issues/954 It may be cleanest to give the Algorithms that add Placement objects the Placements object.