![]() |
fpmas 1.6
|
#include <cell_load_balancing.h>
Public Member Functions | |
StaticCellLoadBalancing (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.
Just as the CellLoadBalancing algorithm, an existing LoadBalancing algorithm is applied only to the cell network, and agents are systematically assigned to the same process as their location cell.
But this time, the existing algorithm is only applied in PARTITION mode, so that the algorithm only assign agent to the right process in REPARTITION mode.
The usage of this algorithm, much faster than the CellLoadBalancing, is recommend when the Cell network is static and the agent distribution is uniform.
|
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.
In PARTITION mode, a LoadBalancing algorithm in PARTITION mode only to nodes
containing an fpmas::api::model::Cell instance.
Then, in any mode, 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 |