Ignore:
Timestamp:
01/11/17 15:14:22 (7 years ago)
Author:
mhnguyen
Message:

Merging working version of coupler

+) Add some changes of domain and axis: Retransfer the atttributes in a generic ways for each level of client (or server)
+) Remove some spoiled files from the previous commits

Test
+) No test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/node/domain.hpp

    r987 r1025  
    1616#include "transformation.hpp" 
    1717#include "transformation_enum.hpp" 
    18  
     18#include "server_distribution_description.hpp" 
    1919#include "mesh.hpp" 
    2020 
     
    4949         enum EEventId 
    5050         { 
    51            EVENT_ID_SERVER_ATTRIBUT, EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT, EVENT_ID_AREA 
     51           EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT,  
     52           EVENT_ID_AREA, EVENT_ID_MASK, 
     53           EVENT_ID_DATA_INDEX, EVENT_ID_SERVER_ATTRIBUT 
    5254         } ; 
    5355 
     
    7577         /// Vérifications /// 
    7678         void checkAttributes(void); 
    77  
    7879         void checkAttributesOnClient(); 
    7980         void checkAttributesOnClientAfterTransformation(); 
    80  
    8181         void checkEligibilityForCompressedOutput(void); 
    8282 
     
    100100         int getOffsetWrittenIndexes() const; 
    101101 
     102         const std::vector<int>& getStartWriteIndex() const; 
     103         const std::vector<int>& getCountWriteIndex() const; 
     104         const std::vector<int>& getLocalWriteSize() const; 
     105         const std::vector<int>& getGlobalWriteSize() const; 
     106 
    102107         std::map<int, StdSize> getAttributesBufferSize(); 
    103108 
    104109         bool isEmpty(void) const; 
    105110         bool isDistributed(void) const; 
    106          bool isCompressible(void) const; 
    107  
    108          int ni_srv,ibegin_srv,iend_srv ; 
    109          int zoom_ni_srv,zoom_ibegin_srv,zoom_iend_srv ; 
    110  
    111          int nj_srv,jbegin_srv,jend_srv ; 
    112          int zoom_nj_srv,zoom_jbegin_srv,zoom_jend_srv ; 
    113  
    114          CArray<double, 1> lonvalue_srv, latvalue_srv ; 
    115          CArray<double, 2> bounds_lon_srv, bounds_lat_srv ; 
    116          CArray<double, 1> lonvalue_client, latvalue_client; 
    117          CArray<double, 2> bounds_lon_client, bounds_lat_client; 
    118          CArray<double, 1> area_srv; 
    119  
    120         vector<int> connectedServer ; // list of connected server 
    121         vector<int> nbSenders ; // for each communication with a server, number of communicating client 
    122         vector<int> nbDataSrv ; // size of data to send to each server 
    123         vector< vector<int> > i_indSrv ; // for each server, i global index to send 
    124         vector< vector<int> > j_indSrv ; // for each server, j global index to send 
     111         bool isCompressible(void) const;  
     112  
     113         CArray<double, 1> lonvalue, latvalue; 
     114         CArray<double, 2> bounds_lonvalue, bounds_latvalue; 
     115         CArray<double, 1> areavalue; 
     116 
     117         vector<int> connectedServer ; // list of connected server 
     118         vector<int> nbSenders ; // for each communication with a server, number of communicating client 
     119         vector<int> nbDataSrv ; // size of data to send to each server 
     120         vector< vector<int> > i_indSrv ; // for each server, i global index to send 
     121         vector< vector<int> > j_indSrv ; // for each server, j global index to send 
    125122 
    126123      public: 
     
    128125         void addRelFile(const StdString & filename); 
    129126         void addRelFileCompressed(const StdString& filename); 
    130          void completeLonLatClient(void); 
    131          void sendServerAttribut(void) ; 
    132          void sendLonLatArea(void); 
    133          void computeConnectedServer(void) ; 
     127         void completeLonLatClient(void);          
     128         void computeConnectedClients(); 
    134129 
    135130         void AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 
     
    141136 
    142137         static bool dispatchEvent(CEventServer& event); 
    143          static void recvServerAttribut(CEventServer& event); 
     138         static void recvDistributionAttributes(CEventServer& event); 
    144139         static void recvIndex(CEventServer& event); 
     140         static void recvMask(CEventServer& event); 
     141         static void recvZoom(CEventServer& event); 
    145142         static void recvLon(CEventServer& event); 
    146143         static void recvLat(CEventServer& event); 
    147144         static void recvArea(CEventServer& event); 
    148          void recvServerAttribut(CBufferIn& buffer); 
    149          void recvIndex(int rank, CBufferIn& buffer); 
    150          void recvLon(int rank, CBufferIn& buffer); 
    151          void recvLat(int rank, CBufferIn& buffer); 
    152          void recvArea(int rank, CBufferIn& buffer); 
     145         static void recvDataIndex(CEventServer& event); 
     146         void recvDistributionAttributes(CBufferIn& buffer);          
     147         void recvZoom(std::vector<int>& rank, std::vector<CBufferIn*>& buffers); 
     148         void recvIndex(std::map<int, CBufferIn*>& rankBuffers); 
     149         void recvMask(std::map<int, CBufferIn*>& rankBuffers); 
     150         void recvLon(std::map<int, CBufferIn*>& rankBuffers); 
     151         void recvLat(std::map<int, CBufferIn*>& rankBuffers); 
     152         void recvArea(std::map<int, CBufferIn*>& rankBuffers);          
     153         void recvDataIndex(std::map<int, CBufferIn*>& rankBuffers); 
    153154 
    154155         /// Destructeur /// 
     
    160161 
    161162         static ENodeType GetType(void); 
    162          const std::map<int, vector<size_t> >& getIndexServer() const; 
     163         const boost::unordered_map<int, vector<size_t> >& getIndexServer() const; 
    163164         CArray<bool, 1> localMask; 
    164165         bool isCurvilinear ; 
     
    183184         void computeLocalMask(void) ; 
    184185 
    185          void checkTransformations(); 
    186          void setTransformations(const TransMapTypes&); 
    187          void computeNGlobDomain(); 
    188  
     186         void setTransformations(const TransMapTypes&);          
     187 
     188         void sendAttributes(); 
    189189         void sendIndex(); 
     190         void sendDistributionAttributes(); 
     191         void sendMask(); 
    190192         void sendArea(); 
    191193         void sendLonLat(); 
    192  
    193        private: 
     194         void sendZoom(); 
     195         void sendDataIndex(); 
     196 
     197       private:          
     198         std::vector<int> start_write_index_; 
     199         std::vector<int> count_write_index_; 
     200         std::vector<int> local_write_size_; 
     201         std::vector<int> global_write_size_; 
     202 
    194203         bool isChecked; 
    195204         std::set<StdString> relFiles, relFilesCompressed; 
    196205         bool isClientChecked; // Verify whether all attributes of domain on the client side are good 
    197206         bool isClientAfterTransformationChecked; 
    198          std::map<int, CArray<int,1> > indiSrv, indjSrv; 
    199          std::map<int,int> nbConnectedClients_; // Mapping of number of communicating client to a server 
    200          std::map<int, vector<size_t> > indSrv_; // Global index of each client sent to server 
     207         std::map<int, CArray<int,1> > indiSrv, indjSrv, indGlob_; 
     208         std::map<int,int> nbConnectedClients_, nbConnectedClientsZoom_; // Mapping of number of communicating client to a server 
     209 
     210         boost::unordered_map<int, vector<size_t> > indSrv_; // Global index of each client sent to server 
     211         boost::unordered_map<int, vector<size_t> > indZoomSrv_; // Global index of each client sent to server 
    201212         std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server 
    202213         std::vector<int> indexesToWrite; 
     214         std::vector<int> recvClientRanks_; 
    203215         int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 
    204216         std::vector<int> connectedServerRank_; 
     
    207219         bool isCompressible_; 
    208220         bool isRedistributed_; 
    209          TransMapTypes transformationMap_; 
    210          std::vector<int> nGlobDomain_; 
     221         TransMapTypes transformationMap_;          
    211222         bool isUnstructed_; 
     223         boost::unordered_map<size_t,size_t> globalLocalIndexMap_; 
    212224        
    213225       private: 
Note: See TracChangeset for help on using the changeset viewer.