Skip to content

Commit

Permalink
Merge 123eb51 into be0899c
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Feb 12, 2020
2 parents be0899c + 123eb51 commit c4304a2
Show file tree
Hide file tree
Showing 11 changed files with 69 additions and 902 deletions.
26 changes: 0 additions & 26 deletions pacman/operations/algorithms_metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -110,32 +110,6 @@
<param_type>NChipsRequired</param_type>
</outputs>
</algorithm>
<algorithm name="BasicPlacer">
<python_module>pacman.operations.placer_algorithms.basic_placer</python_module>
<python_class>BasicPlacer</python_class>
<input_definitions>
<parameter>
<param_name>machine_graph</param_name>
<param_type>MemoryMachineGraph</param_type>
</parameter>
<parameter>
<param_name>machine</param_name>
<param_type>MemoryExtendedMachine</param_type>
</parameter>
<parameter>
<param_name>plan_n_timesteps</param_name>
<param_type>PlanNTimeSteps</param_type>
</parameter>
</input_definitions>
<required_inputs>
<param_name>machine_graph</param_name>
<param_name>machine</param_name>
<param_name>plan_n_timesteps</param_name>
</required_inputs>
<outputs>
<param_type>MemoryPlacements</param_type>
</outputs>
</algorithm>
<algorithm name="RadialPlacer">
<python_module>pacman.operations.placer_algorithms.radial_placer</python_module>
<python_class>RadialPlacer</python_class>
Expand Down
4 changes: 1 addition & 3 deletions pacman/operations/placer_algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from .radial_placer import RadialPlacer
from .basic_placer import BasicPlacer
from .one_to_one_placer import OneToOnePlacer
from .spreader_placer import SpreaderPlacer

__all__ = ['RadialPlacer', 'BasicPlacer',
'OneToOnePlacer', "SpreaderPlacer"]
__all__ = ['RadialPlacer', 'OneToOnePlacer', "SpreaderPlacer"]
66 changes: 0 additions & 66 deletions pacman/operations/placer_algorithms/basic_placer.py

This file was deleted.

13 changes: 11 additions & 2 deletions uinit_test_objects/placer_test_support.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from pacman.model.graphs.application import ApplicationVertex
from pacman.model.graphs.common import Slice
from pacman.model.graphs.machine import SimpleMachineVertex
from pacman.model.resources import (
ConstantSDRAM, CPUCyclesPerTickResource, DTCMResource, ResourceContainer)
Expand All @@ -24,7 +25,7 @@ def get_resources_used_by_atoms(lo_atom, hi_atom, vertex_in_edges):
cpu_cycles = vertex.get_cpu_usage_for_atoms(lo_atom, hi_atom)
dtcm_requirement = vertex.get_dtcm_usage_for_atoms(lo_atom, hi_atom)
sdram_requirement = vertex.get_sdram_usage_for_atoms(
lo_atom, hi_atom, vertex_in_edges)
Slice(lo_atom, hi_atom))
return ResourceContainer(
cpu_cycles=CPUCyclesPerTickResource(cpu_cycles),
dtcm=DTCMResource(dtcm_requirement),
Expand All @@ -47,9 +48,17 @@ def get_cpu_usage_for_atoms(self, lo_atom, hi_atom):
def get_dtcm_usage_for_atoms(self, lo_atom, hi_atom):
return 200 * (hi_atom - lo_atom)

def get_sdram_usage_for_atoms(self, vertex_slice, graph):
def get_sdram_usage_for_atoms(self, vertex_slice):
return 4000 + 50 * (vertex_slice.hi_atom - vertex_slice.lo_atom)

def create_machine_vertex(
self, vertex_slice, resources_required, label=None,
constraints=None):
pass

def get_resources_used_by_atoms(self, vertex_slice):
pass


class MachineVertex(SimpleMachineVertex):
def __init__(self, lo_atom, hi_atom, resources_required, label=None,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ def test_new_create_vertex_from_vertex_check_resources(self):
subv_from_vert = vert.create_machine_vertex(Slice(0, 9), resources, "")
self.assertEqual(subv_from_vert.resources_required, resources)

@unittest.skip("demonstrating skipping")
def test_create_new_vertex_from_vertex_with_additional_constraints(
self):
"""
Expand All @@ -135,12 +134,12 @@ def test_create_new_vertex_from_vertex_with_additional_constraints(
constraint1 = MaxVertexAtomsConstraint(2)
constraint2 = MaxVertexAtomsConstraint(3)
vert = SimpleTestVertex(10, "New AbstractConstrainedVertex", 256)
vert.add_constraint([constraint1])
vert.add_constraint(constraint1)
subv_from_vert = vert.create_machine_vertex(
Slice(0, 9),
vert.get_resources_used_by_atoms(Slice(0, 9)), "",
[constraint2])
subv_from_vert.add_constraint(constraint1)
self.assertEqual(len(subv_from_vert.constraints), 2)
self.assertEqual(subv_from_vert.constraints[1], constraint1)
self.assertEqual(subv_from_vert.constraints[0], constraint2)
self.assertIn(constraint1, subv_from_vert.constraints)
self.assertIn(constraint2, subv_from_vert.constraints)
Original file line number Diff line number Diff line change
Expand Up @@ -422,38 +422,6 @@ def test_partitioning_with_2_massive_pops(self):
partitioner = PartitionAndPlacePartitioner()
partitioner(self.graph, self.machine, PreAllocatedResourceContainer())

@unittest.skip("Test not implemented yet")
def test_detect_subclass_hierarchy(self):
self.assertEqual(True, False, "Test not implemented yet")

@unittest.skip("Test not implemented yet")
def test_partition_by_atoms(self):
self.assertEqual(True, False, "Test not implemented yet")

@unittest.skip("Test not implemented yet")
def test_scale_down_resource_usage(self):
self.assertEqual(True, False, "Test not implemented yet")

@unittest.skip("Test not implemented yet")
def test_scale_up_resource_usage(self):
self.assertEqual(True, False, "Test not implemented yet")

@unittest.skip("Test not implemented yet")
def test_find_max_ratio(self):
self.assertEqual(True, False, "Test not implemented yet")

@unittest.skip("Test not implemented yet")
def test_locate_vertices_to_partition_now(self):
self.assertEqual(True, False, "Test not implemented yet")

@unittest.skip("Test not implemented yet")
def test_partition_with_supported_constraints_enough_space(self):
self.assertEqual(True, False, "Test not implemented yet")

@unittest.skip("Test not implemented yet")
def test_partition_with_supported_constraints_not_enough_space(self):
self.assertEqual(True, False, "Test not implemented yet")

def test_partition_with_fixed_atom_constraints(self):
"""
test a partitioning with a graph with fixed atom constraint
Expand Down

0 comments on commit c4304a2

Please sign in to comment.