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

Last change on this file since 509 was 509, checked in by mhnguyen, 10 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
RevLine 
[219]1#ifndef __XMLIO_CDomain__
2#define __XMLIO_CDomain__
3
[335]4/// xios headers ///
[219]5#include "xmlioserver_spl.hpp"
6#include "group_factory.hpp"
7
8#include "declare_group.hpp"
[300]9#include "event_client.hpp"
10#include "event_server.hpp"
11#include "buffer_in.hpp"
[369]12#include "array_new.hpp"
13#include "attribute_array.hpp"
[449]14#include "attribute_enum.hpp"
[219]15
[335]16namespace xios {
[509]17
[219]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   {
[300]37         enum EEventId
38         {
39           EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_LON_LAT
40         } ;
[509]41
[219]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
[509]60         void checkAttributesOnClient();
61
62         void sendCheckedAttributes();
63
[219]64      private :
65
[467]66         void checkDomain(void);
[219]67
68         void checkLocalIDomain(void);
69         void checkLocalJDomain(void);
70
71         void checkMask(void);
72         void checkDomainData(void);
73         void checkCompression(void);
[509]74
[219]75         void checkZoom(void);
[449]76         void checkBounds(void);
[219]77
78
79      public :
[509]80
[219]81         /// Autres ///
82
83         const std::set<StdString> & getRelFiles(void) const;
84
[274]85
[219]86         /// Test ///
87         bool IsWritten(const StdString & filename) const;
88         bool hasZoom(void) const;
89         bool isEmpty(void) const;
[509]90
91
[300]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
[369]104         CArray<double, 1> lonvalue_srv, latvalue_srv ;
[449]105         CArray<double, 2> bounds_lon_srv, bounds_lat_srv ;
[509]106
107
108        vector<int> connectedServer ; // list of connected server
[467]109        vector<int> nbSenders ; // for each communication with a server, number of communicating client
[509]110        vector<int> nbDataSrv ; // size of data to send to each server
[467]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
[509]113
[467]114        CArray<int,2> mapConnectedServer ;  // (ni,nj) => mapped to connected server number, -1 if no server is target
[509]115
[467]116//        vector<int> ib_srv, ie_srv, in_srv ;
117//        vector<int> jb_srv, je_srv, jn_srv ;
[509]118
[219]119      public :
[509]120
[219]121         /// Mutateur ///
122         void addRelFile(const StdString & filename);
[266]123         void completeLonLatClient(void);
[300]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) ;
[509]132
[219]133         /// Destructeur ///
134         virtual ~CDomain(void);
135
136         /// Accesseurs statiques ///
137         static StdString GetName(void);
138         static StdString GetDefName(void);
[509]139
[219]140         static ENodeType GetType(void);
141
[369]142         CArray<int, 2> local_mask;
[384]143         bool isCurvilinear ;
[449]144         bool hasBounds ;
[219]145       private :
146
147         /// Proriétés protégées ///
148         bool isChecked;
149         std::set<StdString> relFiles;
[509]150         bool isClientChecked; // Verify whether all attributes of domain on the client side is good
[219]151
152   }; // class CDomain
153
154   ///--------------------------------------------------------------
155
156   // Declare/Define CDomainGroup and CDomainDefinition
157   DECLARE_GROUP(CDomain);
158
159   ///--------------------------------------------------------------
160
[335]161} // namespace xios
[219]162
163#endif // __XMLIO_CDomain__
Note: See TracBrowser for help on using the repository browser.