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, rank_qoi: str, object_qoi: str)
Instantiate the necessary concrete algorithm.

Methods

def _AlgorithmBase__print_QOI(self, rank_or_obj)
Print list of implemented QOI when invalid QOI is given.
def _initialize(self, p_id, phases, distributions, statistics)
Factor out pre-execution checks and initalizations.
def _report_final_mapping(self, logger)
Report final rank object mapping in debug mode.
def _update_distributions_and_statistics(self, distributions: dict, statistics: dict)
Compute and update run distributions and statistics.
def execute(self, p_id, phases, distributions, statistics, a_min_max)
Execute balancing algorithm on Phase instance.
def get_initial_communications(self)
Return the initial phase communications.
def get_rebalanced_phase(self)
Return phased assigned for processing by algoritm.

Special methods

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

Method documentation

def lbaf.Execution.lbsAlgorithmBase.AlgorithmBase.execute(self, p_id, phases, distributions, 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: distributions: dictionary of load-varying variables :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, rank_qoi: str, object_qoi: str)

Class constructor.

:param work_model: a WorkModelBase instance :param parameters: a dictionary of parameters :param rank_qoi: rank QOI to track :param object_qoi: object QOI to track.