![]() |
fpmas 1.6
|
#include <grid_load_balancing.h>
Public Member Functions | |
TreeProcessMapping (DiscreteCoordinate width, DiscreteCoordinate height, api::communication::MpiCommunicator &comm) | |
TreeProcessMapping (const TreeProcessMapping &)=delete | |
TreeProcessMapping & | operator= (const TreeProcessMapping &)=delete |
int | process (DiscretePoint point) const override |
GridDimensions | gridDimensions (int process) const override |
virtual int | process (DiscretePoint point) const =0 |
virtual GridDimensions | gridDimensions (int process) const =0 |
Fast and simple algorithm to partition a 2D grid.
The grid is recursively split in both directions of the space in order to minimize sizes of frontiers between processes. When the count of processes in a power of 2, the algorithm produces a "classical" grid decomposition as performed by RepastHPC.
The algorithm can handle any process count, including those that are not a power of 2.
The grid can be of any size, without any restriction on width or height.
fpmas::model::TreeProcessMapping::TreeProcessMapping | ( | DiscreteCoordinate | width, |
DiscreteCoordinate | height, | ||
api::communication::MpiCommunicator & | comm | ||
) |
TreeProcessMapping constructor.
width | width of the grid |
height | height of the grid |
comm | MPI communicator |
|
overridevirtual |
Returns the rank of the process that owns the specified point, according to the current GridProcessMapping implementation.
In other terms, this is the rank of the process where the GridCell located at point
and all SpatialAgents located in it will be LOCAL.
Implements fpmas::model::GridProcessMapping.
|
overridevirtual |
Returns the dimensions of the local grid part associated to the specified process.
Implements fpmas::model::GridProcessMapping.