source: XIOS/trunk/src/distribution_server.hpp @ 654

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

Distributions and transformations: Avoid using heap allocations.

File size: 1.6 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 */
[653]25    CDistributionServer(int rank, int dims, const CArray<size_t,1>& globalIndex = CArray<size_t,1>());
[567]26    CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer,
27                        const std::vector<int>& nZoomSizeServer, const std::vector<int>& nGlobal);
28    CDistributionServer(int rank, const std::vector<int>& nZoomBeginServer,
29                        const std::vector<int>& nZoomSizeServer,
30                        const std::vector<int>& nZoomBeginGlobal,
31                        const std::vector<int>& nGlobal);
[551]32
33    /** Default destructor */
34    virtual ~CDistributionServer();
35
[567]36    std::vector<int> getZoomBeginGlobal() const;
37    std::vector<int> getZoomBeginServer() const;
38    std::vector<int> getZoomSizeServer() const;
39
[554]40    virtual CArray<size_t,1> computeLocalIndex(const CArray<size_t,1>& globalIndex);
41    virtual void computeLocalIndex(CArray<size_t,1>& globalIndex);
[552]42
[551]43  protected:
44    virtual void createGlobalIndex();
45  private:
46    std::vector<int> nGlobal_;
[567]47    std::vector<int> nZoomBeginGlobal_;
[552]48    std::vector<int> nZoomSize_;
49    std::vector<int> nZoomBegin_;
[567]50
[551]51};
52
[552]53} // namespace xios
[551]54#endif // __XIOS_DISTRIBUTION_SERVER_HPP__
Note: See TracBrowser for help on using the repository browser.