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

#include <grid_load_balancing.h>

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

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FastProcessMapping()

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

FastProcessMapping constructor.

Parameters
widthglobal grid width
heightglobal grid height
commMPI communicator

Member Function Documentation

◆ process()

int fpmas::model::FastProcessMapping::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::FastProcessMapping::gridDimensions ( int  process) const
overridevirtual

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

Implements fpmas::model::GridProcessMapping.

◆ n()

int fpmas::model::FastProcessMapping::n ( ) const

Width of the partitioning grid.

◆ p()

int fpmas::model::FastProcessMapping::p ( ) const

Height of the partitioning grid.


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