-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'remotes/origin/master' into p3_fix
- Loading branch information
Showing
7 changed files
with
261 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
from .abstract_partitioner_constraint import AbstractPartitionerConstraint | ||
from .fixed_vertex_atoms_constraint import FixedVertexAtomsConstraint | ||
from .max_vertex_atoms_constraint import MaxVertexAtomsConstraint | ||
from .same_atoms_as_vertex_constraint import SameAtomsAsVertexConstraint | ||
|
||
__all__ = ["AbstractPartitionerConstraint", | ||
"FixedVertexAtomsConstraint", | ||
"MaxVertexAtomsConstraint", | ||
"SameAtomsAsVertexConstraint"] |
40 changes: 40 additions & 0 deletions
40
pacman/model/constraints/partitioner_constraints/fixed_vertex_atoms_constraint.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# pacman import | ||
from .abstract_partitioner_constraint import AbstractPartitionerConstraint | ||
|
||
|
||
class FixedVertexAtomsConstraint(AbstractPartitionerConstraint): | ||
""" A constraint which specifies the exact number of atoms on each\ | ||
division of a vertex | ||
""" | ||
|
||
__slots__ = [ | ||
# The exact number of atoms to split the application vertex into | ||
"_size" | ||
] | ||
|
||
def __init__(self, size): | ||
""" | ||
:param size: The exact number of atoms to split the vertex into | ||
:type size: int | ||
""" | ||
self._size = size | ||
|
||
@property | ||
def size(self): | ||
""" The exact number of atoms to split the vertex into | ||
:rtype: int | ||
""" | ||
return self._size | ||
|
||
def __repr__(self): | ||
return "FixedVertexAtomsConstraint(size={})".format(self._size) | ||
|
||
def __eq__(self, other): | ||
if not isinstance(other, FixedVertexAtomsConstraint): | ||
return False | ||
return self._size == other.size | ||
|
||
def __hash__(self): | ||
return hash((self._size,)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.