[553] | 1 | /*! |
---|
| 2 | \file distribution_server.hpp |
---|
| 3 | \author Ha NGUYEN |
---|
| 4 | \since 13 Jan 2015 |
---|
| 5 | \date 04 Feb 2015 |
---|
| 6 | |
---|
| 7 | \brief Index distribution on server side. |
---|
| 8 | */ |
---|
| 9 | |
---|
[551] | 10 | #ifndef __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|
| 11 | #define __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|
| 12 | |
---|
| 13 | #include "distribution.hpp" |
---|
| 14 | |
---|
| 15 | namespace xios { |
---|
[553] | 16 | |
---|
[552] | 17 | /*! |
---|
[553] | 18 | \class CDistributionServer |
---|
| 19 | The class, for now, plays a role of computing local index for writing data on server |
---|
[552] | 20 | */ |
---|
[551] | 21 | class CDistributionServer : public CDistribution |
---|
| 22 | { |
---|
| 23 | public: |
---|
| 24 | /** Default constructor */ |
---|
[1201] | 25 | CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>()); |
---|
[567] | 26 | CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer, |
---|
[1201] | 27 | const std::vector<int>& nZoomSizeServer, const std::vector<int>& nGlobal); |
---|
| 28 | CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer, |
---|
[567] | 29 | const std::vector<int>& nZoomSizeServer, |
---|
| 30 | const std::vector<int>& nZoomBeginGlobal, |
---|
| 31 | const std::vector<int>& nGlobal); |
---|
[551] | 32 | |
---|
[1201] | 33 | CDistributionServer(int rank, |
---|
| 34 | const std::vector<CArray<int,1> >& globalIndexElements, |
---|
| 35 | const CArray<int,1>& elementOrder, |
---|
| 36 | const std::vector<int>& nZoomBeginServer, |
---|
| 37 | const std::vector<int>& nZoomSizeServer, |
---|
| 38 | const std::vector<int>& nZoomBeginGlobal, |
---|
| 39 | const std::vector<int>& nGlobal); |
---|
| 40 | |
---|
[551] | 41 | /** Default destructor */ |
---|
| 42 | virtual ~CDistributionServer(); |
---|
| 43 | |
---|
[676] | 44 | const std::vector<int>& getZoomBeginGlobal() const; |
---|
| 45 | const std::vector<int>& getZoomBeginServer() const; |
---|
| 46 | const std::vector<int>& getZoomSizeServer() const; |
---|
[1144] | 47 | const GlobalLocalMap& getGlobalLocalIndex() const { return globalLocalIndexMap_; } |
---|
[1099] | 48 | int getGridSize() const; |
---|
[1144] | 49 | |
---|
[554] | 50 | virtual void computeLocalIndex(CArray<size_t,1>& globalIndex); |
---|
[676] | 51 | virtual void computeGlobalIndex(CArray<int,1>& indexes) const; |
---|
[1340] | 52 | virtual void partialClear(void); //! clear heavy sized attibutes |
---|
[552] | 53 | |
---|
[551] | 54 | protected: |
---|
| 55 | virtual void createGlobalIndex(); |
---|
[1202] | 56 | void createGlobalIndex(const std::vector<CArray<int,1> >& globalIndexElements, |
---|
| 57 | const CArray<int,1>& elementOrder); |
---|
| 58 | |
---|
[930] | 59 | protected: |
---|
| 60 | GlobalLocalMap globalLocalIndexMap_; |
---|
| 61 | |
---|
[551] | 62 | private: |
---|
| 63 | std::vector<int> nGlobal_; |
---|
[567] | 64 | std::vector<int> nZoomBeginGlobal_; |
---|
[552] | 65 | std::vector<int> nZoomSize_; |
---|
| 66 | std::vector<int> nZoomBegin_; |
---|
[1201] | 67 | |
---|
[551] | 68 | }; |
---|
| 69 | |
---|
[552] | 70 | } // namespace xios |
---|
[551] | 71 | #endif // __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|