source: XIOS/dev/dev_olga/src/distribution_server.hpp @ 1144

Last change on this file since 1144 was 1144, checked in by mhnguyen, 7 years ago

Cleaning up some redundant codes

File size: 1.7 KB
RevLine 
[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
15namespace 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]21class CDistributionServer : public CDistribution
22{
23  public:
24    /** Default constructor */
[567]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);
[551]29
30    /** Default destructor */
31    virtual ~CDistributionServer();
32
[676]33    const std::vector<int>& getZoomBeginGlobal() const;
34    const std::vector<int>& getZoomBeginServer() const;
35    const std::vector<int>& getZoomSizeServer() const;
[1144]36    const GlobalLocalMap& getGlobalLocalIndex() const { return globalLocalIndexMap_; }   
[1099]37    int getGridSize() const;
[1144]38   
[554]39    virtual void computeLocalIndex(CArray<size_t,1>& globalIndex);
[676]40    virtual void computeGlobalIndex(CArray<int,1>& indexes) const;
[552]41
[551]42  protected:
43    virtual void createGlobalIndex();
[930]44
[1025]45    void createGlobalIndexFromIndex(const std::vector<CArray<int,1> >& globalIndexOnEachDimension,
46                                    const std::vector<int>& nbGlobal);
47
[930]48  protected:
49    GlobalLocalMap globalLocalIndexMap_;
50
[551]51  private:
52    std::vector<int> nGlobal_;
[567]53    std::vector<int> nZoomBeginGlobal_;
[552]54    std::vector<int> nZoomSize_;
55    std::vector<int> nZoomBegin_;
[551]56};
57
[552]58} // namespace xios
[551]59#endif // __XIOS_DISTRIBUTION_SERVER_HPP__
Note: See TracBrowser for help on using the repository browser.