Last change
on this file since 664 was
653,
checked in by rlacroix, 9 years ago
|
Distributions and transformations: Avoid using heap allocations.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[553] | 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 | */ |
---|
[551] | 9 | #ifndef __XIOS_DISTRIBUTION_HPP__ |
---|
| 10 | #define __XIOS_DISTRIBUTION_HPP__ |
---|
| 11 | |
---|
[591] | 12 | #include "xios_spl.hpp" |
---|
[551] | 13 | #include "array_new.hpp" |
---|
| 14 | |
---|
| 15 | namespace xios { |
---|
[553] | 16 | /*! |
---|
| 17 | \class CDistribution |
---|
| 18 | The parent class of CDistributionClient and CDistributionServer, which declares and defines |
---|
| 19 | some basic methods and properties for its children. This class allows its descendants to calculate |
---|
| 20 | distribution of index on client or server side. |
---|
| 21 | */ |
---|
[551] | 22 | class CDistribution |
---|
| 23 | { |
---|
| 24 | public: |
---|
| 25 | /** Default constructor */ |
---|
[653] | 26 | CDistribution(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>()); |
---|
[551] | 27 | |
---|
| 28 | /** Default destructor */ |
---|
| 29 | virtual ~CDistribution(); |
---|
| 30 | |
---|
[553] | 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; |
---|
[551] | 36 | protected: |
---|
[552] | 37 | virtual void createGlobalIndex() = 0; |
---|
[551] | 38 | protected: |
---|
[653] | 39 | CArray<size_t,1> globalIndex_; |
---|
[551] | 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.