fpmas 1.6
Public Member Functions | List of all members
fpmas::model::CellLoadBalancing Class Reference

#include <cell_load_balancing.h>

Inheritance diagram for fpmas::model::CellLoadBalancing:
Inheritance graph
[legend]
Collaboration diagram for fpmas::model::CellLoadBalancing:
Collaboration graph
[legend]

Public Member Functions

 CellLoadBalancing (api::communication::MpiCommunicator &comm, api::graph::LoadBalancing< api::model::AgentPtr > &cell_lb)
 
api::graph::PartitionMap balance (api::graph::NodeMap< api::model::AgentPtr > nodes) override
 
api::graph::PartitionMap balance (api::graph::NodeMap< api::model::AgentPtr > nodes, api::graph::PartitionMode partition_mode) override
 
- Public Member Functions inherited from fpmas::api::graph::LoadBalancing< api::model::AgentPtr >
virtual PartitionMap balance (NodeMap< api::model::AgentPtr > nodes)=0
 
virtual PartitionMap balance (NodeMap< api::model::AgentPtr > nodes, PartitionMode partition_mode)=0
 

Detailed Description

A load balancing algorithm for SpatialModels.

A regular LoadBalancing algorithm is applied only to the Cell network. Each SpatialAgent is then assigned to the same process as its LOCATION Cell.

This can significantly reduce the LoadBalancing algorithm execution time compared to an application to the global graph, while still providing an efficient partitioning.

When the LoadBalancing algorithm is applied, the weight of each Cell is incremented with the weight of all SpatialAgents located within it in order to take into account the agent distribution.

The usage of this algorithm is recommend when the Cell network is dynamic or the agent distribution is not uniform. Otherwise, the StaticCellLoadBalancing is much more efficient in most of the case.

See also
StaticCellLoadBalancing

Constructor & Destructor Documentation

◆ CellLoadBalancing()

fpmas::model::CellLoadBalancing::CellLoadBalancing ( api::communication::MpiCommunicator comm,
api::graph::LoadBalancing< api::model::AgentPtr > &  cell_lb 
)
inline

CellLoadBalancing constructor.

Parameters
commMPI communicator
cell_lbLoadBalancing algorithm used to partition the cell network

Member Function Documentation

◆ balance() [1/2]

api::graph::PartitionMap fpmas::model::CellLoadBalancing::balance ( api::graph::NodeMap< api::model::AgentPtr nodes)
override

Deprecated:
Deprecated in favor of balance(NodeMap<T>, PartitionMode)

◆ balance() [2/2]

api::graph::PartitionMap fpmas::model::CellLoadBalancing::balance ( api::graph::NodeMap< api::model::AgentPtr nodes,
api::graph::PartitionMode  partition_mode 
)
override

Builds a partition from the input nodes.

First, a LoadBalancing algorithm is applied only to nodes containing an fpmas::api::model::Cell instance. The specified partition_mode is passed to this LoadBalancing algorithm.

Then, each SpatialAgent is assigned to the same process as its LOCATION Cell.

Other nodes are ignored.

Parameters
nodesnodes on which the algorithm is applied
partition_modepartitioning strategy
Returns
grid based partition

The documentation for this class was generated from the following files: