Changeset 1612 for XIOS/dev/dev_olga/src/node/domain.cpp
- Timestamp:
- 11/23/18 14:48:14 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/domain.cpp
r1600 r1612 58 58 59 59 void CDomain::assignMesh(const StdString meshName, const int nvertex) 60 TRY 60 61 { 61 62 mesh = CMesh::getMesh(meshName, nvertex); 62 63 } 64 CATCH_DUMP_ATTR 63 65 64 66 CDomain* CDomain::createDomain() 67 TRY 65 68 { 66 69 CDomain* domain = CDomainGroup::get("domain_definition")->createChild(); 67 70 return domain; 68 71 } 72 CATCH 69 73 70 74 std::map<StdString, ETranformationType> CDomain::transformationMapList_ = std::map<StdString, ETranformationType>(); … … 72 76 73 77 bool CDomain::initializeTransformationMap(std::map<StdString, ETranformationType>& m) 78 TRY 74 79 { 75 80 m["zoom_domain"] = TRANS_ZOOM_DOMAIN; … … 81 86 m["extract_domain"] = TRANS_EXTRACT_DOMAIN; 82 87 } 88 CATCH 83 89 84 90 const std::set<StdString> & CDomain::getRelFiles(void) const 91 TRY 85 92 { 86 93 return (this->relFiles); 87 94 } 88 95 CATCH 89 96 90 97 /*! … … 93 100 */ 94 101 int CDomain::getNumberWrittenIndexes(MPI_Comm writtenCom) 102 TRY 95 103 { 96 104 int writtenSize; … … 98 106 return numberWrittenIndexes_[writtenSize]; 99 107 } 108 CATCH_DUMP_ATTR 100 109 101 110 /*! … … 104 113 */ 105 114 int CDomain::getTotalNumberWrittenIndexes(MPI_Comm writtenCom) 115 TRY 106 116 { 107 117 int writtenSize; … … 109 119 return totalNumberWrittenIndexes_[writtenSize]; 110 120 } 121 CATCH_DUMP_ATTR 111 122 112 123 /*! … … 115 126 */ 116 127 int CDomain::getOffsetWrittenIndexes(MPI_Comm writtenCom) 128 TRY 117 129 { 118 130 int writtenSize; … … 120 132 return offsetWrittenIndexes_[writtenSize]; 121 133 } 134 CATCH_DUMP_ATTR 122 135 123 136 CArray<int, 1>& CDomain::getCompressedIndexToWriteOnServer(MPI_Comm writtenCom) 137 TRY 124 138 { 125 139 int writtenSize; … … 127 141 return compressedIndexToWriteOnServer[writtenSize]; 128 142 } 143 CATCH_DUMP_ATTR 129 144 130 145 //---------------------------------------------------------------- … … 136 151 */ 137 152 std::map<int, StdSize> CDomain::getAttributesBufferSize(CContextClient* client, bool bufferForWriting /*= false*/) 153 TRY 138 154 { 139 155 … … 176 192 return attributesSizes; 177 193 } 194 CATCH_DUMP_ATTR 178 195 179 196 //---------------------------------------------------------------- 180 197 181 198 bool CDomain::isEmpty(void) const 199 TRY 182 200 { 183 201 return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 184 202 } 203 CATCH 185 204 186 205 //---------------------------------------------------------------- 187 206 188 207 bool CDomain::IsWritten(const StdString & filename) const 208 TRY 189 209 { 190 210 return (this->relFiles.find(filename) != this->relFiles.end()); 191 211 } 212 CATCH 192 213 193 214 bool CDomain::isWrittenCompressed(const StdString& filename) const 215 TRY 194 216 { 195 217 return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 196 218 } 219 CATCH 197 220 198 221 //---------------------------------------------------------------- 199 222 200 223 bool CDomain::isDistributed(void) const 224 TRY 201 225 { 202 226 bool distributed = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || … … 206 230 return distributed; 207 231 } 232 CATCH 208 233 209 234 //---------------------------------------------------------------- … … 215 240 */ 216 241 bool CDomain::isCompressible(void) const 242 TRY 217 243 { 218 244 return isCompressible_; 219 245 } 246 CATCH 220 247 221 248 void CDomain::addRelFile(const StdString & filename) 249 TRY 222 250 { 223 251 this->relFiles.insert(filename); 224 252 } 253 CATCH_DUMP_ATTR 225 254 226 255 void CDomain::addRelFileCompressed(const StdString& filename) 256 TRY 227 257 { 228 258 this->relFilesCompressed.insert(filename); 229 259 } 260 CATCH_DUMP_ATTR 230 261 231 262 StdString CDomain::GetName(void) { return (StdString("domain")); } … … 240 271 */ 241 272 bool CDomain::distributionAttributesHaveValue() const 273 TRY 242 274 { 243 275 bool hasValues = true; … … 251 283 return hasValues; 252 284 } 285 CATCH 253 286 254 287 /*! … … 260 293 */ 261 294 void CDomain::redistribute(int nbLocalDomain) 295 TRY 262 296 { 263 297 if (this->isRedistributed_) return; … … 422 456 checkDomain(); 423 457 } 458 CATCH_DUMP_ATTR 424 459 425 460 /*! … … 427 462 */ 428 463 void CDomain::fillInLonLat() 464 TRY 429 465 { 430 466 switch (type) … … 444 480 } 445 481 completeLonLatClient() ; 446 447 }482 } 483 CATCH_DUMP_ATTR 448 484 449 485 /*! … … 453 489 */ 454 490 void CDomain::fillInRectilinearLonLat() 491 TRY 455 492 { 456 493 if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) … … 462 499 lon_end.setValue(lonvalue_rectilinear_read_from_file(ni_glo-1)); 463 500 } 464 else 501 else if (!hasLonInReadFile_) 465 502 { 466 503 if (!lonvalue_2d.isEmpty()) lonvalue_2d.free(); … … 496 533 lat_end.setValue(latvalue_rectilinear_read_from_file(nj_glo-1)); 497 534 } 498 else 535 else if (!hasLatInReadFile_) 499 536 { 500 537 if (!latvalue_2d.isEmpty()) latvalue_1d.free(); … … 521 558 } 522 559 } 560 CATCH_DUMP_ATTR 523 561 524 562 /* … … 527 565 */ 528 566 void CDomain::fillInCurvilinearLonLat() 567 TRY 529 568 { 530 569 if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) … … 569 608 bounds_latvalue_curvilinear_read_from_file.free(); 570 609 } 571 572 }610 } 611 CATCH_DUMP_ATTR 573 612 574 613 /* … … 577 616 */ 578 617 void CDomain::fillInUnstructuredLonLat() 618 TRY 579 619 { 580 620 if (i_index.isEmpty()) … … 628 668 } 629 669 } 670 CATCH_DUMP_ATTR 630 671 631 672 /* … … 633 674 */ 634 675 void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 676 TRY 635 677 { 636 678 CContext* context = CContext::getCurrent(); … … 664 706 delete[] nj_g ; 665 707 } 708 CATCH_DUMP_ATTR 666 709 667 710 void CDomain::fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 668 711 CArray<double,2>& boundsLon, CArray<double,2>& boundsLat) 669 { 712 TRY 713 { 670 714 int i,j,k; 671 715 … … 766 810 } 767 811 } 812 CATCH_DUMP_ATTR 768 813 769 814 /* … … 771 816 */ 772 817 void CDomain::checkDomain(void) 818 TRY 773 819 { 774 820 if (type.isEmpty()) … … 862 908 } 863 909 } 910 CATCH_DUMP_ATTR 864 911 865 912 size_t CDomain::getGlobalWrittenSize(void) … … 871 918 // Check validity of local domain on using the combination of 3 parameters: ibegin, ni and i_index 872 919 void CDomain::checkLocalIDomain(void) 920 TRY 873 921 { 874 922 // If ibegin and ni are provided then we use them to check the validity of local domain … … 929 977 } 930 978 } 979 CATCH_DUMP_ATTR 931 980 932 981 // Check validity of local domain on using the combination of 3 parameters: jbegin, nj and j_index 933 982 void CDomain::checkLocalJDomain(void) 983 TRY 934 984 { 935 985 // If jbegin and nj are provided then we use them to check the validity of local domain … … 980 1030 } 981 1031 } 1032 CATCH_DUMP_ATTR 982 1033 983 1034 //---------------------------------------------------------------- 984 1035 985 1036 void CDomain::checkMask(void) 1037 TRY 986 1038 { 987 1039 if (!mask_1d.isEmpty() && !mask_2d.isEmpty()) … … 1029 1081 } 1030 1082 } 1083 CATCH_DUMP_ATTR 1031 1084 1032 1085 //---------------------------------------------------------------- 1033 1086 1034 1087 void CDomain::checkDomainData(void) 1088 TRY 1035 1089 { 1036 1090 if (data_dim.isEmpty()) … … 1072 1126 } 1073 1127 } 1128 CATCH_DUMP_ATTR 1074 1129 1075 1130 //---------------------------------------------------------------- 1076 1131 1077 1132 void CDomain::checkCompression(void) 1133 TRY 1078 1134 { 1079 1135 int i,j,ind; … … 1202 1258 } 1203 1259 } 1260 CATCH_DUMP_ATTR 1204 1261 1205 1262 //---------------------------------------------------------------- 1206 1263 void CDomain::computeLocalMask(void) 1264 TRY 1207 1265 { 1208 1266 localMask.resize(i_index.numElements()) ; … … 1236 1294 } 1237 1295 } 1296 CATCH_DUMP_ATTR 1238 1297 1239 1298 void CDomain::checkEligibilityForCompressedOutput(void) 1299 TRY 1240 1300 { 1241 1301 // We don't check if the mask or the indexes are valid here, just if they have been defined at this point. 1242 1302 isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty(); 1243 1303 } 1304 CATCH_DUMP_ATTR 1244 1305 1245 1306 //---------------------------------------------------------------- … … 1250 1311 */ 1251 1312 void CDomain::completeLonLatClient(void) 1313 TRY 1252 1314 { 1253 1315 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); … … 1363 1425 } 1364 1426 } 1427 CATCH_DUMP_ATTR 1365 1428 1366 1429 /* … … 1368 1431 */ 1369 1432 void CDomain::convertLonLatValue(void) 1433 TRY 1370 1434 { 1371 1435 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); … … 1465 1529 } 1466 1530 } 1467 1531 CATCH_DUMP_ATTR 1468 1532 1469 1533 void CDomain::checkBounds(void) 1534 TRY 1470 1535 { 1471 1536 bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements()); … … 1559 1624 } 1560 1625 } 1626 CATCH_DUMP_ATTR 1561 1627 1562 1628 void CDomain::checkArea(void) 1629 TRY 1563 1630 { 1564 1631 bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); … … 1588 1655 } 1589 1656 } 1657 CATCH_DUMP_ATTR 1590 1658 1591 1659 void CDomain::checkLonLat() 1660 TRY 1592 1661 { 1593 1662 if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) || … … 1649 1718 } 1650 1719 } 1720 CATCH_DUMP_ATTR 1651 1721 1652 1722 void CDomain::checkAttributesOnClientAfterTransformation() 1723 TRY 1653 1724 { 1654 1725 CContext* context=CContext::getCurrent() ; … … 1665 1736 this->isClientAfterTransformationChecked = true; 1666 1737 } 1738 CATCH_DUMP_ATTR 1667 1739 1668 1740 //---------------------------------------------------------------- … … 1670 1742 // This function only checks all attributes of current domain 1671 1743 void CDomain::checkAttributesOnClient() 1744 TRY 1672 1745 { 1673 1746 if (this->isClientChecked) return; … … 1695 1768 this->isClientChecked = true; 1696 1769 } 1770 CATCH_DUMP_ATTR 1697 1771 1698 1772 // Send all checked attributes to server 1699 1773 void CDomain::sendCheckedAttributes() 1774 TRY 1700 1775 { 1701 1776 if (!this->isClientChecked) checkAttributesOnClient(); … … 1710 1785 this->isChecked = true; 1711 1786 } 1787 CATCH_DUMP_ATTR 1712 1788 1713 1789 void CDomain::checkAttributes(void) 1790 TRY 1714 1791 { 1715 1792 if (this->isChecked) return; … … 1741 1818 this->isChecked = true; 1742 1819 } 1820 CATCH_DUMP_ATTR 1743 1821 1744 1822 /*! … … 1749 1827 */ 1750 1828 void CDomain::computeConnectedClients() 1829 TRY 1751 1830 { 1752 1831 CContext* context=CContext::getCurrent() ; … … 1876 1955 } 1877 1956 } 1957 CATCH_DUMP_ATTR 1878 1958 1879 1959 /*! … … 1883 1963 */ 1884 1964 void CDomain::computeWrittenIndex() 1965 TRY 1885 1966 { 1886 1967 if (computedWrittenIndex_) return; … … 1920 2001 } 1921 2002 } 2003 CATCH_DUMP_ATTR 1922 2004 1923 2005 void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm) 2006 TRY 1924 2007 { 1925 2008 int writtenCommSize; … … 1989 2072 } 1990 2073 } 2074 CATCH_DUMP_ATTR 1991 2075 1992 2076 /*! … … 1995 2079 */ 1996 2080 void CDomain::sendAttributes() 2081 TRY 1997 2082 { 1998 2083 sendDistributionAttributes(); … … 2002 2087 sendDataIndex(); 2003 2088 } 2004 2089 CATCH 2005 2090 /*! 2006 2091 Send global index from client to connected client(s) 2007 2092 */ 2008 2093 void CDomain::sendIndex() 2094 TRY 2009 2095 { 2010 2096 int ns, n, i, j, ind, nv, idx; … … 2049 2135 } 2050 2136 } 2137 CATCH_DUMP_ATTR 2051 2138 2052 2139 /*! … … 2056 2143 */ 2057 2144 void CDomain::sendDistributionAttributes(void) 2145 TRY 2058 2146 { 2059 2147 std::list<CContextClient*>::iterator it; … … 2102 2190 } 2103 2191 } 2192 CATCH_DUMP_ATTR 2104 2193 2105 2194 /*! … … 2107 2196 */ 2108 2197 void CDomain::sendArea() 2198 TRY 2109 2199 { 2110 2200 if (!hasArea) return; … … 2150 2240 } 2151 2241 } 2242 CATCH_DUMP_ATTR 2152 2243 2153 2244 /*! … … 2157 2248 */ 2158 2249 void CDomain::sendLonLat() 2250 TRY 2159 2251 { 2160 2252 if (!hasLonLat) return; … … 2245 2337 } 2246 2338 } 2339 CATCH_DUMP_ATTR 2247 2340 2248 2341 /*! … … 2253 2346 */ 2254 2347 void CDomain::sendDataIndex() 2348 TRY 2255 2349 { 2256 2350 int ns, n, i, j, ind, nv, idx; … … 2321 2415 } 2322 2416 } 2417 CATCH 2323 2418 2324 2419 bool CDomain::dispatchEvent(CEventServer& event) 2420 TRY 2325 2421 { 2326 2422 if (SuperClass::dispatchEvent(event)) return true; … … 2360 2456 } 2361 2457 } 2458 CATCH 2362 2459 2363 2460 /*! … … 2366 2463 */ 2367 2464 void CDomain::recvIndex(CEventServer& event) 2465 TRY 2368 2466 { 2369 2467 string domainId; … … 2379 2477 get(domainId)->recvIndex(rankBuffers); 2380 2478 } 2479 CATCH 2381 2480 2382 2481 /*! … … 2386 2485 */ 2387 2486 void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers) 2487 TRY 2388 2488 { 2389 2489 int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex; … … 2445 2545 domainMask.resize(0); // Mask is not defined anymore on servers 2446 2546 } 2547 CATCH 2447 2548 2448 2549 /*! … … 2451 2552 */ 2452 2553 void CDomain::recvDistributionAttributes(CEventServer& event) 2554 TRY 2453 2555 { 2454 2556 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 2457 2559 get(domainId)->recvDistributionAttributes(*buffer); 2458 2560 } 2561 CATCH 2459 2562 2460 2563 /*! … … 2464 2567 */ 2465 2568 void CDomain::recvDistributionAttributes(CBufferIn& buffer) 2569 TRY 2466 2570 { 2467 2571 int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp; … … 2479 2583 2480 2584 } 2481 2585 CATCH_DUMP_ATTR 2482 2586 /*! 2483 2587 Receive longitude event from clients(s) … … 2485 2589 */ 2486 2590 void CDomain::recvLon(CEventServer& event) 2591 TRY 2487 2592 { 2488 2593 string domainId; … … 2498 2603 get(domainId)->recvLon(rankBuffers); 2499 2604 } 2605 CATCH 2500 2606 2501 2607 /*! … … 2504 2610 */ 2505 2611 void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers) 2612 TRY 2506 2613 { 2507 2614 int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; … … 2563 2670 } 2564 2671 } 2672 CATCH_DUMP_ATTR 2565 2673 2566 2674 /*! … … 2569 2677 */ 2570 2678 void CDomain::recvLat(CEventServer& event) 2679 TRY 2571 2680 { 2572 2681 string domainId; … … 2582 2691 get(domainId)->recvLat(rankBuffers); 2583 2692 } 2693 CATCH 2584 2694 2585 2695 /*! … … 2588 2698 */ 2589 2699 void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers) 2700 TRY 2590 2701 { 2591 2702 int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; … … 2649 2760 } 2650 2761 } 2762 CATCH_DUMP_ATTR 2651 2763 2652 2764 /*! … … 2655 2767 */ 2656 2768 void CDomain::recvArea(CEventServer& event) 2769 TRY 2657 2770 { 2658 2771 string domainId; … … 2668 2781 get(domainId)->recvArea(rankBuffers); 2669 2782 } 2783 CATCH 2670 2784 2671 2785 /*! … … 2674 2788 */ 2675 2789 void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers) 2790 TRY 2676 2791 { 2677 2792 int nbReceived = rankBuffers.size(), i, ind, index, lInd; … … 2719 2834 } 2720 2835 } 2836 CATCH_DUMP_ATTR 2721 2837 2722 2838 /*! … … 2728 2844 */ 2729 2845 bool CDomain::isEqual(CDomain* obj) 2846 TRY 2730 2847 { 2731 2848 vector<StdString> excludedAttr; … … 2750 2867 return objEqual; 2751 2868 } 2869 CATCH_DUMP_ATTR 2752 2870 2753 2871 /*! … … 2756 2874 */ 2757 2875 void CDomain::recvDataIndex(CEventServer& event) 2876 TRY 2758 2877 { 2759 2878 string domainId; … … 2769 2888 get(domainId)->recvDataIndex(rankBuffers); 2770 2889 } 2890 CATCH 2771 2891 2772 2892 /*! … … 2780 2900 */ 2781 2901 void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers) 2902 TRY 2782 2903 { 2783 2904 int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd; … … 2846 2967 data_jbegin.setValue(0); 2847 2968 } 2969 CATCH_DUMP_ATTR 2848 2970 2849 2971 CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id) 2972 TRY 2850 2973 { 2851 2974 transformationMap_.push_back(std::make_pair(transType, CTransformation<CDomain>::createTransformation(transType,id))); 2852 2975 return transformationMap_.back().second; 2853 2976 } 2977 CATCH_DUMP_ATTR 2854 2978 2855 2979 /*! … … 2858 2982 */ 2859 2983 bool CDomain::hasTransformation() 2984 TRY 2860 2985 { 2861 2986 return (!transformationMap_.empty()); 2862 2987 } 2988 CATCH_DUMP_ATTR 2863 2989 2864 2990 /*! … … 2867 2993 */ 2868 2994 void CDomain::setTransformations(const TransMapTypes& domTrans) 2995 TRY 2869 2996 { 2870 2997 transformationMap_ = domTrans; 2871 2998 } 2999 CATCH_DUMP_ATTR 2872 3000 2873 3001 /*! … … 2876 3004 */ 2877 3005 CDomain::TransMapTypes CDomain::getAllTransformations(void) 3006 TRY 2878 3007 { 2879 3008 return transformationMap_; 2880 3009 } 3010 CATCH_DUMP_ATTR 2881 3011 2882 3012 void CDomain::duplicateTransformation(CDomain* src) 3013 TRY 2883 3014 { 2884 3015 if (src->hasTransformation()) … … 2887 3018 } 2888 3019 } 3020 CATCH_DUMP_ATTR 2889 3021 2890 3022 /*! … … 2892 3024 */ 2893 3025 void CDomain::solveInheritanceTransformation() 3026 TRY 2894 3027 { 2895 3028 if (hasTransformation() || !hasDirectDomainReference()) … … 2908 3041 refDomains[i]->setTransformations(domain->getAllTransformations()); 2909 3042 } 3043 CATCH_DUMP_ATTR 2910 3044 2911 3045 void CDomain::setContextClient(CContextClient* contextClient) 3046 TRY 2912 3047 { 2913 3048 if (clientsSet.find(contextClient)==clientsSet.end()) … … 2917 3052 } 2918 3053 } 3054 CATCH_DUMP_ATTR 2919 3055 2920 3056 /*! … … 2924 3060 */ 2925 3061 void CDomain::parse(xml::CXMLNode & node) 3062 TRY 2926 3063 { 2927 3064 SuperClass::parse(node); … … 2954 3091 } 2955 3092 } 3093 CATCH_DUMP_ATTR 2956 3094 //---------------------------------------------------------------- 2957 3095
Note: See TracChangeset
for help on using the changeset viewer.