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

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

Implementing a grid formed by only one axis or group of axis

+) Add several new attributes to axis. From now on, each axis can be distributed on client side
+) Modify mask of grid to make it more flexible to different dimension
+) Fix some bugs relating to calculation of local data index on client
+) Clean some redundant codes

Test
+) On Curie, only test_new_features.f90
+) Test cases:

  • Grid composed of: 1 domain and 1 axis, 3 axis, 1 axis
  • Mode: Attached and connected
  • No of client-server: 6-2(Connected), 2 (Attached)

+) All tests passed and results are correct

  • 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
File size: 3.5 KB
RevLine 
[219]1#ifndef __XMLIO_CAxis__
2#define __XMLIO_CAxis__
3
[335]4/// xios headers ///
[219]5#include "xmlioserver_spl.hpp"
6#include "group_factory.hpp"
7
8#include "declare_group.hpp"
[540]9#include "declare_ref_func.hpp"
[369]10#include "attribute_array.hpp"
[399]11#include "attribute_enum.hpp"
12#include "attribute_enum_impl.hpp"
[567]13#include "server_distribution_description.hpp"
[219]14
[335]15namespace xios {
[540]16
[219]17   /// ////////////////////// Déclarations ////////////////////// ///
18
19   class CAxisGroup;
20   class CAxisAttributes;
21   class CAxis;
22
23   ///--------------------------------------------------------------
24
25   // Declare/Define CAxisAttribute
26   BEGIN_DECLARE_ATTRIBUTE_MAP(CAxis)
[231]27#  include "axis_attribute.conf"
[219]28   END_DECLARE_ATTRIBUTE_MAP(CAxis)
29
30   ///--------------------------------------------------------------
31
32   class CAxis
33      : public CObjectTemplate<CAxis>
34      , public CAxisAttributes
35   {
[567]36         enum EEventId
37         {
38           EVENT_ID_SERVER_ATTRIBUT
39         } ;
40
[219]41         /// typedef ///
42         typedef CObjectTemplate<CAxis>   SuperClass;
43         typedef CAxisAttributes SuperClassAttribute;
44
45      public :
46
47         typedef CAxisAttributes RelAttributes;
48         typedef CAxisGroup      RelGroup;
49
50         /// Constructeurs ///
51         CAxis(void);
52         explicit CAxis(const StdString & id);
53         CAxis(const CAxis & axis);       // Not implemented yet.
54         CAxis(const CAxis * const axis); // Not implemented yet.
55
56         /// Accesseurs ///
57         const std::set<StdString> & getRelFiles(void) const;
58
59         /// Test ///
60         bool IsWritten(const StdString & filename) const;
61
62         /// Mutateur ///
63         void addRelFile(const StdString & filename);
64
65         /// Vérifications ///
66         void checkAttributes(void);
67
68         /// Destructeur ///
69         virtual ~CAxis(void);
70
71         /// Accesseurs statiques ///
72         static StdString GetName(void);
73         static StdString GetDefName(void);
74         static ENodeType GetType(void);
75
[567]76         void sendServerAttribut(void);
77         static bool dispatchEvent(CEventServer& event);
78         static void recvServerAttribut(CEventServer& event);
79         void recvServerAttribut(CBufferIn& buffer) ;
80         void checkAttributesOnClient(const std::vector<int>& globalDim, int orderPositionInGrid,
81                                      CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
82         void sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid,
83                                    CServerDistributionDescription::ServerDistributionType disType = CServerDistributionDescription::BAND_DISTRIBUTION);
84      public:
85        int zoom_begin_srv, zoom_end_srv, zoom_size_srv;
86        int ni_srv, begin_srv, end_srv;
[219]87      private :
[551]88         void checkData();
89         void checkMask();
[567]90         void checkZoom();
91         void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid,
92                                 CServerDistributionDescription::ServerDistributionType disType);
93      private:
94
[219]95         bool isChecked;
[567]96         bool areClientAttributesChecked_;
[219]97         std::set<StdString> relFiles;
98
[540]99         DECLARE_REF_FUNC(Axis,axis)
[219]100
[540]101
[219]102   }; // class CAxis
103
104   ///--------------------------------------------------------------
105
106   // Declare/Define CAxisGroup and CAxisDefinition
107   DECLARE_GROUP(CAxis);
108
109   ///--------------------------------------------------------------
110
[335]111} // namespace xios
[219]112
113#endif // __XMLIO_CAxis__
Note: See TracBrowser for help on using the repository browser.