ckpttnpy package¶
Submodules¶
ckpttnpy.FMBiConstrMgr module¶
- class ckpttnpy.FMBiConstrMgr.FMBiConstrMgr(hyprgraph, bal_tol, module_weight, num_parts=2)[source]¶
Bases:
FMConstrMgr
The FMBiConstrMgr class is a subclass of FMConstrMgr that overrides the select_togo method to return 0 if diff[0] is less than diff[1], otherwise it returns 1.
- bal_tol¶
- diff¶
- hyprgraph¶
- lowerbound¶
- module_weight¶
- num_parts¶
- select_togo() int [source]¶
The function select_togo returns 0 if the first element of self.diff is less than the second element, otherwise it returns 1. :return: an integer value.
- totalweight¶
- weight¶
ckpttnpy.FMBiGainCalc module¶
ckpttnpy.FMBiGainMgr module¶
ckpttnpy.FMConstrMgr module¶
This file contains the class FMConstrMgr.
- class ckpttnpy.FMConstrMgr.FMConstrMgr(hyprgraph, bal_tol, module_weight, num_parts=2)[source]¶
Bases:
object
_summary_
The FMConstrMgr class represents a manager for constructing a finite element model, with various attributes related to weight, tolerance, module weight, number of parts, difference, total weight, and lower bound.
- bal_tol¶
- check_constraints(move_info_v) bool [source]¶
The function check_constraints checks if a given move satisfies certain constraints.
- Parameters:
move_info_v – A tuple containing three elements: v, from_part, and an underscore
- Returns:
a boolean value.
- check_legal(move_info_v) LegalCheck [source]¶
[summary]
- diff¶
- get_module_weight(v) int [source]¶
The function get_module_weight returns the weight of a module, given its index.
- Parameters:
v – The parameter v is of type size_t and it represents the index or key used to access
the module_weight dictionary :return: the value of 1 if self.module_weight is None, otherwise it is returning the value of self.module_weight[v].
- hyprgraph¶
- init(part: Dict[Any, int] | List[int]) None [source]¶
The init function initializes the diff list based on the module weights and the partition of the vertices.
- Parameters:
part – The part parameter is of type Part and it represents a partition of the nodes in a
graph. Each node is assigned to a part, and the part parameter stores this assignment information :type part: Part
- lowerbound¶
- module_weight¶
- num_parts¶
- totalweight¶
- update_move(move_info_v) None [source]¶
The update_move function updates the diff dictionary by adding the weight to the to_part key and subtracting the weight from the from_part key.
- Parameters:
move_info_v – The move_info_v parameter is a tuple containing three elements. The first
element is not used in this method, so it is ignored. The second element, from_part, represents the part from which the move is being made. The third element, to_part, represents the part to
- weight¶
- class ckpttnpy.FMConstrMgr.LegalCheck(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases:
Enum
Check if the move of v can satisfied, GetBetter, or NotSatisfied
The LegalCheck class is used to determine if a move can be satisfied, get better, or is not satisfied.
Examples
>>> LegalCheck.NotSatisfied <LegalCheck.NotSatisfied: 0>
- AllSatisfied = 2¶
- GetBetter = 1¶
- NotSatisfied = 0¶
ckpttnpy.FMGainMgr module¶
ckpttnpy.FMKWayConstrMgr module¶
- class ckpttnpy.FMKWayConstrMgr.FMKWayConstrMgr(hyprgraph, bal_tol, module_weight, num_parts: int)[source]¶
Bases:
FMConstrMgr
The FMKWayConstrMgr class is a subclass of FMConstrMgr that initializes with a list of illegal parts.
- bal_tol¶
- check_legal(move_info_v)[source]¶
The function check_legal checks if a move is legal and returns the status of the move.
- Parameters:
move_info_v – The move_info_v parameter is a tuple containing three elements. The first
element is not used in this function. The second element, from_part, represents the part from which the move is being made. The third element, to_part, represents the part to which the move is being :return: the value of the variable “status”. If “status” is not equal to “LegalCheck.AllSatisfied”, then the function will return the value of “status”. Otherwise, it will return “LegalCheck.AllSatisfied”.
- diff¶
- hyprgraph¶
- init(part: Dict[Any, int] | List[int])[source]¶
The init function initializes the illegal attribute by checking if each element in self.diff is less than self.lowerbound.
- Parameters:
part – The part parameter is of type Part and it represents some part of an object or
system :type part: Part
- lowerbound¶
- module_weight¶
- num_parts¶
- select_togo()[source]¶
The function select_togo returns the index of the minimum value in the diff list. :return: The index of the minimum value in the list self.diff.
- totalweight¶
- weight¶
ckpttnpy.FMKWayGainCalc module¶
ckpttnpy.FMKWayGainMgr module¶
ckpttnpy.FMPartMgr module¶
ckpttnpy.HierNetlist module¶
ckpttnpy.MLPartMgr module¶
ckpttnpy.PartMgrBase module¶
- class ckpttnpy.PartMgrBase.PartMgrBase(hyprgraph, gain_mgr, constr_mgr)[source]¶
Bases:
object
- init(part: Dict[Any, int] | List[int])[source]¶
The init function initializes the totalcost attribute and calls the init method of the gain_mgr and validator objects.
- Parameters:
part (Part) – The “part” parameter is of type “Part” and it represents some kind of part object
- legalize(part: Dict[Any, int] | List[int])[source]¶
The legalize function is used to perform a legalization process on a given part in a graph.
- Parameters:
part – The part parameter represents the current partitioning of the modules. It is a data
structure that assigns each module to a specific partition :type part: Part :return: The function legalize returns the value of the variable legalcheck.
- optimize(part: Dict[Any, int] | List[int])[source]¶
The optimize function iteratively optimizes the cost of a given part until no further improvement can be made.
- Parameters:
part – The “part” parameter is an object of type “Part”. It is used as input for the
optimization process :type part: Part
- abstract restore_part_info(snapshot, part: Dict[Any, int] | List[int])[source]¶
The function restore_part_info restores the information of a specific part from a given snapshot.
- Parameters:
snapshot – A snapshot of the part’s information that needs to be restored. This could be a
dictionary, object, or any other data structure that contains the necessary information to restore the part :param part: The “part” parameter is of type “Part” :type part: Part
- abstract take_snapshot(part: Dict[Any, int] | List[int])[source]¶
The take_snapshot function is an abstract method that takes a Part object as an argument and returns a value.
- Parameters:
part – The “part” parameter is of type “Part” and is used to specify the part of the system
for which a snapshot needs to be taken :type part: Part
ckpttnpy.min_cover module¶
ckpttnpy.skeleton module¶
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following lines in the
[options.entry_points]
section in setup.cfg
:
console_scripts =
fibonacci = ckpttnpy.skeleton:run
Then run pip install .
(or pip install -e .
for editable mode)
which will install the command fibonacci
inside your current environment.
Besides console scripts, the header (i.e. until _logger
…) of this file can
also be used as template for Python modules.
Note
This skeleton file can be safely removed if not needed!
References
- ckpttnpy.skeleton.main(args)[source]¶
Wrapper allowing
fib()
to be called with string arguments in a CLI fashionInstead of returning the value from
fib()
, it prints the result to thestdout
in a nicely formatted message.- Parameters:
args (List[str]) – command line parameters as list of strings (for example
["--verbose", "42"]
).
- ckpttnpy.skeleton.parse_args(args)[source]¶
Parse command line parameters
- Parameters:
args (List[str]) – command line parameters as list of strings (for example
["--help"]
).- Returns:
command line parameters namespace
- Return type: