![]() |
fpmas 1.6
|
#include <cell_load_balancing.h>
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 |
![]() | |
virtual PartitionMap | balance (NodeMap< api::model::AgentPtr > nodes)=0 |
virtual PartitionMap | balance (NodeMap< api::model::AgentPtr > nodes, PartitionMode partition_mode)=0 |
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.
|
inline |
CellLoadBalancing constructor.
comm | MPI communicator |
cell_lb | LoadBalancing algorithm used to partition the cell network |
|
override |
|
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.
nodes | nodes on which the algorithm is applied |
partition_mode | partitioning strategy |