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

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

Implementing buffer size auto-detection for mode client -server

+) Process xml tree in client side then send all the information to server
+) Only information enabled fields in enabled files are sent to server
+) Some important change in structure of code which must be refactored

Test
+) On Curie
+) Only mode client-server
+) Passed for all tests

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