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 | |
---|
10 | #ifndef __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|
11 | #define __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|
12 | |
---|
13 | #include "distribution.hpp" |
---|
14 | |
---|
15 | namespace xios { |
---|
16 | |
---|
17 | /*! |
---|
18 | \class CDistributionServer |
---|
19 | The class, for now, plays a role of computing local index for writing data on server |
---|
20 | */ |
---|
21 | class CDistributionServer : public CDistribution |
---|
22 | { |
---|
23 | public: |
---|
24 | /** Default constructor */ |
---|
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); |
---|
28 | |
---|
29 | /** Default destructor */ |
---|
30 | virtual ~CDistributionServer(); |
---|
31 | |
---|
32 | virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex); |
---|
33 | virtual void computeLocalIndex(CArray<size_t,1>& globalIndex); |
---|
34 | |
---|
35 | protected: |
---|
36 | virtual void createGlobalIndex(); |
---|
37 | private: |
---|
38 | std::vector<int> nGlobal_; |
---|
39 | std::vector<int> nZoomSize_; |
---|
40 | std::vector<int> nZoomBegin_; |
---|
41 | }; |
---|
42 | |
---|
43 | } // namespace xios |
---|
44 | #endif // __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|