Changeset 1622 for XIOS/trunk/src/node/domain.cpp
- Timestamp:
- 12/11/18 13:22:07 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/domain.cpp
r1578 r1622 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 … … 182 198 return attributesSizes; 183 199 } 200 CATCH_DUMP_ATTR 184 201 185 202 //---------------------------------------------------------------- 186 203 187 204 bool CDomain::isEmpty(void) const 205 TRY 188 206 { 189 207 return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 190 208 } 209 CATCH 191 210 192 211 //---------------------------------------------------------------- 193 212 194 213 bool CDomain::IsWritten(const StdString & filename) const 214 TRY 195 215 { 196 216 return (this->relFiles.find(filename) != this->relFiles.end()); 197 217 } 218 CATCH 198 219 199 220 bool CDomain::isWrittenCompressed(const StdString& filename) const 221 TRY 200 222 { 201 223 return (this->relFilesCompressed.find(filename) != this->relFilesCompressed.end()); 202 224 } 225 CATCH 203 226 204 227 //---------------------------------------------------------------- 205 228 206 229 bool CDomain::isDistributed(void) const 230 TRY 207 231 { 208 232 bool distributed = !((!ni.isEmpty() && (ni == ni_glo) && !nj.isEmpty() && (nj == nj_glo)) || … … 212 236 return distributed; 213 237 } 238 CATCH 214 239 215 240 //---------------------------------------------------------------- … … 221 246 */ 222 247 bool CDomain::isCompressible(void) const 248 TRY 223 249 { 224 250 return isCompressible_; 225 251 } 252 CATCH 226 253 227 254 void CDomain::addRelFile(const StdString & filename) 255 TRY 228 256 { 229 257 this->relFiles.insert(filename); 230 258 } 259 CATCH_DUMP_ATTR 231 260 232 261 void CDomain::addRelFileCompressed(const StdString& filename) 262 TRY 233 263 { 234 264 this->relFilesCompressed.insert(filename); 235 265 } 266 CATCH_DUMP_ATTR 236 267 237 268 StdString CDomain::GetName(void) { return (StdString("domain")); } … … 246 277 */ 247 278 bool CDomain::distributionAttributesHaveValue() const 279 TRY 248 280 { 249 281 bool hasValues = true; … … 257 289 return hasValues; 258 290 } 291 CATCH 259 292 260 293 /*! … … 266 299 */ 267 300 void CDomain::redistribute(int nbLocalDomain) 301 TRY 268 302 { 269 303 if (this->isRedistributed_) return; … … 428 462 checkDomain(); 429 463 } 464 CATCH_DUMP_ATTR 430 465 431 466 /*! … … 433 468 */ 434 469 void CDomain::fillInLonLat() 470 TRY 435 471 { 436 472 switch (type) … … 450 486 } 451 487 completeLonLatClient() ; 452 453 }488 } 489 CATCH_DUMP_ATTR 454 490 455 491 /*! … … 459 495 */ 460 496 void CDomain::fillInRectilinearLonLat() 497 TRY 461 498 { 462 499 if (!lonvalue_rectilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) … … 527 564 } 528 565 } 566 CATCH_DUMP_ATTR 529 567 530 568 /* … … 533 571 */ 534 572 void CDomain::fillInCurvilinearLonLat() 573 TRY 535 574 { 536 575 if (!lonvalue_curvilinear_read_from_file.isEmpty() && lonvalue_2d.isEmpty() && lonvalue_1d.isEmpty()) … … 575 614 bounds_latvalue_curvilinear_read_from_file.free(); 576 615 } 577 578 }616 } 617 CATCH_DUMP_ATTR 579 618 580 619 /* … … 583 622 */ 584 623 void CDomain::fillInUnstructuredLonLat() 624 TRY 585 625 { 586 626 if (i_index.isEmpty()) … … 634 674 } 635 675 } 676 CATCH_DUMP_ATTR 636 677 637 678 /* … … 639 680 */ 640 681 void CDomain::AllgatherRectilinearLonLat(CArray<double,1>& lon, CArray<double,1>& lat, CArray<double,1>& lon_g, CArray<double,1>& lat_g) 682 TRY 641 683 { 642 684 CContext* context = CContext::getCurrent(); … … 670 712 delete[] nj_g ; 671 713 } 714 CATCH_DUMP_ATTR 672 715 673 716 void CDomain::fillInRectilinearBoundLonLat(CArray<double,1>& lon, CArray<double,1>& lat, 674 717 CArray<double,2>& boundsLon, CArray<double,2>& boundsLat) 675 { 718 TRY 719 { 676 720 int i,j,k; 677 721 … … 772 816 } 773 817 } 818 CATCH_DUMP_ATTR 774 819 775 820 /* … … 777 822 */ 778 823 void CDomain::checkDomain(void) 824 TRY 779 825 { 780 826 if (type.isEmpty()) … … 868 914 } 869 915 } 916 CATCH_DUMP_ATTR 870 917 871 918 size_t CDomain::getGlobalWrittenSize(void) … … 877 924 // Check validity of local domain on using the combination of 3 parameters: ibegin, ni and i_index 878 925 void CDomain::checkLocalIDomain(void) 926 TRY 879 927 { 880 928 // If ibegin and ni are provided then we use them to check the validity of local domain … … 935 983 } 936 984 } 985 CATCH_DUMP_ATTR 937 986 938 987 // Check validity of local domain on using the combination of 3 parameters: jbegin, nj and j_index 939 988 void CDomain::checkLocalJDomain(void) 989 TRY 940 990 { 941 991 // If jbegin and nj are provided then we use them to check the validity of local domain … … 986 1036 } 987 1037 } 1038 CATCH_DUMP_ATTR 988 1039 989 1040 //---------------------------------------------------------------- 990 1041 991 1042 void CDomain::checkMask(void) 1043 TRY 992 1044 { 993 1045 if (!mask_1d.isEmpty() && !mask_2d.isEmpty()) … … 1035 1087 } 1036 1088 } 1089 CATCH_DUMP_ATTR 1037 1090 1038 1091 //---------------------------------------------------------------- 1039 1092 1040 1093 void CDomain::checkDomainData(void) 1094 TRY 1041 1095 { 1042 1096 if (data_dim.isEmpty()) … … 1078 1132 } 1079 1133 } 1134 CATCH_DUMP_ATTR 1080 1135 1081 1136 //---------------------------------------------------------------- 1082 1137 1083 1138 void CDomain::checkCompression(void) 1139 TRY 1084 1140 { 1085 1141 if (!data_i_index.isEmpty()) … … 1148 1204 } 1149 1205 } 1206 CATCH_DUMP_ATTR 1150 1207 1151 1208 //---------------------------------------------------------------- 1152 1209 void CDomain::computeLocalMask(void) 1210 TRY 1153 1211 { 1154 1212 localMask.resize(i_index.numElements()) ; … … 1182 1240 } 1183 1241 } 1242 CATCH_DUMP_ATTR 1184 1243 1185 1244 void CDomain::checkEligibilityForCompressedOutput(void) 1245 TRY 1186 1246 { 1187 1247 // We don't check if the mask or the indexes are valid here, just if they have been defined at this point. 1188 1248 isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty(); 1189 1249 } 1250 CATCH_DUMP_ATTR 1190 1251 1191 1252 //---------------------------------------------------------------- … … 1196 1257 */ 1197 1258 void CDomain::completeLonLatClient(void) 1259 TRY 1198 1260 { 1199 1261 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); … … 1309 1371 } 1310 1372 } 1373 CATCH_DUMP_ATTR 1311 1374 1312 1375 /* … … 1314 1377 */ 1315 1378 void CDomain::convertLonLatValue(void) 1379 TRY 1316 1380 { 1317 1381 bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); … … 1411 1475 } 1412 1476 } 1413 1477 CATCH_DUMP_ATTR 1414 1478 1415 1479 void CDomain::checkBounds(void) 1480 TRY 1416 1481 { 1417 1482 bool hasBoundValues = (0 != bounds_lonvalue.numElements()) || (0 != bounds_latvalue.numElements()); … … 1505 1570 } 1506 1571 } 1572 CATCH_DUMP_ATTR 1507 1573 1508 1574 void CDomain::checkArea(void) 1575 TRY 1509 1576 { 1510 1577 bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); … … 1534 1601 } 1535 1602 } 1603 CATCH_DUMP_ATTR 1536 1604 1537 1605 void CDomain::checkLonLat() 1606 TRY 1538 1607 { 1539 1608 if (!hasLonLat) hasLonLat = (!latvalue_1d.isEmpty() && !lonvalue_1d.isEmpty()) || … … 1595 1664 } 1596 1665 } 1666 CATCH_DUMP_ATTR 1597 1667 1598 1668 void CDomain::checkAttributesOnClientAfterTransformation() 1669 TRY 1599 1670 { 1600 1671 CContext* context=CContext::getCurrent() ; … … 1611 1682 this->isClientAfterTransformationChecked = true; 1612 1683 } 1684 CATCH_DUMP_ATTR 1613 1685 1614 1686 //---------------------------------------------------------------- … … 1616 1688 // This function only checks all attributes of current domain 1617 1689 void CDomain::checkAttributesOnClient() 1690 TRY 1618 1691 { 1619 1692 if (this->isClientChecked) return; … … 1641 1714 this->isClientChecked = true; 1642 1715 } 1716 CATCH_DUMP_ATTR 1643 1717 1644 1718 // Send all checked attributes to server 1645 1719 void CDomain::sendCheckedAttributes() 1720 TRY 1646 1721 { 1647 1722 if (!this->isClientChecked) checkAttributesOnClient(); … … 1656 1731 this->isChecked = true; 1657 1732 } 1733 CATCH_DUMP_ATTR 1658 1734 1659 1735 void CDomain::checkAttributes(void) 1736 TRY 1660 1737 { 1661 1738 if (this->isChecked) return; … … 1687 1764 this->isChecked = true; 1688 1765 } 1766 CATCH_DUMP_ATTR 1689 1767 1690 1768 /*! … … 1695 1773 */ 1696 1774 void CDomain::computeConnectedClients() 1775 TRY 1697 1776 { 1698 1777 CContext* context=CContext::getCurrent() ; … … 1799 1878 } 1800 1879 } 1880 CATCH_DUMP_ATTR 1801 1881 1802 1882 /*! … … 1806 1886 */ 1807 1887 void CDomain::computeWrittenIndex() 1888 TRY 1808 1889 { 1809 1890 if (computedWrittenIndex_) return; … … 1900 1981 // } 1901 1982 } 1983 CATCH_DUMP_ATTR 1902 1984 1903 1985 void CDomain::computeWrittenCompressedIndex(MPI_Comm writtenComm) 1986 TRY 1904 1987 { 1905 1988 int writtenCommSize; … … 1969 2052 } 1970 2053 } 2054 CATCH_DUMP_ATTR 1971 2055 1972 2056 /*! … … 1975 2059 */ 1976 2060 void CDomain::sendAttributes() 2061 TRY 1977 2062 { 1978 2063 sendDistributionAttributes(); … … 1983 2068 sendDataIndex(); 1984 2069 } 1985 2070 CATCH 1986 2071 /*! 1987 2072 Send global index from client to connected client(s) 1988 2073 */ 1989 2074 void CDomain::sendIndex() 2075 TRY 1990 2076 { 1991 2077 int ns, n, i, j, ind, nv, idx; … … 2030 2116 } 2031 2117 } 2118 CATCH_DUMP_ATTR 2032 2119 2033 2120 /*! … … 2037 2124 */ 2038 2125 void CDomain::sendDistributionAttributes(void) 2126 TRY 2039 2127 { 2040 2128 std::list<CContextClient*>::iterator it; … … 2083 2171 } 2084 2172 } 2173 CATCH_DUMP_ATTR 2085 2174 2086 2175 /*! … … 2088 2177 */ 2089 2178 void CDomain::sendMask() 2179 TRY 2090 2180 { 2091 2181 int ns, n, i, j, ind, nv, idx; … … 2127 2217 } 2128 2218 } 2219 CATCH_DUMP_ATTR 2129 2220 2130 2221 /*! … … 2132 2223 */ 2133 2224 void CDomain::sendArea() 2225 TRY 2134 2226 { 2135 2227 if (!hasArea) return; … … 2175 2267 } 2176 2268 } 2269 CATCH_DUMP_ATTR 2177 2270 2178 2271 /*! … … 2182 2275 */ 2183 2276 void CDomain::sendLonLat() 2277 TRY 2184 2278 { 2185 2279 if (!hasLonLat) return; … … 2270 2364 } 2271 2365 } 2366 CATCH_DUMP_ATTR 2272 2367 2273 2368 /*! … … 2278 2373 */ 2279 2374 void CDomain::sendDataIndex() 2375 TRY 2280 2376 { 2281 2377 int ns, n, i, j, ind, nv, idx; … … 2346 2442 } 2347 2443 } 2444 CATCH 2348 2445 2349 2446 bool CDomain::dispatchEvent(CEventServer& event) 2447 TRY 2350 2448 { 2351 2449 if (SuperClass::dispatchEvent(event)) return true; … … 2389 2487 } 2390 2488 } 2489 CATCH 2391 2490 2392 2491 /*! … … 2395 2494 */ 2396 2495 void CDomain::recvIndex(CEventServer& event) 2496 TRY 2397 2497 { 2398 2498 string domainId; … … 2408 2508 get(domainId)->recvIndex(rankBuffers); 2409 2509 } 2510 CATCH 2410 2511 2411 2512 /*! … … 2415 2516 */ 2416 2517 void CDomain::recvIndex(std::map<int, CBufferIn*>& rankBuffers) 2518 TRY 2417 2519 { 2418 2520 int nbReceived = rankBuffers.size(), i, ind, index, type_int, iIndex, jIndex; … … 2479 2581 } 2480 2582 } 2583 CATCH 2481 2584 2482 2585 /*! … … 2485 2588 */ 2486 2589 void CDomain::recvDistributionAttributes(CEventServer& event) 2590 TRY 2487 2591 { 2488 2592 CBufferIn* buffer=event.subEvents.begin()->buffer; … … 2491 2595 get(domainId)->recvDistributionAttributes(*buffer); 2492 2596 } 2597 CATCH 2493 2598 2494 2599 /*! … … 2498 2603 */ 2499 2604 void CDomain::recvDistributionAttributes(CBufferIn& buffer) 2605 TRY 2500 2606 { 2501 2607 int ni_tmp, ibegin_tmp, nj_tmp, jbegin_tmp; … … 2513 2619 2514 2620 } 2621 CATCH_DUMP_ATTR 2515 2622 2516 2623 /*! … … 2519 2626 */ 2520 2627 void CDomain::recvMask(CEventServer& event) 2628 TRY 2521 2629 { 2522 2630 string domainId; … … 2532 2640 get(domainId)->recvMask(rankBuffers); 2533 2641 } 2534 2642 CATCH 2535 2643 2536 2644 /*! … … 2539 2647 */ 2540 2648 void CDomain::recvMask(std::map<int, CBufferIn*>& rankBuffers) 2649 TRY 2541 2650 { 2542 2651 int nbReceived = rankBuffers.size(), i, ind, index, lInd; … … 2582 2691 domainMask=mask_1d ; 2583 2692 } 2693 CATCH_DUMP_ATTR 2584 2694 2585 2695 /*! … … 2588 2698 */ 2589 2699 void CDomain::recvLon(CEventServer& event) 2700 TRY 2590 2701 { 2591 2702 string domainId; … … 2601 2712 get(domainId)->recvLon(rankBuffers); 2602 2713 } 2714 CATCH 2603 2715 2604 2716 /*! … … 2607 2719 */ 2608 2720 void CDomain::recvLon(std::map<int, CBufferIn*>& rankBuffers) 2721 TRY 2609 2722 { 2610 2723 int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; … … 2666 2779 } 2667 2780 } 2781 CATCH_DUMP_ATTR 2668 2782 2669 2783 /*! … … 2672 2786 */ 2673 2787 void CDomain::recvLat(CEventServer& event) 2788 TRY 2674 2789 { 2675 2790 string domainId; … … 2685 2800 get(domainId)->recvLat(rankBuffers); 2686 2801 } 2802 CATCH 2687 2803 2688 2804 /*! … … 2691 2807 */ 2692 2808 void CDomain::recvLat(std::map<int, CBufferIn*>& rankBuffers) 2809 TRY 2693 2810 { 2694 2811 int nbReceived = rankBuffers.size(), i, ind, index, iindex, jindex, lInd; … … 2752 2869 } 2753 2870 } 2871 CATCH_DUMP_ATTR 2754 2872 2755 2873 /*! … … 2758 2876 */ 2759 2877 void CDomain::recvArea(CEventServer& event) 2878 TRY 2760 2879 { 2761 2880 string domainId; … … 2771 2890 get(domainId)->recvArea(rankBuffers); 2772 2891 } 2892 CATCH 2773 2893 2774 2894 /*! … … 2777 2897 */ 2778 2898 void CDomain::recvArea(std::map<int, CBufferIn*>& rankBuffers) 2899 TRY 2779 2900 { 2780 2901 int nbReceived = rankBuffers.size(), i, ind, index, lInd; … … 2822 2943 } 2823 2944 } 2945 CATCH_DUMP_ATTR 2824 2946 2825 2947 /*! … … 2831 2953 */ 2832 2954 bool CDomain::isEqual(CDomain* obj) 2955 TRY 2833 2956 { 2834 2957 vector<StdString> excludedAttr; … … 2853 2976 return objEqual; 2854 2977 } 2978 CATCH_DUMP_ATTR 2855 2979 2856 2980 /*! … … 2859 2983 */ 2860 2984 void CDomain::recvDataIndex(CEventServer& event) 2985 TRY 2861 2986 { 2862 2987 string domainId; … … 2872 2997 get(domainId)->recvDataIndex(rankBuffers); 2873 2998 } 2999 CATCH 2874 3000 2875 3001 /*! … … 2883 3009 */ 2884 3010 void CDomain::recvDataIndex(std::map<int, CBufferIn*>& rankBuffers) 3011 TRY 2885 3012 { 2886 3013 int nbReceived = rankBuffers.size(), i, ind, index, indexI, indexJ, type_int, lInd; … … 2954 3081 data_jbegin.setValue(0); 2955 3082 } 3083 CATCH_DUMP_ATTR 2956 3084 2957 3085 CTransformation<CDomain>* CDomain::addTransformation(ETranformationType transType, const StdString& id) 3086 TRY 2958 3087 { 2959 3088 transformationMap_.push_back(std::make_pair(transType, CTransformation<CDomain>::createTransformation(transType,id))); 2960 3089 return transformationMap_.back().second; 2961 3090 } 3091 CATCH_DUMP_ATTR 2962 3092 2963 3093 /*! … … 2966 3096 */ 2967 3097 bool CDomain::hasTransformation() 3098 TRY 2968 3099 { 2969 3100 return (!transformationMap_.empty()); 2970 3101 } 3102 CATCH_DUMP_ATTR 2971 3103 2972 3104 /*! … … 2975 3107 */ 2976 3108 void CDomain::setTransformations(const TransMapTypes& domTrans) 3109 TRY 2977 3110 { 2978 3111 transformationMap_ = domTrans; 2979 3112 } 3113 CATCH_DUMP_ATTR 2980 3114 2981 3115 /*! … … 2984 3118 */ 2985 3119 CDomain::TransMapTypes CDomain::getAllTransformations(void) 3120 TRY 2986 3121 { 2987 3122 return transformationMap_; 2988 3123 } 3124 CATCH_DUMP_ATTR 2989 3125 2990 3126 void CDomain::duplicateTransformation(CDomain* src) 3127 TRY 2991 3128 { 2992 3129 if (src->hasTransformation()) … … 2995 3132 } 2996 3133 } 3134 CATCH_DUMP_ATTR 2997 3135 2998 3136 /*! … … 3000 3138 */ 3001 3139 void CDomain::solveInheritanceTransformation() 3140 TRY 3002 3141 { 3003 3142 if (hasTransformation() || !hasDirectDomainReference()) … … 3016 3155 refDomains[i]->setTransformations(domain->getAllTransformations()); 3017 3156 } 3157 CATCH_DUMP_ATTR 3018 3158 3019 3159 void CDomain::setContextClient(CContextClient* contextClient) 3160 TRY 3020 3161 { 3021 3162 if (clientsSet.find(contextClient)==clientsSet.end()) … … 3025 3166 } 3026 3167 } 3168 CATCH_DUMP_ATTR 3027 3169 3028 3170 /*! … … 3032 3174 */ 3033 3175 void CDomain::parse(xml::CXMLNode & node) 3176 TRY 3034 3177 { 3035 3178 SuperClass::parse(node); … … 3062 3205 } 3063 3206 } 3207 CATCH_DUMP_ATTR 3064 3208 //---------------------------------------------------------------- 3065 3209
Note: See TracChangeset
for help on using the changeset viewer.