Changeset 1622 for XIOS/trunk/src/node/axis.cpp
- Timestamp:
- 12/11/18 13:22:07 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/axis.cpp
r1566 r1622 48 48 bool CAxis::dummyTransformationMapList_ = CAxis::initializeTransformationMap(CAxis::transformationMapList_); 49 49 bool CAxis::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 50 TRY 50 51 { 51 52 m["zoom_axis"] = TRANS_ZOOM_AXIS; … … 60 61 61 62 } 63 CATCH 62 64 63 65 ///--------------------------------------------------------------- 64 66 65 67 const std::set<StdString> & CAxis::getRelFiles(void) const 68 TRY 66 69 { 67 70 return (this->relFiles); 68 71 } 72 CATCH 69 73 70 74 bool CAxis::IsWritten(const StdString & filename) const 75 TRY 71 76 { 72 77 return (this->relFiles.find(filename) != this->relFiles.end()); 73 78 } 79 CATCH 74 80 75 81 bool CAxis::isWrittenCompressed(const StdString& filename) const 82 TRY 76 83 { 77 84 return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 78 85 } 86 CATCH 79 87 80 88 bool CAxis::isDistributed(void) const 89 TRY 81 90 { 82 91 bool distributed = (!this->begin.isEmpty() && !this->n.isEmpty() && (this->begin + this->n < this->n_glo)) || 83 92 (!this->n.isEmpty() && (this->n != this->n_glo)); 84 // A same stupidcondition to make sure that if there is only one client, axis93 // A condition to make sure that if there is only one client, axis 85 94 // should be considered to be distributed. This should be a temporary solution 86 95 distributed |= (1 == CContext::getCurrent()->client->clientSize); 87 96 return distributed; 88 97 } 98 CATCH 89 99 90 100 /*! … … 94 104 */ 95 105 bool CAxis::isCompressible(void) const 106 TRY 96 107 { 97 108 return isCompressible_; 98 109 } 110 CATCH 99 111 100 112 void CAxis::addRelFile(const StdString & filename) 113 TRY 101 114 { 102 115 this->relFiles.insert(filename); 103 116 } 117 CATCH_DUMP_ATTR 104 118 105 119 void CAxis::addRelFileCompressed(const StdString& filename) 120 TRY 106 121 { 107 122 this->relFilesCompressed.insert(filename); 108 123 } 124 CATCH_DUMP_ATTR 109 125 110 126 //---------------------------------------------------------------- … … 115 131 */ 116 132 int CAxis::getNumberWrittenIndexes(MPI_Comm writtenCom) 133 TRY 117 134 { 118 135 int writtenSize; … … 120 137 return numberWrittenIndexes_[writtenSize]; 121 138 } 139 CATCH_DUMP_ATTR 122 140 123 141 /*! … … 126 144 */ 127 145 int CAxis::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 146 TRY 128 147 { 129 148 int writtenSize; … … 131 150 return totalNumberWrittenIndexes_[writtenSize]; 132 151 } 152 CATCH_DUMP_ATTR 133 153 134 154 /*! … … 137 157 */ 138 158 int CAxis::getOffsetWrittenIndexes(MPI_Comm writtenCom) 159 TRY 139 160 { 140 161 int writtenSize; … … 142 163 return offsetWrittenIndexes_[writtenSize]; 143 164 } 165 CATCH_DUMP_ATTR 144 166 145 167 CArray<int, 1>& CAxis::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 168 TRY 146 169 { 147 170 int writtenSize; … … 149 172 return compressedIndexToWriteOnServer[writtenSize]; 150 173 } 174 CATCH_DUMP_ATTR 175 151 176 //---------------------------------------------------------------- 152 177 … … 158 183 std::map<int, StdSize> CAxis::getAttributesBufferSize(CContextClient* client, const std::vector<int>& globalDim, int orderPositionInGrid, 159 184 CServerDistributionDescription::ServerDistributionType distType) 185 TRY 160 186 { 161 187 … … 221 247 } 222 248 } 223 224 249 return attributesSizes; 225 250 } 251 CATCH_DUMP_ATTR 226 252 227 253 //---------------------------------------------------------------- … … 234 260 235 261 CAxis* CAxis::createAxis() 262 TRY 236 263 { 237 264 CAxis* axis = CAxisGroup::get("axis_definition")->createChild(); 238 265 return axis; 239 266 } 267 CATCH 240 268 241 269 /*! … … 244 272 */ 245 273 void CAxis::checkAttributes(void) 274 TRY 246 275 { 247 276 if (this->n_glo.isEmpty()) … … 285 314 } 286 315 287 // Remove this check because it doe n't make sense in case of a hole or overlapping axes316 // Remove this check because it doesn't make sense in case of a hole or overlapping axes 288 317 if (!this->value.isEmpty()) 289 318 { … … 306 335 } 307 336 } 337 CATCH_DUMP_ATTR 308 338 309 339 /*! … … 311 341 */ 312 342 void CAxis::checkData() 343 TRY 313 344 { 314 345 if (data_begin.isEmpty()) data_begin.setValue(0); … … 331 362 } 332 363 } 364 CATCH_DUMP_ATTR 333 365 334 366 size_t CAxis::getGlobalWrittenSize(void) … … 341 373 */ 342 374 void CAxis::checkMask() 375 TRY 343 376 { 344 377 if (!mask.isEmpty()) … … 360 393 } 361 394 } 395 CATCH_DUMP_ATTR 362 396 363 397 /*! … … 365 399 */ 366 400 void CAxis::checkBounds() 401 TRY 367 402 { 368 403 if (!bounds.isEmpty()) … … 377 412 else hasBounds = false; 378 413 } 414 CATCH_DUMP_ATTR 379 415 380 416 void CAxis::checkLabel() 417 TRY 381 418 { 382 419 if (!label.isEmpty()) … … 391 428 else hasLabel = false; 392 429 } 430 CATCH_DUMP_ATTR 393 431 394 432 /*! … … 396 434 */ 397 435 void CAxis::checkEligibilityForCompressedOutput() 436 TRY 398 437 { 399 438 // We don't check if the mask is valid here, just if a mask has been defined at this point. 400 439 isCompressible_ = !mask.isEmpty(); 401 440 } 441 CATCH_DUMP_ATTR 402 442 403 443 /*! … … 405 445 */ 406 446 bool CAxis::dispatchEvent(CEventServer& event) 447 TRY 407 448 { 408 449 if (SuperClass::dispatchEvent(event)) return true; … … 430 471 } 431 472 } 473 CATCH 432 474 433 475 /*! … … 435 477 */ 436 478 void CAxis::checkAttributesOnClient() 479 TRY 437 480 { 438 481 if (this->areClientAttributesChecked_) return; … … 443 486 this->areClientAttributesChecked_ = true; 444 487 } 488 CATCH_DUMP_ATTR 445 489 446 490 /* … … 450 494 void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, 451 495 CServerDistributionDescription::ServerDistributionType distType) 496 TRY 452 497 { 453 498 CContext* context=CContext::getCurrent() ; … … 463 508 this->isClientAfterTransformationChecked = true; 464 509 } 510 CATCH_DUMP_ATTR 465 511 466 512 /* … … 473 519 void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 474 520 CServerDistributionDescription::ServerDistributionType distType) 521 TRY 475 522 { 476 523 if (!this->areClientAttributesChecked_) checkAttributesOnClient(); … … 483 530 this->isChecked = true; 484 531 } 532 CATCH_DUMP_ATTR 485 533 486 534 /*! … … 491 539 void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 492 540 CServerDistributionDescription::ServerDistributionType distType) 541 TRY 493 542 { 494 543 sendDistributionAttribute(globalDim, orderPositionInGrid, distType); … … 505 554 } 506 555 } 556 CATCH_DUMP_ATTR 507 557 508 558 /* … … 516 566 void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid, 517 567 CServerDistributionDescription::ServerDistributionType distType) 568 TRY 518 569 { 519 570 CContext* context = CContext::getCurrent(); … … 635 686 } 636 687 } 688 CATCH_DUMP_ATTR 637 689 638 690 /* … … 642 694 */ 643 695 void CAxis::computeWrittenIndex() 696 TRY 644 697 { 645 698 if (computedWrittenIndex_) return; … … 688 741 } 689 742 } 743 CATCH_DUMP_ATTR 690 744 691 745 void CAxis::computeWrittenCompressedIndex(MPI_Comm writtenComm) 746 TRY 692 747 { 693 748 int writtenCommSize; … … 758 813 } 759 814 } 815 CATCH_DUMP_ATTR 760 816 761 817 /*! … … 768 824 void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid, 769 825 CServerDistributionDescription::ServerDistributionType distType) 826 TRY 770 827 { 771 828 std::list<CContextClient*>::iterator it; … … 806 863 } 807 864 } 865 CATCH_DUMP_ATTR 808 866 809 867 /* … … 812 870 */ 813 871 void CAxis::recvDistributionAttribute(CEventServer& event) 872 TRY 814 873 { 815 874 CBufferIn* buffer = event.subEvents.begin()->buffer; … … 818 877 get(axisId)->recvDistributionAttribute(*buffer); 819 878 } 879 CATCH 820 880 821 881 /* … … 824 884 */ 825 885 void CAxis::recvDistributionAttribute(CBufferIn& buffer) 886 TRY 826 887 { 827 888 int ni_srv, begin_srv; … … 833 894 begin.setValue(begin_srv); 834 895 } 896 CATCH_DUMP_ATTR 835 897 836 898 /* … … 840 902 */ 841 903 void CAxis::sendNonDistributedAttributes() 904 TRY 842 905 { 843 906 std::list<CContextClient*>::iterator it; … … 893 956 } 894 957 } 958 CATCH_DUMP_ATTR 895 959 896 960 /* … … 899 963 */ 900 964 void CAxis::recvNonDistributedAttributes(CEventServer& event) 965 TRY 901 966 { 902 967 list<CEventServer::SSubEvent>::iterator it; … … 909 974 } 910 975 } 976 CATCH 911 977 912 978 /* … … 916 982 */ 917 983 void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer) 984 TRY 918 985 { 919 986 CArray<int,1> tmp_index, tmp_data_index; … … 957 1024 for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx; 958 1025 } 1026 CATCH_DUMP_ATTR 959 1027 960 1028 /* … … 964 1032 */ 965 1033 void CAxis::sendDistributedAttributes(void) 1034 TRY 966 1035 { 967 1036 int ns, n, i, j, ind, nv, idx; … … 1069 1138 } 1070 1139 } 1140 CATCH_DUMP_ATTR 1071 1141 1072 1142 /* … … 1075 1145 */ 1076 1146 void CAxis::recvDistributedAttributes(CEventServer& event) 1147 TRY 1077 1148 { 1078 1149 string axisId; … … 1090 1161 get(axisId)->recvDistributedAttributes(ranks, buffers); 1091 1162 } 1163 CATCH 1092 1164 1093 1165 /* … … 1097 1169 */ 1098 1170 void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers) 1171 TRY 1099 1172 { 1100 1173 int nbReceived = ranks.size(), idx, ind, gloInd, locInd; … … 1219 1292 data_begin.setValue(0); 1220 1293 } 1221 1294 CATCH_DUMP_ATTR 1222 1295 1223 1296 /*! … … 1229 1302 */ 1230 1303 bool CAxis::isEqual(CAxis* obj) 1304 TRY 1231 1305 { 1232 1306 vector<StdString> excludedAttr; … … 1252 1326 return objEqual; 1253 1327 } 1328 CATCH_DUMP_ATTR 1254 1329 1255 1330 /* … … 1259 1334 */ 1260 1335 CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 1336 TRY 1261 1337 { 1262 1338 transformationMap_.push_back(std::make_pair(transType, CTransformation<CAxis>::createTransformation(transType,id))); 1263 1339 return transformationMap_.back().second; 1264 1340 } 1341 CATCH_DUMP_ATTR 1265 1342 1266 1343 /* … … 1268 1345 */ 1269 1346 bool CAxis::hasTransformation() 1347 TRY 1270 1348 { 1271 1349 return (!transformationMap_.empty()); 1272 1350 } 1351 CATCH_DUMP_ATTR 1273 1352 1274 1353 /* … … 1277 1356 */ 1278 1357 void CAxis::setTransformations(const TransMapTypes& axisTrans) 1358 TRY 1279 1359 { 1280 1360 transformationMap_ = axisTrans; 1281 1361 } 1362 CATCH_DUMP_ATTR 1282 1363 1283 1364 /* … … 1286 1367 */ 1287 1368 CAxis::TransMapTypes CAxis::getAllTransformations(void) 1369 TRY 1288 1370 { 1289 1371 return transformationMap_; 1290 1372 } 1373 CATCH_DUMP_ATTR 1291 1374 1292 1375 /* … … 1295 1378 */ 1296 1379 void CAxis::duplicateTransformation(CAxis* src) 1380 TRY 1297 1381 { 1298 1382 if (src->hasTransformation()) … … 1301 1385 } 1302 1386 } 1387 CATCH_DUMP_ATTR 1303 1388 1304 1389 /*! … … 1306 1391 */ 1307 1392 void CAxis::solveInheritanceTransformation() 1393 TRY 1308 1394 { 1309 1395 if (hasTransformation() || !hasDirectAxisReference()) … … 1322 1408 refAxis[i]->setTransformations(axis->getAllTransformations()); 1323 1409 } 1410 CATCH_DUMP_ATTR 1324 1411 1325 1412 void CAxis::setContextClient(CContextClient* contextClient) 1413 TRY 1326 1414 { 1327 1415 if (clientsSet.find(contextClient)==clientsSet.end()) … … 1330 1418 clientsSet.insert(contextClient); 1331 1419 } 1332 } 1420 } 1421 CATCH_DUMP_ATTR 1333 1422 1334 1423 void CAxis::parse(xml::CXMLNode & node) 1424 TRY 1335 1425 { 1336 1426 SuperClass::parse(node); … … 1363 1453 } 1364 1454 } 1455 CATCH_DUMP_ATTR 1365 1456 1366 1457 DEFINE_REF_FUNC(Axis,axis)
Note: See TracChangeset
for help on using the changeset viewer.