Changeset 1236 for XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp
- Timestamp:
- 08/04/17 16:03:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/XIOS_DEV_CMIP6/src/node/domain.hpp
r1215 r1236 50 50 EVENT_ID_INDEX, EVENT_ID_LON, EVENT_ID_LAT, 51 51 EVENT_ID_AREA, EVENT_ID_MASK, 52 EVENT_ID_DATA_INDEX, EVENT_ID_SERVER_ATTRIBUT, 53 EVENT_ID_INDEX_ZOOM 52 EVENT_ID_DATA_INDEX, EVENT_ID_SERVER_ATTRIBUT 54 53 } ; 55 56 57 54 58 55 public: … … 99 96 int getOffsetWrittenIndexes() const; 100 97 101 std::map<int, StdSize> getAttributesBufferSize(); 102 CArray<size_t,1> localIndexToWriteOnServer; 103 CArray<int, 1> compressedIndexToWriteOnServer; 98 std::map<int, StdSize> getAttributesBufferSize(CContextClient* client); 104 99 105 100 bool isEmpty(void) const; … … 107 102 bool isCompressible(void) const; 108 103 104 std::vector<int> getNbGlob(); 105 bool isEqual(CDomain* domain); 106 107 static bool dispatchEvent(CEventServer& event); 108 109 public: 110 /// Mutateur /// 111 void addRelFile(const StdString & filename); 112 void addRelFileCompressed(const StdString& filename); 113 114 void computeWrittenIndex(); 115 116 void AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 117 CArray<double,1>& lon_g, CArray<double,1>& lat_g); 118 119 void fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 120 CArray<double,2>& boundsLon, CArray<double,2>& boundsLat); 121 122 void fillInLonLat(); 123 bool distributionAttributesHaveValue() const; 124 125 size_t getGlobalWrittenSize() ; 126 /// Destructeur /// 127 virtual ~CDomain(void); 128 129 /// Accesseurs statiques /// 130 static StdString GetName(void); 131 static StdString GetDefName(void); 132 133 static ENodeType GetType(void); 134 135 public: 109 136 CArray<double, 1> lonvalue, latvalue; 110 137 CArray<double, 2> bounds_lonvalue, bounds_latvalue; 111 138 CArray<double, 1> areavalue; 112 139 113 vector<int> connectedServer ; // list of connected server 114 vector<int> nbSenders ; // for each communication with a server, number of communicating client 115 vector<int> nbDataSrv ; // size of data to send to each server 116 vector< vector<int> > i_indSrv ; // for each server, i global index to send 117 vector< vector<int> > j_indSrv ; // for each server, j global index to send 118 std::vector<int> getNbGlob(); 119 bool isEqual(CDomain* domain); 120 public: 121 /// Mutateur /// 122 void addRelFile(const StdString & filename); 123 void addRelFileCompressed(const StdString& filename); 124 void completeLonLatClient(void); 125 void computeConnectedClients(); 126 void computeWrittenIndex(); 127 128 void AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 129 CArray<double,1>& lon_g, CArray<double,1>& lat_g); 130 131 void fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 132 CArray<double,2>& boundsLon, CArray<double,2>& boundsLat); 133 134 void fillInLonLat(); 135 bool distributionAttributesHaveValue() const; 136 137 static bool dispatchEvent(CEventServer& event); 138 static void recvDistributionAttributes(CEventServer& event); 139 static void recvIndex(CEventServer& event); 140 static void recvIndexZoom(CEventServer& event); 141 static void recvMask(CEventServer& event); 142 static void recvZoom(CEventServer& event); 143 static void recvLon(CEventServer& event); 144 static void recvLat(CEventServer& event); 145 static void recvArea(CEventServer& event); 146 static void recvDataIndex(CEventServer& event); 147 void recvDistributionAttributes(CBufferIn& buffer); 148 void recvIndex(std::map<int, CBufferIn*>& rankBuffers); 149 void recvIndexZoom(std::map<int, CBufferIn*>& rankBuffers); 150 void recvMask(std::map<int, CBufferIn*>& rankBuffers); 151 void recvLon(std::map<int, CBufferIn*>& rankBuffers); 152 void recvLat(std::map<int, CBufferIn*>& rankBuffers); 153 void recvArea(std::map<int, CBufferIn*>& rankBuffers); 154 void recvDataIndex(std::map<int, CBufferIn*>& rankBuffers); 155 size_t getGlobalWrittenSize() ; 156 /// Destructeur /// 157 virtual ~CDomain(void); 158 159 /// Accesseurs statiques /// 160 static StdString GetName(void); 161 static StdString GetDefName(void); 162 163 static ENodeType GetType(void); 164 const std::map<int, vector<size_t> >& getIndexServer() const; 140 CArray<size_t,1> localIndexToWriteOnServer; 141 CArray<int, 1> compressedIndexToWriteOnServer; 142 165 143 CArray<bool, 1> localMask; 166 144 bool isCurvilinear ; … … 192 170 void sendMask(); 193 171 void sendArea(); 194 void sendLonLat(); 195 void sendIndexZoom(); 172 void sendLonLat(); 196 173 void sendDataIndex(); 197 174 void convertLonLatValue(); … … 199 176 void fillInCurvilinearLonLat(); 200 177 void fillInUnstructuredLonLat(); 178 179 static void recvDistributionAttributes(CEventServer& event); 180 static void recvIndex(CEventServer& event); 181 static void recvIndexZoom(CEventServer& event); 182 static void recvMask(CEventServer& event); 183 static void recvLon(CEventServer& event); 184 static void recvLat(CEventServer& event); 185 static void recvArea(CEventServer& event); 186 static void recvDataIndex(CEventServer& event); 187 void recvDistributionAttributes(CBufferIn& buffer); 188 void recvIndex(std::map<int, CBufferIn*>& rankBuffers); 189 void recvMask(std::map<int, CBufferIn*>& rankBuffers); 190 void recvLon(std::map<int, CBufferIn*>& rankBuffers); 191 void recvLat(std::map<int, CBufferIn*>& rankBuffers); 192 void recvArea(std::map<int, CBufferIn*>& rankBuffers); 193 void recvDataIndex(std::map<int, CBufferIn*>& rankBuffers); 194 195 void completeLonLatClient(void); 196 void computeConnectedClients(); 197 201 198 private: 202 199 bool doZoomByIndex_; … … 205 202 bool isClientChecked; // Verify whether all attributes of domain on the client side are good 206 203 bool isClientAfterTransformationChecked; 207 std::map<int, CArray<int,1> > indiSrv, indjSrv, indGlob_, indGlobZoom_; 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 212 std::map<int, vector<int> > indWrittenSrv_; // Global written index of each client sent to server 204 std::map<int, CArray<int,1> > indGlob_; 205 std::map<CContextClient*, map<int,int> > nbSenders; // Mapping of number of communicating client to a server 206 207 std::map<CContextClient*, boost::unordered_map<int, vector<size_t> > > indSrv_; // Global index of each client sent to server 208 // std::map<CContextClient*, std::map<int, vector<int> > > indWrittenSrv_; // Global written index of each client sent to server 213 209 std::vector<int> indexesToWrite; 214 std::vector<int> recvClientRanks_, recvClientZoomRanks_; 215 int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 216 std::vector<int> connectedServerRank_, connectedServerZoomRank_; 210 std::vector<int> recvClientRanks_; 211 int numberWrittenIndexes_, totalNumberWrittenIndexes_, offsetWrittenIndexes_; 212 std::map<CContextClient*, std::map<int,size_t> > connectedDataSize_; 213 std::map<CContextClient*, std::vector<int> > connectedServerRank_; 214 217 215 //! True if and only if the data defined on the domain can be outputted in a compressed way 218 216 bool isCompressible_; … … 220 218 TransMapTypes transformationMap_; 221 219 bool isUnstructed_; 222 boost::unordered_map<size_t,size_t> globalLocalIndexMap_ , globalLocalIndexZoomMap_;220 boost::unordered_map<size_t,size_t> globalLocalIndexMap_; 223 221 224 222 private:
Note: See TracChangeset
for help on using the changeset viewer.