source: XIOS/trunk/src/node/axis.hpp @ 624

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

Final tests of zoom and inverse on axis

+) Modify test_client and test_complete to work with new grid definition
+) Correct some bugs causing memory leak
+) Clean abundant code
+) Add more comments to new files

Test
+) On Curie
+) test_client and test_complete pass with correct results

  • Property copyright set to
    Software name : XIOS (Xml I/O Server)
    http://forge.ipsl.jussieu.fr/ioserver
    Creation date : January 2009
    Licence : CeCCIL version2
    see license file in root directory : Licence_CeCILL_V2-en.txt
    or http://www.cecill.info/licences/Licence_CeCILL_V2-en.html
    Holder : CEA/LSCE (Laboratoire des Sciences du CLimat et de l'Environnement)
    CNRS/IPSL (Institut Pierre Simon Laplace)
    Project Manager : Yann Meurdesoif
    yann.meurdesoif@cea.fr
  • Property svn:executable set to *
File size: 4.3 KB
Line 
1#ifndef __XIOS_CAxis__
2#define __XIOS_CAxis__
3
4/// XIOS headers ///
5#include "xios_spl.hpp"
6#include "group_factory.hpp"
7#include "virtual_node.hpp"
8
9#include "declare_group.hpp"
10#include "declare_ref_func.hpp"
11#include "declare_virtual_node.hpp"
12#include "attribute_array.hpp"
13#include "attribute_enum.hpp"
14#include "attribute_enum_impl.hpp"
15#include "server_distribution_description.hpp"
16#include "transformation.hpp"
17#include "transformation_enum.hpp"
18#include "inverse_axis.hpp"
19#include "zoom_axis.hpp"
20
21namespace xios {
22   /// ////////////////////// Déclarations ////////////////////// ///
23
24   class CAxisGroup;
25   class CAxisAttributes;
26   class CAxis;
27
28   ///--------------------------------------------------------------
29
30   // Declare/Define CAxisAttribute
31   BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis)
32#  include "axis_attribute.conf"
33   END_DECLARE_ATTRIBUTE_MAP(CAxis)
34
35   ///--------------------------------------------------------------
36
37   class CAxis
38      : public CObjectTemplate<CAxis>
39      , public CAxisAttributes
40   {
41         enum EEventId
42         {
43           EVENT_ID_SERVER_ATTRIBUT
44         } ;
45
46         /// typedef ///
47         typedef CObjectTemplate<CAxis>   SuperClass;
48         typedef CAxisAttributes SuperClassAttribute;
49
50      public :
51
52         typedef CAxisAttributes RelAttributes;
53         typedef CAxisGroup      RelGroup;
54         typedef CTransformation<CAxis>::TransformationMapTypes TransMapTypes;
55
56      public:
57         /// Constructeurs ///
58         CAxis(void);
59         explicit CAxis(const StdString & id);
60         CAxis(const CAxis & axis);       // Not implemented yet.
61         CAxis(const CAxis * const axis); // Not implemented yet.
62
63         static CAxis* createAxis();
64
65         /// Accesseurs ///
66         const std::set<StdString> & getRelFiles(void) const;
67
68         /// Test ///
69         bool IsWritten(const StdString & filename) const;
70         bool isDistributed(void) const;
71
72         /// Mutateur ///
73         void addRelFile(const StdString & filename);
74
75         /// Vérifications ///
76         void checkAttributes(void);
77
78         /// Destructeur ///
79         virtual ~CAxis(void);
80
81         virtual void parse(xml::CXMLNode & node);
82
83         /// Accesseurs statiques ///
84         static StdString GetName(void);
85         static StdString GetDefName(void);
86         static ENodeType GetType(void);
87
88         void sendServerAttribut(const std::vector<int>& globalDim, int orderPositionInGrid,
89                                 CServerDistributionDescription::ServerDistributionType distType);
90         static bool dispatchEvent(CEventServer& event);
91         static void recvServerAttribut(CEventServer& event);
92         void recvServerAttribut(CBufferIn& buffer) ;
93         void checkAttributesOnClient(const std::vector<int>& globalDim, int orderPositionInGrid,
94                                      CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
95         void sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
96                                    CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
97
98         bool hasTransformation();
99         void solveInheritanceTransformation();
100         TransMapTypes getAllTransformations();
101
102      public:
103        int zoom_begin_srv, zoom_end_srv, zoom_size_srv;
104        int ni_srv, begin_srv, end_srv;
105        int global_zoom_begin, global_zoom_size;  // The real global zoom begin and zoom size after axis is transformed (zoomed)
106      private :
107         void checkData();
108         void checkMask();
109//         void checkZoom();
110         void checkTransformations();
111         void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid,
112                                 CServerDistributionDescription::ServerDistributionType disType);
113
114
115         void setTransformations(const TransMapTypes&);
116      private:
117         bool isChecked;
118         bool areClientAttributesChecked_;
119         std::set<StdString> relFiles;
120         TransMapTypes transformationMap_;
121         bool isDistributed_;
122
123         DECLARE_REF_FUNC(Axis,axis)
124   }; // class CAxis
125
126   ///--------------------------------------------------------------
127
128   // Declare/Define CAxisGroup and CAxisDefinition
129   DECLARE_GROUP(CAxis);
130} // namespace xios
131
132#endif // __XIOS_CAxis__
Note: See TracBrowser for help on using the repository browser.