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

Last change on this file since 827 was 653, checked in by rlacroix, 9 years ago

Distributions and transformations: Avoid using heap allocations.

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 "xios_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, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
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.