lbaf.Execution.lbsAlgorithmBase.AlgorithmBase class

An abstract base class of load/work balancing algorithms.

Classes

class __metaclass__
Metaclass for defining Abstract Base Classes (ABCs).

Static methods

def factory(algorithm_name: str, parameters: dict, work_model: Model.lbsWorkModelBase.WorkModelBase, logger: logging.Logger)
Instantiate the necessary concrete algorithm.

Methods

def _initialize(self, p_id, phases, statistics)
Factor out pre-execution checks and initalizations.
def _report_final_mapping(self, logger)
Report final rank object mapping in debug mode.
def _update_statistics(self, statistics: dict)
Compute and update run statistics.
def execute(self, p_id, phases, statistics, a_min_max)
Execute balancing algorithm on Phase instance.
def get_initial_communications(self)
Return the initial phase communications.
def get_initial_phase(self)
Return initial phase.
def get_rebalanced_phase(self)
Return rebalanced phased.

Special methods

def __init__(self, work_model: Model.lbsWorkModelBase.WorkModelBase, parameters: dict, logger: logging.Logger)
Class constructor.

Method documentation

def lbaf.Execution.lbsAlgorithmBase.AlgorithmBase.execute(self, p_id, phases, statistics, a_min_max)

Execute balancing algorithm on Phase instance.

:param: p_id: index of phase to be rebalanced (all if equal to _) :param: phases: list of Phase instances :param: statistics: dictionary of statistics :param: a_min_max: possibly empty list of optimal arrangements.

def lbaf.Execution.lbsAlgorithmBase.AlgorithmBase.__init__(self, work_model: Model.lbsWorkModelBase.WorkModelBase, parameters: dict, logger: logging.Logger)

Class constructor.

:param work_model: a WorkModelBase instance :param parameters: a dictionary of parameters