source: XIOS/dev/branch_yushan_merged/src/distribution_server.hpp @ 1205

Last change on this file since 1205 was 1205, checked in by yushan, 7 years ago

branch merged with trunk @1200

File size: 2.3 KB
Line 
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
15namespace xios {
16
17/*!
18  \class CDistributionServer
19  The class, for now, plays a role of computing local index for writing data on server
20*/
21class CDistributionServer : public CDistribution
22{
23  public:
24    /** Default constructor */
25    CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
26    CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer,
27                        const std::vector<int>& nZoomSizeServer, const std::vector<int>& nGlobal);
28    CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer,
29                        const std::vector<int>& nZoomSizeServer,
30                        const std::vector<int>& nZoomBeginGlobal,
31                        const std::vector<int>& nGlobal);
32
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
41    /** Default destructor */
42    virtual ~CDistributionServer();
43
44    const std::vector<int>& getZoomBeginGlobal() const;
45    const std::vector<int>& getZoomBeginServer() const;
46    const std::vector<int>& getZoomSizeServer() const;
47
48    virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex);
49    virtual void computeLocalIndex(CArray<size_t,1>& globalIndex);
50    virtual void computeGlobalIndex(CArray<int,1>& indexes) const;
51
52  protected:
53    virtual void createGlobalIndex();
54    void createGlobalIndex(const std::vector<CArray<int,1> >& globalIndexElements,
55                           const CArray<int,1>& elementOrder);
56
57  protected:
58    GlobalLocalMap globalLocalIndexMap_;
59
60  private:
61    std::vector<int> nGlobal_;
62    std::vector<int> nZoomBeginGlobal_;
63    std::vector<int> nZoomSize_;
64    std::vector<int> nZoomBegin_;
65
66};
67
68} // namespace xios
69#endif // __XIOS_DISTRIBUTION_SERVER_HPP__
Note: See TracBrowser for help on using the repository browser.