/*! \file distribution_server.hpp \author Ha NGUYEN \since 13 Jan 2015 \date 04 Feb 2015 \brief Index distribution on server side. */ #ifndef __XIOS_DISTRIBUTION_SERVER_HPP__ #define __XIOS_DISTRIBUTION_SERVER_HPP__ #include "distribution.hpp" namespace xios { /*! \class CDistributionServer The class, for now, plays a role of computing local index for writing data on server */ class CDistributionServer : public CDistribution { public: /** Default constructor */ CDistributionServer(int rank, int dims, const CArray& globalIndex = CArray()); CDistributionServer(int rank, const std::vector& nZoomBeginServer, const std::vector& nZoomSizeServer, const std::vector& nGlobal); CDistributionServer(int rank, const std::vector& nZoomBeginServer, const std::vector& nZoomSizeServer, const std::vector& nZoomBeginGlobal, const std::vector& nGlobal); CDistributionServer(int rank, const std::vector >& globalIndexElements, const CArray& elementOrder, const std::vector& nZoomBeginServer, const std::vector& nZoomSizeServer, const std::vector& nZoomBeginGlobal, const std::vector& nGlobal); /** Default destructor */ virtual ~CDistributionServer(); const std::vector& getZoomBeginGlobal() const; const std::vector& getZoomBeginServer() const; const std::vector& getZoomSizeServer() const; const GlobalLocalMap& getGlobalLocalIndex() const { return globalLocalIndexMap_; } int getGridSize() const; virtual void computeLocalIndex(CArray& globalIndex); virtual void computeGlobalIndex(CArray& indexes) const; virtual void partialClear(void); //! clear heavy sized attibutes protected: virtual void createGlobalIndex(); void createGlobalIndex(const std::vector >& globalIndexElements, const CArray& elementOrder); protected: GlobalLocalMap globalLocalIndexMap_; private: std::vector nGlobal_; std::vector nZoomBeginGlobal_; std::vector nZoomSize_; std::vector nZoomBegin_; }; } // namespace xios #endif // __XIOS_DISTRIBUTION_SERVER_HPP__