Changeset 1624 for XIOS/branchs/xios-2.5/src/node/domain.cpp
- Timestamp:
- 12/14/18 11:20:33 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/branchs/xios-2.5/src/node/domain.cpp
r1565 r1624 33 33 , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 34 34 , globalLocalIndexMap_(), computedWrittenIndex_(false) 35 35 , clients() 36 36 { 37 37 } … … 45 45 , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 46 46 , globalLocalIndexMap_(), computedWrittenIndex_(false) 47 47 , clients() 48 48 { 49 49 } … … 160 160 // size estimation for sendIndex (and sendArea which is always smaller or equal) 161 161 size_t sizeIndexEvent = 2 * sizeof(size_t) + 2 * CArray<int,1>::size(idxCount); 162 // if (isCompressible_)163 // {164 // std::map<int, std::vector<int> >::const_iterator itWritten = indWrittenSrv_.find(rank);165 // size_t writtenIdxCount = (itWritten != itWrittenIndexEnd) ? itWritten->second.size() : 0;166 // sizeIndexEvent += CArray<int,1>::size(writtenIdxCount);167 // }168 162 169 163 // size estimation for sendLonLat … … 184 178 bool CDomain::isEmpty(void) const 185 179 { 186 return ((this->zoom_i_index.isEmpty()) || (0 == this->zoom_i_index.numElements())); 187 180 return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 188 181 } 189 182 … … 1455 1448 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 1456 1449 << "'bounds_lon_1d' dimension is not compatible with 'nvertex'." << std::endl 1457 << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent( 1)1450 << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(0) 1458 1451 << " but nvertex is " << nvertex.getValue() << "."); 1459 1452 … … 1462 1455 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 1463 1456 << "'bounds_lon_2d' dimension is not compatible with 'nvertex'." << std::endl 1464 << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent( 2)1457 << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(0) 1465 1458 << " but nvertex is " << nvertex.getValue() << "."); 1466 1459 … … 1479 1472 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 1480 1473 << "'bounds_lat_1d' dimension is not compatible with 'nvertex'." << std::endl 1481 << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent( 1)1474 << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(0) 1482 1475 << " but nvertex is " << nvertex.getValue() << "."); 1483 1476 … … 1486 1479 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 1487 1480 << "'bounds_lat_2d' dimension is not compatible with 'nvertex'." << std::endl 1488 << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent( 2)1481 << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(0) 1489 1482 << " but nvertex is " << nvertex.getValue() << "."); 1490 1483 … … 1901 1894 itSrve = writtenGlobalIndex.end(), itSrv; 1902 1895 1903 // for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)1904 // {1905 // indGlo = *itSrv;1906 // if (ite != globalLocalIndexMap_.find(indGlo))1907 // {1908 // ++nbWritten;1909 // }1910 // }1911 1912 // localIndexToWriteOnServer.resize(nbWritten);1913 1896 localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 1914 1915 1897 nbWritten = 0; 1916 1898 for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) … … 1920 1902 { 1921 1903 localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo]; 1922 ++nbWritten;1923 1904 } 1924 1905 else 1925 1906 { 1926 localIndexToWriteOnServer(nbWritten) = 0; 1927 ++nbWritten; 1928 } 1929 } 1930 1931 // if (isCompressible()) 1932 // { 1933 // nbWritten = 0; 1934 // boost::unordered_map<size_t,size_t> localGlobalIndexMap; 1935 // for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 1936 // { 1937 // indGlo = *itSrv; 1938 // if (ite != globalLocalIndexMap_.find(indGlo)) 1939 // { 1940 // localGlobalIndexMap[localIndexToWriteOnServer(nbWritten)] = indGlo; 1941 // ++nbWritten; 1942 // } 1943 // } 1944 1945 // nbWritten = 0; 1946 // for (int idx = 0; idx < data_i_index.numElements(); ++idx) 1947 // { 1948 // if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx))) 1949 // { 1950 // ++nbWritten; 1951 // } 1952 // } 1953 1954 // compressedIndexToWriteOnServer.resize(nbWritten); 1955 // nbWritten = 0; 1956 // for (int idx = 0; idx < data_i_index.numElements(); ++idx) 1957 // { 1958 // if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx))) 1959 // { 1960 // compressedIndexToWriteOnServer(nbWritten) = localGlobalIndexMap[data_i_index(idx)]; 1961 // ++nbWritten; 1962 // } 1963 // } 1964 1965 // numberWrittenIndexes_ = nbWritten; 1966 // if (isDistributed()) 1967 // { 1968 // MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 1969 // MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 1970 // offsetWrittenIndexes_ -= numberWrittenIndexes_; 1971 // } 1972 // else 1973 // totalNumberWrittenIndexes_ = numberWrittenIndexes_; 1974 // } 1907 localIndexToWriteOnServer(nbWritten) = -1; 1908 } 1909 ++nbWritten; 1910 } 1975 1911 } 1976 1912 … … 2510 2446 2511 2447 globalLocalIndexMap_.rehash(std::ceil(nbIndGlob/globalLocalIndexMap_.max_load_factor())); 2512 i_index.resize(nbIndGlob); 2513 j_index.resize(nbIndGlob); 2448 // i_index.resize(nbIndGlob); 2449 // j_index.resize(nbIndGlob); 2450 i_index.resize(ni*nj); 2451 j_index.resize(ni*nj); 2452 i_index = -1; 2453 j_index = -1; 2514 2454 int nbIndexGlobMax = nbIndGlob, nbIndLoc; 2515 2455 … … 2528 2468 jIndex = (jIndex < 0) ? 0 : jIndex; 2529 2469 nbIndLoc = iIndex + ni * jIndex; 2530 if (nbIndLoc < nbIndexGlobMax) 2531 { 2532 i_index(nbIndLoc) = index % ni_glo; 2533 j_index(nbIndLoc) = index / ni_glo; 2534 globalLocalIndexMap_[index] = nbIndLoc; 2535 ++nbIndGlob; 2536 } 2537 // i_index(nbIndGlob) = index % ni_glo; 2538 // j_index(nbIndGlob) = index / ni_glo; 2539 // globalLocalIndexMap_[index] = nbIndGlob; 2540 // ++nbIndGlob; 2470 i_index(nbIndLoc) = index % ni_glo; 2471 j_index(nbIndLoc) = index / ni_glo; 2472 globalLocalIndexMap_[index] = nbIndLoc; 2473 // i_index(nbIndGlob) = index % ni_glo; 2474 // j_index(nbIndGlob) = index / ni_glo; 2475 // globalLocalIndexMap_[index] = nbIndGlob; 2476 ++nbIndGlob; 2477 // if (nbIndLoc < nbIndexGlobMax) 2478 // { 2479 // i_index(nbIndLoc) = index % ni_glo; 2480 // j_index(nbIndLoc) = index / ni_glo; 2481 // globalLocalIndexMap_[index] = nbIndLoc; 2482 // ++nbIndGlob; 2483 // } 2484 // // i_index(nbIndGlob) = index % ni_glo; 2485 // // j_index(nbIndGlob) = index / ni_glo; 2486 // // globalLocalIndexMap_[index] = nbIndGlob; 2487 // // ++nbIndGlob; 2541 2488 } 2542 2489 } 2543 2490 } 2544 2491 2545 if (nbIndGlob==0)2546 {2547 i_index.resize(nbIndGlob);2548 j_index.resize(nbIndGlob);2549 }2550 else2551 {2552 i_index.resizeAndPreserve(nbIndGlob);2553 j_index.resizeAndPreserve(nbIndGlob);2554 }2492 // if (nbIndGlob==0) 2493 // { 2494 // i_index.resize(nbIndGlob); 2495 // j_index.resize(nbIndGlob); 2496 // } 2497 // else 2498 // { 2499 // i_index.resizeAndPreserve(nbIndGlob); 2500 // j_index.resizeAndPreserve(nbIndGlob); 2501 // } 2555 2502 } 2556 2503 … … 2661 2608 2662 2609 nbMaskInd = globalLocalIndexMap_.size(); 2663 mask_1d.resize(nbMaskInd); 2664 domainMask.resize(nbMaskInd); 2610 // mask_1d.resize(nbMaskInd); 2611 // domainMask.resize(nbMaskInd); 2612 mask_1d.resize(ni*nj); 2613 domainMask.resize(ni*nj); 2665 2614 mask_1d = false; 2666 2615 … … 2737 2686 2738 2687 nbLonInd = globalLocalIndexMap_.size(); 2739 lonvalue.resize(nbLonInd); 2688 // lonvalue.resize(nbLonInd); 2689 lonvalue.resize(ni*nj); 2690 lonvalue = -1.0; 2740 2691 if (hasBounds) 2741 2692 { 2742 bounds_lonvalue.resize(nvertex,nbLonInd); 2743 bounds_lonvalue = 0.; 2693 // bounds_lonvalue.resize(nvertex,nbLonInd); 2694 // bounds_lonvalue = 0.; 2695 bounds_lonvalue.resize(nvertex,ni*nj); 2696 bounds_lonvalue = -1.0; 2744 2697 } 2745 2698 … … 2821 2774 2822 2775 nbLatInd = globalLocalIndexMap_.size(); 2823 latvalue.resize(nbLatInd); 2776 // latvalue.resize(nbLatInd); 2777 latvalue.resize(ni*nj); 2824 2778 if (hasBounds) 2825 2779 { 2826 bounds_latvalue.resize(nvertex,nbLatInd); 2827 bounds_latvalue = 0. ; 2780 // bounds_latvalue.resize(nvertex,nbLatInd); 2781 // bounds_latvalue = 0. ; 2782 bounds_latvalue.resize(nvertex,ni*nj); 2783 bounds_latvalue = -1. ; 2828 2784 } 2829 2785 … … 2903 2859 2904 2860 nbAreaInd = globalLocalIndexMap_.size(); 2905 areavalue.resize(nbAreaInd); 2906 nbAreaInd = 0; 2861 // areavalue.resize(nbAreaInd); 2862 // nbAreaInd = 0; 2863 areavalue.resize(ni*nj); 2864 nbAreaInd = -1.0; 2907 2865 for (i = 0; i < nbReceived; ++i) 2908 2866 { … … 3015 2973 dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data 3016 2974 dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd); 3017 3018 if (!domainMask(lInd)) // Include mask info into data index on the RECEIVE getServerDimensionSizes3019 {3020 dataIIndex(lInd) = dataJIndex(lInd) = -1;3021 }3022 2975 } 3023 2976 }
Note: See TracChangeset
for help on using the changeset viewer.