lbaf.Model.lbsPhase.Phase class

A class representing a phase of objects distributed across ranks.

Methods

def _Phase__update_or_create_directed_edge(self, from_id: int, to_id: int, v: float)
Convenience method to update or create directed edge with given volume.
def compute_edges(self)
Compute and return dict of communication edge IDs to volumes.
def get_communications(self)
Return the phase communications dict.
def get_edge_maxima(self)
Reduce directed edges into undirected with maximum.
def get_edges(self)
Retrieve communication edges of phase.
def get_id(self)
Retrieve index of this phase.
def get_largest_volumes(self)
Return largest directed volumes from undirected ones.
def get_number_of_objects(self)
Return number of objects.
def get_number_of_ranks(self)
Retrieve number of ranks belonging to phase.
def get_object_ids(self)
Return IDs of all objects belonging to phase.
def get_objects(self)
Return all objects belonging to phase.
def get_objects_dict(self)
Return all objects as dictionaries with `from` and `to` values retrieved from the object communicator.
def get_rank_ids(self)
Retrieve IDs of ranks belonging to phase.
def get_ranks(self)
Retrieve ranks belonging to phase.
def populate_from_log(self, phase_id)
Populate this phase by reading in a load profile from log files.
def populate_from_samplers(self, n_ranks, n_objects, t_sampler, v_sampler, c_degree, n_r_mapped = 0)
Use samplers to populate either all or n ranks in a phase.
def populate_from_specification(self, spec: Execution.lbsPhaseSpecification.PhaseSpecification, multiple_sharing: bool = False)
Populate this phase using a specification listing phases, ranks, tasks and communications.
def set_communications(self, communications: dict)
Set the phase communications dict.
def set_id(self, p_id: int)
Set index of this phase.
def set_ranks(self, ranks: typing.Set[lbsRank.Rank])
Set list of ranks for this phase.
def transfer_object(self, r_src: lbsRank.Rank, o: lbsObject.Object, r_dst: lbsRank.Rank)
Transfer object from source to destination rank.
def transfer_objects(self, r_src: lbsRank.Rank, o_src: list, r_dst: lbsRank.Rank, o_dst: typing.Optional[list] = None)
Transfer list of objects between source and destination ranks.
def update_edges(self, o: lbsObject.Object, r_src: lbsRank.Rank, r_dst: lbsRank.Rank)
Update inter-rank communication edges before object transfer.

Special methods

def __init__(self, lgr: logging.Logger, p_id: int = 0, reader: IO.lbsVTDataReader.LoadReader = None)
Class constructor logger: a Logger instance id: an integer indexing the phase ID reader: a JSON VT reader instance