- Timestamp:
- 11/05/18 13:57:52 (5 years ago)
- Location:
- XIOS/dev/dev_olga
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_olga/arch/arch-X64_IRENE.env
r1550 r1589 1 module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi 1 module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi gnu 2 module load gnu 2 3 module load mpi/openmpi/2.0.2 3 4 module load flavor/hdf5/parallel -
XIOS/dev/dev_olga/src/distribution_client.cpp
r1570 r1589 15 15 , axisDomainOrder_() 16 16 , nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_() 17 , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_() //, domainMasks_()//, axisMasks_()17 , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_() 18 18 , gridMask_(), indexMap_() 19 19 , isDataDistributed_(true), axisNum_(0), domainNum_(0) … … 61 61 // Then check mask of grid 62 62 int gridDim = domList.size() * 2 + axisList.size(); 63 // grid->checkMask();64 63 switch (gridDim) { 65 64 case 0: … … 117 116 axisDomainOrder_ = axisDomainOrder; 118 117 119 // // Each domain or axis has its mask, of course120 // domainMasks_.resize(domainNum_);121 // for (int i = 0; i < domainNum_;++i)122 // {123 // domainMasks_[i].resize(domList[i]->domainMask.numElements());124 // domainMasks_[i] = domList[i]->domainMask;125 // }126 127 // axisMasks_.resize(axisNum_);128 // for (int i = 0; i < axisNum_; ++i)129 // {130 // axisMasks_[i].resize(axisList[i]->mask.numElements());131 // axisMasks_[i] = axisList[i]->mask;132 // }133 134 118 // Because domain and axis can be in any order (axis1, domain1, axis2, axis3, ) 135 119 // their position should be specified. In axisDomainOrder, domain == true, axis == false … … 283 267 if ((iIdx >= nBeginLocal_[indexMap_[i]]) && (iIdx < nLocal_[indexMap_[i]]) && 284 268 (jIdx >= nBeginLocal_[indexMap_[i]+1]) && (jIdx < nLocal_[indexMap_[i]+1])) 285 // && (domainMasks_[idxDomain](iIdx + jIdx*nLocal_[indexMap_[i]])))286 269 { 287 270 ++count; … … 413 396 414 397 for (int i = 0; i < numElement_; ++i) ssize *= eachElementSize[i]; 415 // while (idx < ssize)416 // {417 // for (int i = 0; i < numElement_-1; ++i)418 // {419 // if (idxLoop[i] == eachElementSize[i])420 // {421 // idxLoop[i] = 0;422 // ++idxLoop[i+1];423 // }424 // }425 //426 // // Find out outer index427 // // Depending the inner-most element is axis or domain,428 // // The outer loop index begins correspondingly at one (1) or zero (0)429 // for (int i = 1; i < numElement_; ++i)430 // {431 // currentIndex[i] = elementLocalIndex_[i](idxLoop[i]);432 // }433 //434 // // Inner most index435 // for (int i = 0; i < innerLoopSize; ++i)436 // {437 // int gridMaskIndex = 0;438 // currentIndex[0] = elementLocalIndex_[0](i);439 //440 // bool maskTmp = true;441 // int idxDomain = 0, idxAxis = 0;442 // for (int elem = 0; elem < numElement_; ++elem)443 // {444 // if (2 == axisDomainOrder_(elem))445 // {446 // maskTmp = maskTmp && domainMasks_[idxDomain](currentIndex[elem]);447 // ++idxDomain;448 // }449 // else if (1 == axisDomainOrder_(elem))450 // {451 // maskTmp = maskTmp && axisMasks_[idxAxis](currentIndex[elem]);452 // ++idxAxis;453 // }454 // }455 // if (maskTmp) ++indexLocalDataOnClientCount;456 // }457 // idxLoop[0] += innerLoopSize;458 // idx += innerLoopSize;459 // }460 461 // Now allocate these arrays462 // localDataIndex_.resize(indexLocalDataOnClientCount);463 // localMaskIndex_.resize(indexLocalDataOnClientCount);464 // localMaskedDataIndex_.resize(indexLocalDataOnClientCount);465 // globalDataIndex_.rehash(std::ceil(indexLocalDataOnClientCount/globalDataIndex_.max_load_factor()));466 // globalLocalDataSendToServerMap_.rehash(std::ceil(indexLocalDataOnClientCount/globalLocalDataSendToServerMap_.max_load_factor()));467 398 468 399 localDataIndex_.resize(ssize); … … 530 461 bool maskTmp = true; 531 462 bool maskGridTmp = true; 532 533 // // Domain or axis mask: only unmasked values will be sent 534 // int idxDomain = 0, idxAxis = 0; 535 // for (int elem = 0; elem < numElement_; ++elem) 536 // { 537 // if (2 == axisDomainOrder_(elem)) 538 // { 539 // maskTmp = maskTmp && domainMasks_[idxDomain](currentIndex[elem]); 540 // ++idxDomain; 541 // } 542 // else if (1 == axisDomainOrder_(elem)) 543 // { 544 // maskTmp = maskTmp && axisMasks_[idxAxis](currentIndex[elem]); 545 // ++idxAxis; 546 // } 547 // } 548 549 // if (maskTmp) 550 // { 551 size_t globalIndex = 0; 552 for (int k = 0; k < numElement_; ++k) 553 { 554 globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k]; 555 } 556 globalDataIndex_[globalIndex] = indexLocalDataOnClientCount; 557 localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 558 globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount; 559 localMaskedDataIndex_[indexLocalDataOnClientCount] = indexLocalDataOnClientCount; 560 // } 463 size_t globalIndex = 0; 464 for (int k = 0; k < numElement_; ++k) 465 { 466 globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k]; 467 } 468 globalDataIndex_[globalIndex] = indexLocalDataOnClientCount; 469 localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 470 globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount; 471 localMaskedDataIndex_[indexLocalDataOnClientCount] = indexLocalDataOnClientCount; 561 472 562 473 // Grid mask: unmasked values will be replaces by NaN and then all values will be sent -
XIOS/dev/dev_olga/src/distribution_client.hpp
r1570 r1589 118 118 std::vector<CArray<int,1> > infoIndex_; //!< i_index, j_index 119 119 120 // std::vector<CArray<bool,1> > domainMasks_; //!< Domain mask121 // std::vector<CArray<bool,1> > axisMasks_; //!< Axis mask122 123 120 std::vector<int> indexMap_; //!< Mapping element index to dimension index 124 121 std::vector<CArray<int,1> > elementLocalIndex_; //!< Local index of each element … … 185 182 } // namespace xios 186 183 #endif // __XIOS_DISTRIBUTIONCLIENT_HPP__ 187 -
XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp
r1584 r1589 68 68 onOutputReady(outputPacket); 69 69 } 70 71 72 73 74 70 75 71 CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount) … … 201 197 const std::list<CGridTransformation::RecvIndexGridDestinationMap>& listLocalIndexToReceive = gridTransformation->getLocalIndexToReceiveOnGridDest(); 202 198 const std::list<size_t>& listNbLocalIndexToReceive = gridTransformation->getNbLocalIndexToReceiveOnGridDest(); 203 // const std::list<std::vector<bool> >& listLocalIndexMaskOnDest = gridTransformation->getLocalMaskIndexOnGridDest();204 199 const std::vector<CGenericAlgorithmTransformation*>& listAlgos = gridTransformation->getAlgos(); 205 200 … … 210 205 std::list<CGridTransformation::RecvIndexGridDestinationMap>::const_iterator itListRecv = listLocalIndexToReceive.begin(); 211 206 std::list<size_t>::const_iterator itNbListRecv = listNbLocalIndexToReceive.begin(); 212 // std::list<std::vector<bool> >::const_iterator itLocalMaskIndexOnDest = listLocalIndexMaskOnDest.begin();213 207 std::vector<CGenericAlgorithmTransformation*>::const_iterator itAlgo = listAlgos.begin(); 214 208 215 // for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itLocalMaskIndexOnDest, ++itAlgo)216 209 for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itAlgo) 217 210 { … … 268 261 dataCurrentDest.resize(*itNbListRecv); 269 262 dataCurrentDest = 0.0; 270 // const std::vector<bool>& localMaskDest = *itLocalMaskIndexOnDest;271 // for (int i = 0; i < localMaskDest.size(); ++i)272 // if (localMaskDest[i]) dataCurrentDest(i) = 0.0;273 // else dataCurrentDest(i) = defaultValue;274 263 275 264 std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true); -
XIOS/dev/dev_olga/src/io/nc4_data_input.cpp
r1577 r1589 494 494 domain->ni_glo.setValue(itMapNi->second); 495 495 } 496 497 // determine if coordinates values are present in file 498 if ((CDomain::type_attr::rectilinear == domain->type)) 499 { 500 // Ok, try to read some attributes such as longitude and latitude 501 domain->hasLatInReadFile_ = SuperClassWriter::hasVariable(itMapNj->first); 502 domain->hasLonInReadFile_ = SuperClassWriter::hasVariable(itMapNi->first); 503 } 504 else if ((CDomain::type_attr::curvilinear == domain->type) || (CDomain::type_attr::unstructured == domain->type) ) 505 { 506 StdString latName = this->getLatCoordName(fieldId); 507 domain->hasLatInReadFile_ = SuperClassWriter::hasVariable(latName) ; 508 StdString lonName = this->getLonCoordName(fieldId); 509 domain->hasLonInReadFile_ = SuperClassWriter::hasVariable(lonName) ; 510 StdString boundsLatName = this->getBoundsId(latName); 511 domain->hasBoundsLatInReadFile_ = SuperClassWriter::hasVariable(boundsLatName) ; 512 StdString boundsLonName = this->getBoundsId(lonName); 513 domain->hasBoundsLonInReadFile_ = SuperClassWriter::hasVariable(boundsLonName) ; 514 } 496 515 } 497 516 -
XIOS/dev/dev_olga/src/io/nc4_data_output.cpp
r1571 r1589 166 166 for (int idx = 0; idx < nbWritten; ++idx) 167 167 { 168 if (indexToWrite(idx) < 0) 169 { 170 writtenLat(idx) = -1.; // hole 171 writtenLon(idx) = -1.; 172 } 173 else 174 { 175 writtenLat(idx) = domain->latvalue(indexToWrite(idx)); 176 writtenLon(idx) = domain->lonvalue(indexToWrite(idx)); 177 } 178 } 179 168 if (indexToWrite(idx) < 0) 169 { 170 writtenLat(idx) = -1.; // hole 171 writtenLon(idx) = -1.; 172 } 173 else 174 { 175 writtenLat(idx) = domain->latvalue(indexToWrite(idx)); 176 writtenLon(idx) = domain->lonvalue(indexToWrite(idx)); 177 } 178 } 180 179 181 180 if (domain->hasBounds) … … 999 998 for (int idx = 0; idx < nbWritten; ++idx) 1000 999 { 1001 1002 writtenArea(idx) = -1.;1003 1004 1000 if (indexToWrite(idx) < 0) 1001 writtenArea(idx) = -1.; 1002 else 1003 writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 1005 1004 } 1006 1005 } … … 1329 1328 axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 1330 1329 axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 1331 1332 1330 } 1333 1331 } -
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 -
XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.cpp
r1584 r1589 846 846 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, 847 847 int nlocalIndexDest) 848 849 //void CGenericAlgorithmTransformation::computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst,850 // vector<int>& localSrc, vector<int>& localDst, vector<double>& weight,851 // vector<bool>& localMaskOnGridDest)852 848 { 853 849 … … 985 981 } 986 982 987 // just get the local src mask988 // CArray<bool,1> localMaskOnSrcGrid;989 // gridSrc->getLocalMask(localMaskOnSrcGrid) ;990 // intermediate grid, mask is not initialized => set up mask to true991 // if (localMaskOnSrcGrid.isEmpty())992 // {993 // localMaskOnSrcGrid.resize(nlocalIndexSrc) ;994 // localMaskOnSrcGrid=true ;995 // }996 997 998 // localMaskOnGridDest.resize(nlocalIndexDest,false) ;999 1000 983 vector<vector<vector<pair<int,double> > > > dstIndWeight(transformationMapping_.size()) ; 1001 984 … … 1038 1021 int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 1039 1022 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight) 1040 // CArray<bool,1>& localMaskOnGridSrc1041 // , vector<bool>& localMaskOnGridDest )1042 1023 { 1043 1024 int masked_ ; … … 1052 1033 masked_=masked ; 1053 1034 if (!mask(i)) masked_=false ; 1054 // nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ;1055 1035 nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, 1056 dstIndWeight, currentInd, localSrc, localDst, weight); //, localMaskOnGridDest) ;1036 dstIndWeight, currentInd, localSrc, localDst, weight); 1057 1037 } 1058 1038 } … … 1068 1048 for(vector<pair<int,double> >::iterator it = dstIndWeight[t][currentInd].begin(); it!=dstIndWeight[t][currentInd].end(); ++it) 1069 1049 { 1070 // if (localMaskOnGridSrc(srcInd)) 1071 { 1072 localSrc.push_back(srcIndCompressed) ; 1073 localDst.push_back(it->first) ; 1074 weight.push_back(it->second) ; 1075 // localMaskOnGridDest[it->first]=true ; 1076 } 1050 localSrc.push_back(srcIndCompressed) ; 1051 localDst.push_back(it->first) ; 1052 weight.push_back(it->second) ; 1077 1053 (it->first)++ ; 1078 1054 } 1079 1055 } 1080 1056 if (t < dstIndWeight.size()-1) t++ ; 1081 // if (localMaskOnGridSrc(srcInd))1082 1057 srcIndCompressed ++ ; 1083 1058 } … … 1100 1075 nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, 1101 1076 srcIndCompressed, nIndexSrc, t, dstIndWeight , i, localSrc, localDst, weight); 1102 // localMaskOnGridSrc,1103 // localMaskOnGridDest) ;1104 1077 } 1105 1078 } … … 1115 1088 for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it) 1116 1089 { 1117 // if (localMaskOnGridSrc(srcInd)) 1118 { 1119 localSrc.push_back(srcIndCompressed) ; 1120 localDst.push_back(it->first) ; 1121 weight.push_back(it->second) ; 1122 // localMaskOnGridDest[it->first]=true ; 1123 } 1090 localSrc.push_back(srcIndCompressed) ; 1091 localDst.push_back(it->first) ; 1092 weight.push_back(it->second) ; 1124 1093 (it->first)++ ; 1125 1094 } 1126 1095 } 1127 1096 if (t < dstIndWeight.size()-1) t++ ; 1128 // if (localMaskOnGridSrc(srcInd)) 1129 srcIndCompressed ++ ; 1097 srcIndCompressed ++ ; 1130 1098 } 1131 1099 srcInd++ ; … … 1135 1103 1136 1104 } 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1105 1148 1106 /*! -
XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.hpp
r1584 r1589 91 91 void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 92 92 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, int nbLocalIndexOnGridDest); 93 // void nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,94 // vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, CArray<bool,1>& localMaskOnGridSrc, vector<bool>& localMaskOnGridDest) ;95 // void nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst,96 // int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc,97 // int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd,98 // vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest) ;99 93 void nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid, vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, 100 94 int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, -
XIOS/dev/dev_olga/src/transformation/grid_transformation.cpp
r1584 r1589 346 346 std::list<RecvIndexGridDestinationMap>().swap(localIndexToReceiveOnGridDest_); 347 347 std::list<size_t>().swap(nbLocalIndexOnGridDest_); 348 // std::list<std::vector<bool> >().swap(localMaskOnGridDest_);349 348 } 350 349 else … … 400 399 vector<double> weight ; 401 400 int nbLocalIndexOnGridDest; 402 // localMaskOnGridDest_.push_back(vector<bool>()) ;403 401 CTimer::get("computeTransformationMappingNonDistributed").resume(); 404 402 // algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_, … … 409 407 410 408 CTimer::get("computeTransformationMappingConvert").resume(); 411 // nbLocalIndexOnGridDest_.push_back(localMaskOnGridDest_.back().size()) ;412 // nbLocalIndexOnGridDest_.push_back(localMaskOnGridDest_.back().size()) ;413 409 nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ; 414 410 int clientRank=client->clientRank ; … … 662 658 recvTmp[recvRank][realRecvSize].first = globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]; 663 659 recvTmp[recvRank][realRecvSize].second = recvWeightDst(idx); 664 // tmpMask[globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]] = true;665 660 ++realRecvSize; 666 661 } … … 715 710 } 716 711 717 /*! 718 Local mask of data which will be received on the grid destination 719 \return local mask of data 720 */ 721 //const std::list<std::vector<bool> >& CGridTransformation::getLocalMaskIndexOnGridDest() const 722 //{ 723 // return localMaskOnGridDest_; 724 //} 725 726 } 712 } -
XIOS/dev/dev_olga/src/transformation/grid_transformation.hpp
r1584 r1589 49 49 const std::list<RecvIndexGridDestinationMap>& getLocalIndexToReceiveOnGridDest() const; 50 50 const std::list<size_t>& getNbLocalIndexToReceiveOnGridDest() const; 51 // const std::list<std::vector<bool> >& getLocalMaskIndexOnGridDest() const;52 51 53 52 CGrid* getGridSource() { return originalGridSource_; } … … 84 83 //! Number of local index of data to receive on grid destination 85 84 std::list<size_t> nbLocalIndexOnGridDest_; 86 // std::list<std::vector<bool> > localMaskOnGridDest_;87 85 88 86 bool dynamicalTransformation_;
Note: See TracChangeset
for help on using the changeset viewer.