pydcop.distribution.gh_cgdp

GH-CGDP : Greedy Heuristic for Computation Graph distribution

Distribution heuristic based on hosting costs and communication cost, while respecting agents’ capacity.

Greedy algorithm: * place computation with highest footprint first * select agent with enough capacity left and smallest aggregated hosting

and communication costs, according to the communication that have already been placed.

This means that the first computations (with biggest footprint) are mostly placed based on their hosting cost, as most other computations are not distributed yet and we cannot evaluate their communication cost.

candidate_hosts(computation: ComputationNode, footprint: float, computations: List[Tuple], agents: Iterable[AgentDef], communication_load: Callable[[ComputationNode, str], float], mapping: Dict[str, str], fixed_mapping: Dict[str, Tuple[str, float]])

Build a list of candidate agents for a computation.

The list includes agents that have enough capacity to host this computation and is sorted by cost (cheapest cost) where cost is the aggregated hosting and communication cost incurred by hosting the computation on that agent, according to the computation that have been already distributed. This means that the first computations are mostly placed depending on their hosting cost, as most other computations are not distributed yet and we cannot evaluate their communication cost.

Parameters:
  • computation

  • footprint

  • computations

  • agents

  • communication_load

  • mapping

distribute(computation_graph: ComputationGraph, agentsdef: Iterable[AgentDef], hints=None, computation_memory: Callable[[ComputationNode], float] | None = None, communication_load: Callable[[ComputationNode, str], float] | None = None, timeout=None) Distribution

gh-cgdp distribution method.

Heuristic distribution baed on communication and hosting costs, while respecting agent’s capacities

Parameters:
  • computation_graph

  • agentsdef

  • hints

  • computation_memory

  • communication_load

Returns:

The distribution for the computation graph.

Return type:

Distribution