source: XIOS/trunk/src/node/distribution_server.hpp @ 566

Last change on this file since 566 was 554, checked in by mhnguyen, 9 years ago

Changing interface of tests to make sure global index begins at zero (0)

+) In all tests, ibegin, jbegin starts at zero (0), so there are some minor changes in field_glo
+) Improve a littel bit class design

Test
+) On Curie,
+) All test passed and results are the same as before

File size: 1.2 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, 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__
Note: See TracBrowser for help on using the repository browser.