![]() |
fpmas 1.6
|
#include <grid_load_balancing.h>
Public Member Functions | |
StripProcessMapping (DiscreteCoordinate width, DiscreteCoordinate height, api::communication::MpiCommunicator &comm) | |
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 |
1D GridProcessMapping implementation, that produces horizontal or vertical strip shaped partitions.
The grid is divided in a single direction, in order to minimize the size of frontiers.
So, if the width of the grid is greater than its height, the grid is divided using vertical borders, otherwise horizontal borders are used.
This algorithm produces well balanced partitions, but sizes of the frontiers are generally much bigger that ones produced by the TreeProcessMapping, so this last method is preferred.
fpmas::model::StripProcessMapping::StripProcessMapping | ( | DiscreteCoordinate | width, |
DiscreteCoordinate | height, | ||
api::communication::MpiCommunicator & | comm | ||
) |
GridProcessMapping 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.