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

#include <cell_load_balancing.h>

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

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
 
- 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.

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.

See also
CellLoadBalancing

Constructor & Destructor Documentation

◆ StaticCellLoadBalancing()

fpmas::model::StaticCellLoadBalancing::StaticCellLoadBalancing ( 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::StaticCellLoadBalancing::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::StaticCellLoadBalancing::balance ( api::graph::NodeMap< api::model::AgentPtr nodes,
api::graph::PartitionMode  partition_mode 
)
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.

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: