Changeset 1612 for XIOS/dev/dev_olga/src/node/axis.cpp
- Timestamp:
- 11/23/18 14:48:14 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/axis.cpp
r1600 r1612 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 CContext* context=CContext::getCurrent(); … … 311 340 } 312 341 } 342 CATCH_DUMP_ATTR 313 343 314 344 /*! … … 317 347 318 348 void CAxis::checkData() 349 TRY 319 350 { 320 351 if (data_begin.isEmpty()) data_begin.setValue(0); … … 363 394 364 395 } 396 CATCH_DUMP_ATTR 365 397 366 398 size_t CAxis::getGlobalWrittenSize(void) … … 373 405 */ 374 406 void CAxis::checkMask() 407 TRY 375 408 { 376 409 if (!mask.isEmpty()) … … 391 424 } 392 425 } 426 CATCH_DUMP_ATTR 393 427 394 428 /*! … … 396 430 */ 397 431 void CAxis::checkBounds() 432 TRY 398 433 { 399 434 if (!bounds.isEmpty()) … … 408 443 else hasBounds = false; 409 444 } 445 CATCH_DUMP_ATTR 410 446 411 447 void CAxis::checkLabel() 448 TRY 412 449 { 413 450 if (!label.isEmpty()) … … 422 459 else hasLabel = false; 423 460 } 461 CATCH_DUMP_ATTR 424 462 425 463 /*! … … 427 465 */ 428 466 void CAxis::checkEligibilityForCompressedOutput() 467 TRY 429 468 { 430 469 // We don't check if the mask is valid here, just if a mask has been defined at this point. 431 470 isCompressible_ = !mask.isEmpty(); 432 471 } 472 CATCH_DUMP_ATTR 433 473 434 474 /*! … … 436 476 */ 437 477 bool CAxis::dispatchEvent(CEventServer& event) 478 TRY 438 479 { 439 480 if (SuperClass::dispatchEvent(event)) return true; … … 461 502 } 462 503 } 504 CATCH 463 505 464 506 /*! … … 466 508 */ 467 509 void CAxis::checkAttributesOnClient() 510 TRY 468 511 { 469 512 if (this->areClientAttributesChecked_) return; … … 474 517 this->areClientAttributesChecked_ = true; 475 518 } 519 CATCH_DUMP_ATTR 476 520 477 521 /* … … 481 525 void CAxis::checkAttributesOnClientAfterTransformation(const std::vector<int>& globalDim, int orderPositionInGrid, 482 526 CServerDistributionDescription::ServerDistributionType distType) 527 TRY 483 528 { 484 529 CContext* context=CContext::getCurrent() ; … … 494 539 this->isClientAfterTransformationChecked = true; 495 540 } 541 CATCH_DUMP_ATTR 496 542 497 543 /* … … 504 550 void CAxis::sendCheckedAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 505 551 CServerDistributionDescription::ServerDistributionType distType) 552 TRY 506 553 { 507 554 if (!this->areClientAttributesChecked_) checkAttributesOnClient(); … … 514 561 this->isChecked = true; 515 562 } 563 CATCH_DUMP_ATTR 516 564 517 565 /*! … … 522 570 void CAxis::sendAttributes(const std::vector<int>& globalDim, int orderPositionInGrid, 523 571 CServerDistributionDescription::ServerDistributionType distType) 572 TRY 524 573 { 525 574 sendDistributionAttribute(globalDim, orderPositionInGrid, distType); … … 536 585 } 537 586 } 587 CATCH_DUMP_ATTR 538 588 539 589 /* … … 547 597 void CAxis::computeConnectedClients(const std::vector<int>& globalDim, int orderPositionInGrid, 548 598 CServerDistributionDescription::ServerDistributionType distType) 599 TRY 549 600 { 550 601 CContext* context = CContext::getCurrent(); … … 666 717 } 667 718 } 719 CATCH_DUMP_ATTR 668 720 669 721 /* … … 673 725 */ 674 726 void CAxis::computeWrittenIndex() 727 TRY 675 728 { 676 729 if (computedWrittenIndex_) return; … … 714 767 715 768 } 769 CATCH_DUMP_ATTR 716 770 717 771 void CAxis::computeWrittenCompressedIndex(MPI_Comm writtenComm) 772 TRY 718 773 { 719 774 int writtenCommSize; … … 804 859 } 805 860 } 861 CATCH_DUMP_ATTR 806 862 807 863 /*! … … 814 870 void CAxis::sendDistributionAttribute(const std::vector<int>& globalDim, int orderPositionInGrid, 815 871 CServerDistributionDescription::ServerDistributionType distType) 872 TRY 816 873 { 817 874 std::list<CContextClient*>::iterator it; … … 852 909 } 853 910 } 911 CATCH_DUMP_ATTR 854 912 855 913 /* … … 858 916 */ 859 917 void CAxis::recvDistributionAttribute(CEventServer& event) 918 TRY 860 919 { 861 920 CBufferIn* buffer = event.subEvents.begin()->buffer; … … 864 923 get(axisId)->recvDistributionAttribute(*buffer); 865 924 } 925 CATCH 866 926 867 927 /* … … 870 930 */ 871 931 void CAxis::recvDistributionAttribute(CBufferIn& buffer) 932 TRY 872 933 { 873 934 int ni_srv, begin_srv; … … 879 940 begin.setValue(begin_srv); 880 941 } 942 CATCH_DUMP_ATTR 881 943 882 944 /* … … 886 948 */ 887 949 void CAxis::sendNonDistributedAttributes() 950 TRY 888 951 { 889 952 std::list<CContextClient*>::iterator it; … … 939 1002 } 940 1003 } 1004 CATCH_DUMP_ATTR 941 1005 942 1006 /* … … 945 1009 */ 946 1010 void CAxis::recvNonDistributedAttributes(CEventServer& event) 1011 TRY 947 1012 { 948 1013 list<CEventServer::SSubEvent>::iterator it; … … 955 1020 } 956 1021 } 1022 CATCH 957 1023 958 1024 /* … … 962 1028 */ 963 1029 void CAxis::recvNonDistributedAttributes(int rank, CBufferIn& buffer) 1030 TRY 964 1031 { 965 1032 CArray<int,1> tmp_index, tmp_data_index; … … 1003 1070 for (int idx = 0; idx < index.numElements(); ++idx) globalLocalIndexMap_[index(idx)] = idx; 1004 1071 } 1072 CATCH_DUMP_ATTR 1005 1073 1006 1074 /* … … 1010 1078 */ 1011 1079 void CAxis::sendDistributedAttributes(void) 1080 TRY 1012 1081 { 1013 1082 int ind, idx; … … 1113 1182 } 1114 1183 } 1184 CATCH_DUMP_ATTR 1115 1185 1116 1186 /* … … 1119 1189 */ 1120 1190 void CAxis::recvDistributedAttributes(CEventServer& event) 1191 TRY 1121 1192 { 1122 1193 string axisId; … … 1134 1205 get(axisId)->recvDistributedAttributes(ranks, buffers); 1135 1206 } 1207 CATCH 1136 1208 1137 1209 /* … … 1141 1213 */ 1142 1214 void CAxis::recvDistributedAttributes(vector<int>& ranks, vector<CBufferIn*> buffers) 1215 TRY 1143 1216 { 1144 1217 int nbReceived = ranks.size(), idx, ind, gloInd, locInd; … … 1259 1332 data_n.setValue(data_index.numElements()); 1260 1333 } 1334 CATCH_DUMP_ATTR 1261 1335 1262 1336 /*! … … 1268 1342 */ 1269 1343 bool CAxis::isEqual(CAxis* obj) 1344 TRY 1270 1345 { 1271 1346 vector<StdString> excludedAttr; … … 1291 1366 return objEqual; 1292 1367 } 1368 CATCH_DUMP_ATTR 1293 1369 1294 1370 /* … … 1298 1374 */ 1299 1375 CTransformation<CAxis>* CAxis::addTransformation(ETranformationType transType, const StdString& id) 1376 TRY 1300 1377 { 1301 1378 transformationMap_.push_back(std::make_pair(transType, CTransformation<CAxis>::createTransformation(transType,id))); 1302 1379 return transformationMap_.back().second; 1303 1380 } 1381 CATCH_DUMP_ATTR 1304 1382 1305 1383 /* … … 1307 1385 */ 1308 1386 bool CAxis::hasTransformation() 1387 TRY 1309 1388 { 1310 1389 return (!transformationMap_.empty()); 1311 1390 } 1391 CATCH_DUMP_ATTR 1312 1392 1313 1393 /* … … 1316 1396 */ 1317 1397 void CAxis::setTransformations(const TransMapTypes& axisTrans) 1398 TRY 1318 1399 { 1319 1400 transformationMap_ = axisTrans; 1320 1401 } 1402 CATCH_DUMP_ATTR 1321 1403 1322 1404 /* … … 1325 1407 */ 1326 1408 CAxis::TransMapTypes CAxis::getAllTransformations(void) 1409 TRY 1327 1410 { 1328 1411 return transformationMap_; 1329 1412 } 1413 CATCH_DUMP_ATTR 1330 1414 1331 1415 /* … … 1334 1418 */ 1335 1419 void CAxis::duplicateTransformation(CAxis* src) 1420 TRY 1336 1421 { 1337 1422 if (src->hasTransformation()) … … 1340 1425 } 1341 1426 } 1427 CATCH_DUMP_ATTR 1342 1428 1343 1429 /*! … … 1345 1431 */ 1346 1432 void CAxis::solveInheritanceTransformation() 1433 TRY 1347 1434 { 1348 1435 if (hasTransformation() || !hasDirectAxisReference()) … … 1361 1448 refAxis[i]->setTransformations(axis->getAllTransformations()); 1362 1449 } 1450 CATCH_DUMP_ATTR 1363 1451 1364 1452 void CAxis::setContextClient(CContextClient* contextClient) 1453 TRY 1365 1454 { 1366 1455 if (clientsSet.find(contextClient)==clientsSet.end()) … … 1370 1459 } 1371 1460 } 1461 CATCH_DUMP_ATTR 1372 1462 1373 1463 void CAxis::parse(xml::CXMLNode & node) 1464 TRY 1374 1465 { 1375 1466 SuperClass::parse(node); … … 1402 1493 } 1403 1494 } 1495 CATCH_DUMP_ATTR 1404 1496 1405 1497 DEFINE_REF_FUNC(Axis,axis)
Note: See TracChangeset
for help on using the changeset viewer.