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

#include <grid_load_balancing.h>

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

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ StripProcessMapping()

fpmas::model::StripProcessMapping::StripProcessMapping ( DiscreteCoordinate  width,
DiscreteCoordinate  height,
api::communication::MpiCommunicator comm 
)

GridProcessMapping constructor.

Parameters
widthglobal grid width
heightglobal grid height
commMPI communicator

Member Function Documentation

◆ process()

int fpmas::model::StripProcessMapping::process ( DiscretePoint  point) const
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].

Parameters
pointdiscrete point of the grid
Returns
process associated to point

Implements fpmas::model::GridProcessMapping.

◆ gridDimensions()

GridDimensions fpmas::model::StripProcessMapping::gridDimensions ( int  process) const
overridevirtual

Returns the dimensions of the local grid part associated to the specified process.

Implements fpmas::model::GridProcessMapping.


The documentation for this class was generated from the following files: