source: XIOS/trunk/src/distribution.hpp @ 576

Last change on this file since 576 was 553, checked in by mhnguyen, 9 years ago

Seperating global index computation on client and server side

+) Create a class which do mapping in general manner, between client and server index global
+) Remove some redundant functions and variables
+) Add some comments to code

Test
+) On Curie. Only test_new_features.f90
+) Test passes and results are correct.
+) Need to change index from 1 to 0

File size: 1.1 KB
Line 
1/*!
2   \file distribution.hpp
3   \author Ha NGUYEN
4   \since 13 Jan 2015
5   \date 09 Feb 2015
6
7   \brief Index distribution on server side.
8 */
9#ifndef __XIOS_DISTRIBUTION_HPP__
10#define __XIOS_DISTRIBUTION_HPP__
11
12#include "xmlioserver_spl.hpp"
13#include "array_new.hpp"
14
15namespace xios {
16/*!
17 \class CDistribution
18 The parent class of CDistributionClient and CDistributionServer, which declares and defines
19some basic methods and properties for its children. This class allows its descendants to calculate
20distribution of index on client or server side.
21*/
22class CDistribution
23{
24  public:
25    /** Default constructor */
26    CDistribution(int rank, int dims, CArray<size_t,1>* globalIndex = 0);
27
28    /** Default destructor */
29    virtual ~CDistribution();
30
31    int getDims() const; //! Get dimension size
32    int getRank() const; //! Get rank of current process
33
34    //! Get global index
35    const CArray<size_t,1>& getGlobalIndex() const;
36  protected:
37    virtual void createGlobalIndex() = 0;
38  protected:
39    CArray<size_t,1>* globalIndex_;
40    int dims_;
41    int rank_;
42};
43
44} // namespace xios
45#endif // __XIOS_DISTRIBUTION_HPP__
Note: See TracBrowser for help on using the repository browser.