![]() |
fpmas 1.6
|
#include <grid_load_balancing.h>
Public Member Functions | |
FastProcessMapping (DiscreteCoordinate width, DiscreteCoordinate height, api::communication::MpiCommunicator &comm) | |
int | process (DiscretePoint point) const override |
GridDimensions | gridDimensions (int process) const override |
int | n () const |
int | p () const |
virtual int | process (DiscretePoint point) const =0 |
virtual GridDimensions | gridDimensions (int process) const =0 |
A very efficient GridProcessMapping, both in terms of speed and partition quality.
The partitioning grid shape is built with a size of n()/p(), where n() and p() are a couple of divisors of the number of processes, such that n()/p() is the closest as possible to width/height.
The process() of each point is queried in constant time.
fpmas::model::FastProcessMapping::FastProcessMapping | ( | DiscreteCoordinate | width, |
DiscreteCoordinate | height, | ||
api::communication::MpiCommunicator & | comm | ||
) |
FastProcessMapping constructor.
width | global grid width |
height | global grid height |
comm | MPI communicator |
|
overridevirtual |
Returns the rank of the process to which the point
is associated.
The result is undefined if the specified point is not contained in the grid of size width x height
, so point.x
must be in [0, width-1]
and point.y
must be in [0, height-1]
.
point | discrete point of the grid |
point
Implements fpmas::model::GridProcessMapping.
|
overridevirtual |
Returns the dimensions of the local grid part associated to the specified process.
Implements fpmas::model::GridProcessMapping.
int fpmas::model::FastProcessMapping::n | ( | ) | const |
Width of the partitioning grid.
int fpmas::model::FastProcessMapping::p | ( | ) | const |
Height of the partitioning grid.