10 #ifndef __XIOS_SERVER_DISTRIBUTION_DESCRIPTION_HPP
11 #define __XIOS_SERVER_DISTRIBUTION_DESCRIPTION_HPP
15 #include <unordered_map>
45 int positionDimensionDistributed = 1);
88 #endif // __XIOS_SERVER_DISTRIBUTION_DESCRIPTION_HPP
This class contains information that describe distribution of servers.
int getDimensionDistributed()
int computeRootDistribution(int nServer, int positionDimensionDistributed=1)
Compute global index of servers with root distribution : only root server will received data...
std::vector< int > computeServerGlobalIndexInRange(const std::pair< size_t, size_t > &indexBeginEnd, int positionDimensionDistributed=1)
Compute global index assigned to a server with a range.E.g: if a grid has 100 points and there are 2 ...
std::vector< std::vector< int > > getServerDimensionSizes() const
Get size of each dimension on distributed server.
void computePlanDistribution(int nServer)
std::vector< std::vector< int > > getServerIndexBegin() const
Get index begin of each dimension on distributed server.
const std::vector< CArray< size_t, 1 > > & getGlobalIndex() const
Get global index on distributed server.
ServerDistributionType serverType_
Number of server.
int positionDimensionDistributed_
std::unordered_map< size_t, int > globalIndex_
Type of distribution on server side.
void computeRangeProcIndex(int clientRank, int clientSize, int rangeProcSize, int &rangeBegin, int &rangeSize)
Compute a range of index on server which a client holds For a range of index on a specific server...
virtual ~CServerDistributionDescription()
std::vector< std::vector< int > > indexBegin_
Begin index of each dimension.
void computeServerDistribution(bool doComputeGlobalIndex=false, int positionDimensionDistributed=1)
Compute pre-defined global index distribution of server(s).
int nServer_
Position of dimension distributed on server side (by default, the second dimension) ...
std::vector< std::vector< int > > dimensionSizes_
Size of each dimension.
const std::unordered_map< size_t, int > & getGlobalIndexRange() const
Get global index calculated by computeServerGlobalIndexInRange.
std::vector< int > nGlobal_
Global size of each dimension.
CServerDistributionDescription(const std::vector< int > &globalDimensionSize, int nServer, ServerDistributionType serType=BAND_DISTRIBUTION)
std::vector< int > computeServerGlobalByElement(std::vector< std::unordered_map< size_t, std::vector< int > > > &indexServerOnElement, int rank, int clientSize, const CArray< int, 1 > &axisDomainOrder, int positionDimensionDistributed=1)
Compute the global index of grid elements (domain, axis) and their associated server rank...
static int defaultDistributedDimension(int gridDimension, ServerDistributionType serType=BAND_DISTRIBUTION)
int computeBandDistribution(int nServer, int positionDimensionDistributed=1)
Compute global index of servers with band distribution.
std::vector< CArray< size_t, 1 > > vecGlobalIndex_
In case we need only global index of one server with specific rank.