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

#include <grid_load_balancing.h>

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

Public Member Functions

 TreeProcessMapping (DiscreteCoordinate width, DiscreteCoordinate height, api::communication::MpiCommunicator &comm)
 
 TreeProcessMapping (const TreeProcessMapping &)=delete
 
TreeProcessMappingoperator= (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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TreeProcessMapping()

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

TreeProcessMapping constructor.

Parameters
widthwidth of the grid
heightheight of the grid
commMPI communicator

Member Function Documentation

◆ process()

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

◆ gridDimensions()

GridDimensions fpmas::model::TreeProcessMapping::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: