Changeset 1570 for XIOS/dev/dev_olga/src/node
- Timestamp:
- 08/31/18 14:15:54 (6 years ago)
- Location:
- XIOS/dev/dev_olga/src/node
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/axis.cpp
r1568 r1570 300 300 if (context->hasClient) 301 301 { 302 this->checkMask(); 302 303 this->checkData(); 303 this->checkMask();304 304 this->checkLabel(); 305 305 } … … 307 307 308 308 /*! 309 Check the validity of data and fill in values if any.309 Check the validity of data, fill in values if any, and apply mask. 310 310 */ 311 311 … … 331 331 { 332 332 if ((i+data_begin) >= 0 && (i+data_begin<n)) 333 data_index(i) = i+data_begin; 333 { 334 if (mask(i+data_begin)) 335 data_index(i) = i+data_begin; 336 else 337 data_index(i) = -1; 338 } 334 339 else 335 340 data_index(i) = -1; … … 344 349 << "The size of data_index = "<< data_index.numElements() << "is not equal to the data size data_n = " << data_n.getValue() << ")."); 345 350 } 346 data_index.resize(data_n);347 351 for (int i = 0; i < data_n; ++i) 348 352 { 349 if ((i+data_begin) >= 0 && (i+data_begin<n)) 350 data_index(i) = data_index(i); 351 else 353 if ((i+data_begin) >= 0 && (i+data_begin<n) && !mask(i+data_begin)) 352 354 data_index(i) = -1; 353 355 } … … 1070 1072 ind = globalLocalIndexMap_[idx]; 1071 1073 dataIndi(n) = dataIndex(ind); 1072 maskIndi(n) = mask(ind);1074 // maskIndi(n) = mask(ind); 1073 1075 1074 1076 if (hasValue) … … 1094 1096 listData.push_back(CMessage()); 1095 1097 listData.back() << this->getId() 1096 << list_indi.back() << list_dataInd.back() 1098 << list_indi.back() << list_dataInd.back(); //<< list_mask.back(); 1097 1099 1098 1100 listData.back() << hasValue; … … 1155 1157 buffer >> vec_indi[idx]; 1156 1158 buffer >> vec_dataInd[idx]; 1157 buffer >> vec_mask[idx];1159 // buffer >> vec_mask[idx]; 1158 1160 1159 1161 buffer >> hasValue; … … 1206 1208 CArray<int,1> nonCompressedData(nbData); 1207 1209 nonCompressedData = -1; 1208 mask.resize(nbData); 1209 mask = true; 1210 // mask.resize(nbData); 1211 // mask = true; 1212 // Mask is incorporated into data_index and is not sent/received anymore 1213 mask.resize(0); 1210 1214 if (hasValue) 1211 1215 value.resize(nbData); … … 1220 1224 CArray<int,1>& indi = vec_indi[idx]; 1221 1225 CArray<int,1>& dataIndi = vec_dataInd[idx]; 1222 CArray<bool,1>& maskIndi = vec_mask[idx];1226 // CArray<bool,1>& maskIndi = vec_mask[idx]; 1223 1227 int nb = indi.numElements(); 1224 1228 for (int n = 0; n < nb; ++n) … … 1228 1232 nonCompressedData(locInd) = (-1 == nonCompressedData(locInd)) ? dataIndi(n) : nonCompressedData(locInd); 1229 1233 1230 if (!mask(locInd)) // Only rewrite mask if it's not true1231 mask(locInd) = maskIndi(n);1234 // if (!mask(locInd)) // Only rewrite mask if it's not true 1235 // mask(locInd) = maskIndi(n); 1232 1236 1233 1237 if (hasValue) -
XIOS/dev/dev_olga/src/node/domain.cpp
r1568 r1570 1081 1081 void CDomain::checkCompression(void) 1082 1082 { 1083 int i,j,ind; 1083 1084 if (!data_i_index.isEmpty()) 1084 1085 { … … 1101 1102 << "'data_j_index' must be defined when 'data_i_index' is set and 'data_dim' is 2."); 1102 1103 } 1104 for (int k=0; k<data_i_index.numElements(); ++k) 1105 { 1106 i = data_i_index(k)+data_ibegin ; 1107 j = data_j_index(k)+data_jbegin ; 1108 if (i>=0 && i<ni && j>=0 && j<nj) 1109 { 1110 ind=j*ni+i ; 1111 if (!domainMask(ind)) 1112 { 1113 data_i_index(k) = -1; 1114 data_j_index(k) = -1; 1115 } 1116 } 1117 else 1118 { 1119 data_i_index(k) = -1; 1120 data_j_index(k) = -1; 1121 } 1122 } 1103 1123 } 1104 1124 else // (1 == data_dim) … … 1107 1127 { 1108 1128 data_j_index.resize(data_ni); 1109 for (int j = 0; j < data_ni; ++j) data_j_index(j) = 0; 1129 data_j_index(j) = 0; 1130 } 1131 for (int k=0; k<data_i_index.numElements(); ++k) 1132 { 1133 i=data_i_index(k)+data_ibegin ; 1134 if (i>=0 && i < domainMask.size()) 1135 { 1136 if (!domainMask(i)) data_i_index(k) = -1; 1137 } 1138 else 1139 data_i_index(k) = -1; 1140 1141 if (!domainMask(i)) data_i_index(k) = -1; 1110 1142 } 1111 1143 } … … 1122 1154 data_i_index.resize(data_ni); 1123 1155 data_j_index.resize(data_ni); 1124 1125 for (int i = 0; i < data_ni; ++i) 1156 data_j_index = 0; 1157 1158 for (int k = 0; k < data_ni; ++k) 1126 1159 { 1127 data_i_index(i) = i; 1128 data_j_index(i) = 0; 1160 i=k+data_ibegin ; 1161 if (i>=0 && i < domainMask.size()) 1162 { 1163 if (domainMask(i)) 1164 data_i_index(k) = k; 1165 else 1166 data_i_index(k) = -1; 1167 } 1168 else 1169 data_i_index(k) = -1; 1129 1170 } 1130 1171 } … … 1135 1176 data_j_index.resize(dsize); 1136 1177 1137 for(int count = 0, j = 0; j < data_nj; ++j)1178 for(int count = 0, kj = 0; kj < data_nj; ++kj) 1138 1179 { 1139 for(int i = 0; i < data_ni; ++i, ++count)1180 for(int ki = 0; ki < data_ni; ++ki, ++count) 1140 1181 { 1141 data_i_index(count) = i; 1142 data_j_index(count) = j; 1182 i = ki + data_ibegin; 1183 j = kj + data_jbegin; 1184 ind=j*ni+i ; 1185 if (i>=0 && i<ni && j>=0 && j<nj) 1186 { 1187 if (domainMask(ind)) 1188 { 1189 data_i_index(count) = ki; 1190 data_j_index(count) = kj; 1191 } 1192 else 1193 { 1194 data_i_index(count) = -1; 1195 data_j_index(count) = -1; 1196 } 1197 } 1198 else 1199 { 1200 data_i_index(count) = -1; 1201 data_j_index(count) = -1; 1202 } 1143 1203 } 1144 1204 } … … 1976 2036 sendDistributionAttributes(); 1977 2037 sendIndex(); 1978 sendMask();2038 // sendMask(); 1979 2039 sendLonLat(); 1980 2040 sendArea(); … … 2447 2507 { 2448 2508 iIndex = (index%ni_glo)-ibegin; 2449 iIndex = (iIndex < 0) ? 0 : iIndex; // ??2509 iIndex = (iIndex < 0) ? 0 : iIndex; 2450 2510 jIndex = (index/ni_glo)-jbegin; 2451 jIndex = (jIndex < 0) ? 0 : jIndex; // ??2511 jIndex = (jIndex < 0) ? 0 : jIndex; 2452 2512 nbIndLoc = iIndex + ni * jIndex; 2453 if (nbIndLoc < nbIndexGlobMax) 2513 // if (nbIndLoc < nbIndexGlobMax) // THIS CONDITION IMPEDES THE CASE OF A HOLE 2454 2514 { 2455 2515 i_index(nbIndLoc) = index % ni_glo; … … 2476 2536 j_index.resizeAndPreserve(nbIndGlob); 2477 2537 } 2538 2539 domainMask.resize(0); // Mask is not defined anymore on servers 2478 2540 } 2479 2541 … … 2896 2958 buffer >> recvDataJIndex[i]; 2897 2959 } 2898 2960 2899 2961 int nbIndex = i_index.numElements(); 2900 2962 CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex); 2901 2963 dataIIndex = -1; dataJIndex = -1; 2902 2964 2903 2965 nbIndex = 0; 2904 2966 for (i = 0; i < nbReceived; ++i) … … 2918 2980 dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd); 2919 2981 2920 if (!domainMask(lInd)) // Include mask info into data index on the RECEIVE getServerDimensionSizes2921 {2922 dataIIndex(lInd) = dataJIndex(lInd) = -1;2923 }2982 // if (!domainMask(lInd)) // Include mask info into data index on the RECEIVE getServerDimensionSizes 2983 // { 2984 // dataIIndex(lInd) = dataJIndex(lInd) = -1; 2985 // } 2924 2986 } 2925 2987 } -
XIOS/dev/dev_olga/src/node/grid.cpp
r1568 r1570 693 693 CContext* context = CContext::getCurrent(); 694 694 695 CContextClient* client = context->client; // Here it's not important which contextClient to recuperate695 CContextClient* client = context->client; 696 696 int rank = client->clientRank; 697 697 … … 699 699 // Get local data index on client 700 700 int nbStoreIndex = clientDistribution_->getLocalDataIndexOnClient().size(); 701 int nbStoreGridMask = clientDistribution_->getLocalMaskIndexOnClient().size(); 702 // nbStoreGridMask = nbStoreIndex if grid mask is defined, and 0 otherwise 701 703 storeIndex_client.resize(nbStoreIndex); 702 storeMask_client.resize(nbStoreIndex); 703 for (int idx = 0; idx < nbStoreIndex; ++idx) 704 { 705 storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 706 storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 707 } 704 storeMask_client.resize(nbStoreGridMask); 705 for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 706 for (int idx = 0; idx < nbStoreGridMask; ++idx) storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 708 707 709 708 if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed(); … … 1302 1301 const StdSize size = storeIndex_client.numElements(); 1303 1302 stored.resize(size); 1304 1305 1303 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 1306 for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue; 1304 1305 if (storeMask_client.numElements() != 0) 1306 for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue; 1307 else 1308 for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 1307 1309 } 1308 1310
Note: See TracChangeset
for help on using the changeset viewer.