[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 */ |
---|
[552] | 25 | CDistributionServer(int rank, int dims, CArray<size_t,1>* globalIndex = 0); |
---|
| 26 | CDistributionServer(int rank, const std::vector<int>& nZoomBegin, |
---|
| 27 | const std::vector<int>& nZoomSize, const std::vector<int>& nGlobal); |
---|
[551] | 28 | |
---|
| 29 | /** Default destructor */ |
---|
| 30 | virtual ~CDistributionServer(); |
---|
| 31 | |
---|
[554] | 32 | virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex); |
---|
| 33 | virtual void computeLocalIndex(CArray<size_t,1>& globalIndex); |
---|
[552] | 34 | |
---|
[551] | 35 | protected: |
---|
| 36 | virtual void createGlobalIndex(); |
---|
| 37 | private: |
---|
| 38 | std::vector<int> nGlobal_; |
---|
[552] | 39 | std::vector<int> nZoomSize_; |
---|
| 40 | std::vector<int> nZoomBegin_; |
---|
[551] | 41 | }; |
---|
| 42 | |
---|
[552] | 43 | } // namespace xios |
---|
[551] | 44 | #endif // __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|