Changeset 1589 for XIOS/dev/dev_olga/src/node
- Timestamp:
- 11/05/18 13:57:52 (6 years ago)
- Location:
- XIOS/dev/dev_olga/src/node
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/src/node/axis.cpp
r1576 r1589 696 696 CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(), 697 697 itSrve = writtenGlobalIndex.end(), itSrv; 698 // for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)699 // {700 // indGlo = *itSrv;701 // if (ite != globalLocalIndexMap_.find(indGlo))702 // {703 // ++nbWritten;704 // }705 // }706 698 707 699 localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 708 // localIndexToWriteOnServer.resize(nbWritten);709 710 700 nbWritten = 0; 711 701 for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) … … 1033 1023 list<CMessage> listData; 1034 1024 list<CArray<int,1> > list_indi, list_dataInd; 1035 list<CArray<bool,1> > list_mask;1036 1025 list<CArray<double,1> > list_val; 1037 1026 list<CArray<double,2> > list_bounds; … … 1060 1049 list_indi.push_back(CArray<int,1>(nbData)); 1061 1050 list_dataInd.push_back(CArray<int,1>(nbData)); 1062 list_mask.push_back(CArray<bool,1>(nbData));1063 1051 1064 1052 if (hasValue) … … 1074 1062 CArray<int,1>& dataIndi = list_dataInd.back(); 1075 1063 dataIndi = -1; 1076 CArray<bool,1>& maskIndi = list_mask.back();1077 1064 1078 1065 for (int n = 0; n < nbData; ++n) … … 1083 1070 ind = globalLocalIndexMap_[idx]; 1084 1071 dataIndi(n) = dataIndex(ind); 1085 // maskIndi(n) = mask(ind);1086 1072 1087 1073 if (hasValue) … … 1107 1093 listData.push_back(CMessage()); 1108 1094 listData.back() << this->getId() 1109 << list_indi.back() << list_dataInd.back(); //<< list_mask.back();1095 << list_indi.back() << list_dataInd.back(); 1110 1096 1111 1097 listData.back() << hasValue; … … 1168 1154 buffer >> vec_indi[idx]; 1169 1155 buffer >> vec_dataInd[idx]; 1170 // buffer >> vec_mask[idx];1171 1156 1172 1157 buffer >> hasValue; … … 1205 1190 if (0 == globalLocalIndexMap_.count(gloInd)) 1206 1191 { 1207 // index(nbIndLoc) = gloInd % n_glo;1208 // globalLocalIndexMap_[gloInd] = nbIndLoc;1209 // ++nbIndexGlob;1210 1192 index(nbIndexGlob) = gloInd % n_glo; 1211 1193 globalLocalIndexMap_[gloInd] = nbIndexGlob; … … 1222 1204 CArray<int,1> nonCompressedData(nbData); 1223 1205 nonCompressedData = -1; 1224 // mask.resize(nbData);1225 // mask = true;1226 1206 // Mask is incorporated into data_index and is not sent/received anymore 1227 1207 mask.resize(0); … … 1238 1218 CArray<int,1>& indi = vec_indi[idx]; 1239 1219 CArray<int,1>& dataIndi = vec_dataInd[idx]; 1240 // CArray<bool,1>& maskIndi = vec_mask[idx];1241 1220 int nb = indi.numElements(); 1242 1221 for (int n = 0; n < nb; ++n) … … 1246 1225 nonCompressedData(locInd) = (-1 == nonCompressedData(locInd)) ? dataIndi(n) : nonCompressedData(locInd); 1247 1226 1248 // if (!mask(locInd)) // Only rewrite mask if it's not true1249 // mask(locInd) = maskIndi(n);1250 1251 1227 if (hasValue) 1252 1228 value(locInd) = vec_val[idx](n); -
XIOS/dev/dev_olga/src/node/axis.hpp
r1571 r1589 114 114 void computeWrittenIndex(); 115 115 void computeWrittenCompressedIndex(MPI_Comm); 116 117 template <class T> void outputAxis(CArray<T,1>& valueIn, CArray<T,1>& valueOut);118 119 116 bool hasTransformation(); 120 117 void solveInheritanceTransformation(); … … 129 126 bool hasLabel; 130 127 131 // CArray<size_t,1> localIndexToWriteOnServer;132 128 CArray<int,1> localIndexToWriteOnServer; 133 CArray<size_t,1> localIndexToWriteOnClient;134 129 135 130 private: … … 188 183 }; // class CAxis 189 184 190 ///--------------------------------------------------------------191 192 template <class T> void CAxis::outputAxis(CArray<T,1>& valueIn, CArray<T,1>& valueOut)193 {194 int sizeServer = localIndexToWriteOnServer.numElements();195 int sizeClient = localIndexToWriteOnClient.numElements();196 valueOut.resize(sizeClient);197 198 if (sizeServer == sizeClient)199 {200 valueOut = valueIn;201 }202 else203 // a hole204 {205 valueOut = valueIn;206 //valueOut = -1; initialize here to some value ????207 }208 // CArray<size_t,1>& outIndexClient = grid->localIndexToWriteOnClient;209 // CArray<size_t,1>& outIndexServer = grid->localIndexToWriteOnServer;210 // for (size_t idx = 0; idx < outIndexServer.numElements(); ++idx)211 // {212 // fieldOut(outIndexServer(idx)) = recvDataSrv(outIndexClient(idx));213 // }214 }215 216 185 // Declare/Define CAxisGroup and CAxisDefinition 217 186 DECLARE_GROUP(CAxis); -
XIOS/dev/dev_olga/src/node/domain.cpp
r1576 r1589 33 33 , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 34 34 , globalLocalIndexMap_(), computedWrittenIndex_(false) 35 , clients() 35 , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false) 36 , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false) 36 37 { 37 38 } … … 45 46 , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 46 47 , globalLocalIndexMap_(), computedWrittenIndex_(false) 47 , clients() 48 , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false) 49 , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false) 48 50 { 49 51 } … … 161 163 // size estimation for sendIndex (and sendArea which is always smaller or equal) 162 164 size_t sizeIndexEvent = 2 * sizeof(size_t) + 2 * CArray<int,1>::size(idxCount); 163 // if (isCompressible_)164 // {165 // std::map<int, std::vector<int> >::const_iterator itWritten = indWrittenSrv_.find(rank);166 // size_t writtenIdxCount = (itWritten != itWrittenIndexEnd) ? itWritten->second.size() : 0;167 // sizeIndexEvent += CArray<int,1>::size(writtenIdxCount);168 // }169 165 170 166 // size estimation for sendLonLat … … 1908 1904 itSrve = writtenGlobalIndex.end(), itSrv; 1909 1905 1910 // for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)1911 // {1912 // indGlo = *itSrv;1913 // if (ite != globalLocalIndexMap_.find(indGlo))1914 // {1915 // ++nbWritten;1916 // }1917 // }1918 1919 // localIndexToWriteOnServer.resize(nbWritten);1920 1906 localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 1921 1922 1907 nbWritten = 0; 1923 1908 for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) … … 1934 1919 ++nbWritten; 1935 1920 } 1936 1937 // if (isCompressible())1938 // {1939 // nbWritten = 0;1940 // std::unordered_map<size_t,size_t> localGlobalIndexMap;1941 // for (itSrv = itSrvb; itSrv != itSrve; ++itSrv)1942 // {1943 // indGlo = *itSrv;1944 // if (ite != globalLocalIndexMap_.find(indGlo))1945 // {1946 // localGlobalIndexMap[localIndexToWriteOnServer(nbWritten)] = indGlo;1947 // ++nbWritten;1948 // }1949 // }1950 1951 // nbWritten = 0;1952 // for (int idx = 0; idx < data_i_index.numElements(); ++idx)1953 // {1954 // if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx)))1955 // {1956 // ++nbWritten;1957 // }1958 // }1959 1960 // compressedIndexToWriteOnServer.resize(nbWritten);1961 // nbWritten = 0;1962 // for (int idx = 0; idx < data_i_index.numElements(); ++idx)1963 // {1964 // if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx)))1965 // {1966 // compressedIndexToWriteOnServer(nbWritten) = localGlobalIndexMap[data_i_index(idx)];1967 // ++nbWritten;1968 // }1969 // }1970 1971 // numberWrittenIndexes_ = nbWritten;1972 // if (isDistributed())1973 // {1974 // MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);1975 // MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm);1976 // offsetWrittenIndexes_ -= numberWrittenIndexes_;1977 // }1978 // else1979 // totalNumberWrittenIndexes_ = numberWrittenIndexes_;1980 // }1981 1921 } 1982 1922 … … 2533 2473 jIndex = (jIndex < 0) ? 0 : jIndex; 2534 2474 nbIndLoc = iIndex + ni * jIndex; 2535 // if (nbIndLoc < nbIndexGlobMax) // THIS CONDITION IMPEDES THE CASE OF A HOLE 2536 // { 2537 // i_index(nbIndLoc) = index % ni_glo; 2538 // j_index(nbIndLoc) = index / ni_glo; 2539 // globalLocalIndexMap_[index] = nbIndLoc; 2540 // ++nbIndGlob; 2541 // } 2542 i_index(nbIndGlob) = index % ni_glo; 2543 j_index(nbIndGlob) = index / ni_glo; 2544 globalLocalIndexMap_[index] = nbIndGlob; 2545 ++nbIndGlob; 2475 i_index(nbIndGlob) = index % ni_glo; 2476 j_index(nbIndGlob) = index / ni_glo; 2477 globalLocalIndexMap_[index] = nbIndGlob; 2478 ++nbIndGlob; 2546 2479 } 2547 2480 } … … 3001 2934 dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data 3002 2935 dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd); 3003 3004 // if (!domainMask(lInd)) // Include mask info into data index on the RECEIVE getServerDimensionSizes3005 // {3006 // dataIIndex(lInd) = dataJIndex(lInd) = -1;3007 // }3008 2936 } 3009 2937 } -
XIOS/dev/dev_olga/src/node/domain.hpp
r1571 r1589 151 151 bool hasLonLat; 152 152 bool hasPole ; 153 bool hasLatInReadFile_ ; // specify if latitude is defined on read file, so it can be read later when grid distribution will be defined 154 bool hasBoundsLatInReadFile_ ; // specify if latitude boundarues are defined on read file, so it can be read later when grid distribution will be defined 155 bool hasLonInReadFile_ ; // specify if longitude is defined on read file, so it can be read later when grid distribution will be defined 156 bool hasBoundsLonInReadFile_ ; // specify if longitude boundaries are defined on read file, so it can be read later when grid distribution will be defined 153 157 154 158 void computeLocalMask(void) ; -
XIOS/dev/dev_olga/src/node/grid.cpp
r1584 r1589 423 423 } 424 424 } 425 426 427 /*!428 A grid can have multiple dimension, so can its mask in the form of multi-dimension array.429 It's not a good idea to store all multi-dimension arrays corresponding to each mask.430 One of the ways is to convert this array into 1-dimension one and every process is taken place on it.431 \param [in] multi-dimension array grid mask432 */433 434 // void CGrid::getLocalMask(CArray<bool,1>& localMask)435 // {436 // std::vector<CDomain*> domainP = this->getDomains();437 // std::vector<CAxis*> axisP = this->getAxis();438 // int dim = domainP.size() * 2 + axisP.size();439 //440 // switch (dim)441 // {442 // case 0:443 // getLocalMask(mask_0d, localMask);444 // break;445 // case 1:446 // getLocalMask(mask_1d, localMask);447 // break;448 // case 2:449 // getLocalMask(mask_2d, localMask);450 // break;451 // case 3:452 // getLocalMask(mask_3d, localMask);453 // break;454 // case 4:455 // getLocalMask(mask_4d, localMask);456 // break;457 // case 5:458 // getLocalMask(mask_5d, localMask);459 // break;460 // case 6:461 // getLocalMask(mask_6d, localMask);462 // break;463 // case 7:464 // getLocalMask(mask_7d, localMask);465 // break;466 // default:467 // break;468 // }469 // }470 425 471 426 /* … … 1788 1743 nGlob.push_back(1); 1789 1744 } 1790 1791 // modifyMaskSize(nSize, false);1792 // modifyMaskSize(nSize, true); // Grid mask should be gone beyond client source filter1793 //1794 // // These below codes are reserved for future1795 // CDistributionServer srvDist(server->intraCommRank, nBegin, nSize, nBeginGlobal, nGlob);1796 // map<int, CArray<size_t, 1> >::iterator itb = outGlobalIndexFromClient.begin(),1797 // ite = outGlobalIndexFromClient.end(), it;1798 // const CDistributionServer::GlobalLocalMap& globalLocalMask = srvDist.getGlobalLocalIndex();1799 // CDistributionServer::GlobalLocalMap::const_iterator itSrv;1800 // size_t nb = 0;1801 // for (it = itb; it != ite; ++it)1802 // {1803 // CArray<size_t,1>& globalInd = it->second;1804 // for (size_t idx = 0; idx < globalInd.numElements(); ++idx)1805 // {1806 // if (globalLocalMask.end() != globalLocalMask.find(globalInd(idx))) ++nb;1807 // }1808 // }1809 //1810 // CArray<int,1> indexToModify(nb);1811 // nb = 0;1812 // for (it = itb; it != ite; ++it)1813 // {1814 // CArray<size_t,1>& globalInd = it->second;1815 // for (size_t idx = 0; idx < globalInd.numElements(); ++idx)1816 // {1817 // itSrv = globalLocalMask.find(globalInd(idx));1818 // if (globalLocalMask.end() != itSrv)1819 // {1820 // indexToModify(nb) = itSrv->second;1821 // ++nb;1822 // }1823 // }1824 // }1825 1826 // modifyMask(indexToModify, true);1827 1745 } 1828 1746
Note: See TracChangeset
for help on using the changeset viewer.