source: XIOS/trunk/src/node/domain.hpp @ 622

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

Final testing transfomation algorithm: inverse axis (local commit)

+) Make some minor change to make sure one element (axis or domain) be able to have several similar transformation

Test
+) On Curie
+) test_new_feature: test passed with correct data written

  • 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: 5.6 KB
Line 
1#ifndef __XIOS_CDomain__
2#define __XIOS_CDomain__
3
4/// XIOS headers ///
5#include "xios_spl.hpp"
6#include "group_factory.hpp"
7
8#include "declare_group.hpp"
9#include "declare_ref_func.hpp"
10#include "event_client.hpp"
11#include "event_server.hpp"
12#include "buffer_in.hpp"
13#include "array_new.hpp"
14#include "attribute_array.hpp"
15#include "attribute_enum.hpp"
16
17namespace xios {
18
19   /// ////////////////////// Déclarations ////////////////////// ///
20
21   class CDomainGroup;
22   class CDomainAttributes;
23   class CDomain;
24
25   ///--------------------------------------------------------------
26
27   // Declare/Define CDomainAttribute
28   BEGIN_DECLARE_ATTRIBUTE_MAP(CDomain)
29#  include "domain_attribute.conf"
30   END_DECLARE_ATTRIBUTE_MAP(CDomain)
31
32   ///--------------------------------------------------------------
33
34   class CDomain
35      : public CObjectTemplate<CDomain>
36      , public CDomainAttributes
37   {
38         enum EEventId
39         {
40           EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT, EVENT_ID_AREA
41         } ;
42
43         /// typedef ///
44         typedef CObjectTemplate<CDomain>   SuperClass;
45         typedef CDomainAttributes SuperClassAttribute;
46
47      public :
48
49         typedef CDomainAttributes RelAttributes;
50         typedef CDomainGroup      RelGroup;
51
52         /// Constructeurs ///
53         CDomain(void);
54         explicit CDomain(const StdString & id);
55         CDomain(const CDomain & domain);       // Not implemented yet.
56         CDomain(const CDomain * const domain); // Not implemented yet.
57
58         static CDomain* createDomain();
59         void duplicateAttributes(CDomain* domain);
60
61         /// Vérifications ///
62         void checkAttributes(void);
63
64         void checkAttributesOnClient();
65
66         void sendCheckedAttributes();
67
68      private :
69
70         void checkDomain(void);
71
72         void checkLocalIDomain(void);
73         void checkLocalJDomain(void);
74
75         void checkMask(void);
76         void checkDomainData(void);
77         void checkCompression(void);
78
79         void checkZoom(void);
80         void checkBounds(void);
81         void checkArea(void);
82
83
84      public :
85
86         /// Autres ///
87
88         const std::set<StdString> & getRelFiles(void) const;
89
90
91         /// Test ///
92         bool IsWritten(const StdString & filename) const;
93         bool hasZoom(void) const;
94         bool isEmpty(void) const;
95         bool isDistributed(void) const;
96
97
98         int ni_client,ibegin_client,iend_client ;
99         int zoom_ni_client,zoom_ibegin_client,zoom_iend_client ;
100
101         int nj_client,jbegin_client,jend_client ;
102         int zoom_nj_client,zoom_jbegin_client,zoom_jend_client ;
103
104         int ni_srv,ibegin_srv,iend_srv ;
105         int zoom_ni_srv,zoom_ibegin_srv,zoom_iend_srv ;
106
107         int nj_srv,jbegin_srv,jend_srv ;
108         int zoom_nj_srv,zoom_jbegin_srv,zoom_jend_srv ;
109
110         CArray<double, 1> lonvalue_srv, latvalue_srv ;
111         CArray<double, 2> bounds_lon_srv, bounds_lat_srv ;
112         CArray<double, 1> area_srv;
113
114
115        vector<int> connectedServer ; // list of connected server
116        vector<int> nbSenders ; // for each communication with a server, number of communicating client
117        vector<int> nbDataSrv ; // size of data to send to each server
118        vector< vector<int> > i_indSrv ; // for each server, i global index to send
119        vector< vector<int> > j_indSrv ; // for each server, j global index to send
120
121
122        CArray<int,2> mapConnectedServer ;  // (ni,nj) => mapped to connected server number, -1 if no server is target
123
124
125//        vector<int> ib_srv, ie_srv, in_srv ;
126//        vector<int> jb_srv, je_srv, jn_srv ;
127
128      public :
129
130         /// Mutateur ///
131         void addRelFile(const StdString & filename);
132         void completeLonLatClient(void);
133         void sendServerAttribut(void) ;
134         void sendLonLatArea(void);
135         void computeConnectedServer(void) ;
136
137         static bool dispatchEvent(CEventServer& event);
138         static void recvServerAttribut(CEventServer& event);
139         static void recvIndex(CEventServer& event);
140         static void recvLon(CEventServer& event);
141         static void recvLat(CEventServer& event);
142         static void recvArea(CEventServer& event);
143         void recvServerAttribut(CBufferIn& buffer);
144         void recvIndex(int rank, CBufferIn& buffer);
145         void recvLon(int rank, CBufferIn& buffer);
146         void recvLat(int rank, CBufferIn& buffer);
147         void recvArea(int rank, CBufferIn& buffer);
148
149         /// Destructeur ///
150         virtual ~CDomain(void);
151
152         /// Accesseurs statiques ///
153         static StdString GetName(void);
154         static StdString GetDefName(void);
155
156         static ENodeType GetType(void);
157
158         CArray<int, 2> local_mask;
159         bool isCurvilinear ;
160         bool hasBounds ;
161         bool hasArea;
162       private :
163
164         /// Proriétés protégées ///
165         bool isChecked;
166         std::set<StdString> relFiles;
167         bool isClientChecked; // Verify whether all attributes of domain on the client side are good
168         std::map<int, CArray<int,1> > indiSrv, indjSrv;
169         std::map<int,int> nbConnectedClients_; // Mapping of number of communicating client to a server
170         std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server
171         std::vector<int> connectedServerRank_;
172         bool isDistributed_;
173
174         DECLARE_REF_FUNC(Domain,domain)
175
176   }; // class CDomain
177
178   ///--------------------------------------------------------------
179
180   // Declare/Define CDomainGroup and CDomainDefinition
181   DECLARE_GROUP(CDomain);
182
183   ///--------------------------------------------------------------
184
185} // namespace xios
186
187#endif // __XIOS_CDomain__
Note: See TracBrowser for help on using the repository browser.