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, const std::vector<int>& nZoomBeginServer, |
---|
26 | const std::vector<int>& nZoomSizeServer, |
---|
27 | const std::vector<int>& nZoomBeginGlobal, |
---|
28 | const std::vector<int>& nGlobal); |
---|
29 | |
---|
30 | /** Default destructor */ |
---|
31 | virtual ~CDistributionServer(); |
---|
32 | |
---|
33 | const std::vector<int>& getZoomBeginGlobal() const; |
---|
34 | const std::vector<int>& getZoomBeginServer() const; |
---|
35 | const std::vector<int>& getZoomSizeServer() const; |
---|
36 | const GlobalLocalMap& getGlobalLocalIndex() const { return globalLocalIndexMap_; } |
---|
37 | int getGridSize() const; |
---|
38 | |
---|
39 | virtual void computeLocalIndex(CArray<size_t,1>& globalIndex); |
---|
40 | virtual void computeGlobalIndex(CArray<int,1>& indexes) const; |
---|
41 | |
---|
42 | protected: |
---|
43 | virtual void createGlobalIndex(); |
---|
44 | |
---|
45 | protected: |
---|
46 | GlobalLocalMap globalLocalIndexMap_; |
---|
47 | |
---|
48 | private: |
---|
49 | std::vector<int> nGlobal_; |
---|
50 | std::vector<int> nZoomBeginGlobal_; |
---|
51 | std::vector<int> nZoomSize_; |
---|
52 | std::vector<int> nZoomBegin_; |
---|
53 | }; |
---|
54 | |
---|
55 | } // namespace xios |
---|
56 | #endif // __XIOS_DISTRIBUTION_SERVER_HPP__ |
---|