Changeset 1589 for XIOS


Ignore:
Timestamp:
11/05/18 13:57:52 (5 years ago)
Author:
oabramkina
Message:

Backporting r1578 and r1586 to dev, cleaning the code before merging it to XIOS 2.5.

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 
     1module unload netcdf-c netcdf-fortran hdf5 flavor perl hdf5 boost blitz mpi gnu 
     2module load gnu 
    23module load mpi/openmpi/2.0.2 
    34module load flavor/hdf5/parallel 
  • XIOS/dev/dev_olga/src/distribution_client.cpp

    r1570 r1589  
    1515   , axisDomainOrder_() 
    1616   , nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_() 
    17    , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_()//, domainMasks_()//, axisMasks_() 
     17   , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_() 
    1818   , gridMask_(), indexMap_() 
    1919   , isDataDistributed_(true), axisNum_(0), domainNum_(0) 
     
    6161  // Then check mask of grid 
    6262  int gridDim = domList.size() * 2 + axisList.size(); 
    63 //  grid->checkMask(); 
    6463  switch (gridDim) { 
    6564    case 0: 
     
    117116  axisDomainOrder_ = axisDomainOrder; 
    118117 
    119 //  // Each domain or axis has its mask, of course 
    120 //  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  
    134118  // Because domain and axis can be in any order (axis1, domain1, axis2, axis3, ) 
    135119  // their position should be specified. In axisDomainOrder, domain == true, axis == false 
     
    283267        if ((iIdx >= nBeginLocal_[indexMap_[i]]) && (iIdx < nLocal_[indexMap_[i]]) && 
    284268           (jIdx >= nBeginLocal_[indexMap_[i]+1]) && (jIdx < nLocal_[indexMap_[i]+1])) 
    285 //           && (domainMasks_[idxDomain](iIdx + jIdx*nLocal_[indexMap_[i]]))) 
    286269        { 
    287270          ++count; 
     
    413396 
    414397  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 index 
    427 //    // 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 index 
    435 //    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 arrays 
    462 //  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())); 
    467398 
    468399  localDataIndex_.resize(ssize); 
     
    530461          bool maskTmp = true; 
    531462          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; 
    561472 
    562473          // 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  
    118118    std::vector<CArray<int,1> > infoIndex_; //!< i_index, j_index 
    119119 
    120 //    std::vector<CArray<bool,1> > domainMasks_; //!< Domain mask 
    121 //    std::vector<CArray<bool,1> > axisMasks_; //!< Axis mask 
    122  
    123120    std::vector<int> indexMap_; //!< Mapping element index to dimension index 
    124121    std::vector<CArray<int,1> > elementLocalIndex_;  //!< Local index of each element 
     
    185182} // namespace xios 
    186183#endif // __XIOS_DISTRIBUTIONCLIENT_HPP__ 
    187  
  • XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp

    r1584 r1589  
    6868      onOutputReady(outputPacket); 
    6969  } 
    70  
    71  
    72  
    73  
    7470 
    7571  CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount) 
     
    201197    const std::list<CGridTransformation::RecvIndexGridDestinationMap>& listLocalIndexToReceive = gridTransformation->getLocalIndexToReceiveOnGridDest(); 
    202198    const std::list<size_t>& listNbLocalIndexToReceive = gridTransformation->getNbLocalIndexToReceiveOnGridDest(); 
    203 //    const std::list<std::vector<bool> >& listLocalIndexMaskOnDest = gridTransformation->getLocalMaskIndexOnGridDest(); 
    204199    const std::vector<CGenericAlgorithmTransformation*>& listAlgos = gridTransformation->getAlgos(); 
    205200 
     
    210205    std::list<CGridTransformation::RecvIndexGridDestinationMap>::const_iterator itListRecv = listLocalIndexToReceive.begin(); 
    211206    std::list<size_t>::const_iterator itNbListRecv = listNbLocalIndexToReceive.begin(); 
    212 //    std::list<std::vector<bool> >::const_iterator itLocalMaskIndexOnDest = listLocalIndexMaskOnDest.begin(); 
    213207    std::vector<CGenericAlgorithmTransformation*>::const_iterator itAlgo = listAlgos.begin(); 
    214208 
    215 //    for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itLocalMaskIndexOnDest, ++itAlgo) 
    216209    for (; itListSend != iteListSend; ++itListSend, ++itListRecv, ++itNbListRecv, ++itAlgo) 
    217210    { 
     
    268261      dataCurrentDest.resize(*itNbListRecv); 
    269262      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; 
    274263 
    275264      std::vector<bool> localInitFlag(dataCurrentDest.numElements(), true); 
  • XIOS/dev/dev_olga/src/io/nc4_data_input.cpp

    r1577 r1589  
    494494      domain->ni_glo.setValue(itMapNi->second); 
    495495    } 
     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    } 
    496515  } 
    497516 
  • XIOS/dev/dev_olga/src/io/nc4_data_output.cpp

    r1571 r1589  
    166166           for (int idx = 0; idx < nbWritten; ++idx) 
    167167           { 
    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           } 
    180179 
    181180           if (domain->hasBounds) 
     
    999998           for (int idx = 0; idx < nbWritten; ++idx) 
    1000999           { 
    1001                   if (indexToWrite(idx) < 0) 
    1002               writtenArea(idx) = -1.; 
    1003                   else 
    1004                     writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
     1000             if (indexToWrite(idx) < 0) 
     1001               writtenArea(idx) = -1.; 
     1002             else 
     1003               writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
    10051004           } 
    10061005         } 
     
    13291328                      axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 
    13301329                      axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 
    1331  
    13321330                    } 
    13331331                  } 
  • XIOS/dev/dev_olga/src/node/axis.cpp

    r1576 r1589  
    696696    CArray<size_t,1>::const_iterator itSrvb = writtenGlobalIndex.begin(), 
    697697                                     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 //    } 
    706698 
    707699    localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 
    708 //    localIndexToWriteOnServer.resize(nbWritten); 
    709  
    710700    nbWritten = 0; 
    711701    for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 
     
    10331023      list<CMessage> listData; 
    10341024      list<CArray<int,1> > list_indi, list_dataInd; 
    1035       list<CArray<bool,1> > list_mask; 
    10361025      list<CArray<double,1> > list_val; 
    10371026      list<CArray<double,2> > list_bounds; 
     
    10601049        list_indi.push_back(CArray<int,1>(nbData)); 
    10611050        list_dataInd.push_back(CArray<int,1>(nbData)); 
    1062         list_mask.push_back(CArray<bool,1>(nbData)); 
    10631051 
    10641052        if (hasValue) 
     
    10741062        CArray<int,1>& dataIndi = list_dataInd.back(); 
    10751063        dataIndi = -1; 
    1076         CArray<bool,1>& maskIndi = list_mask.back(); 
    10771064 
    10781065        for (int n = 0; n < nbData; ++n) 
     
    10831070          ind = globalLocalIndexMap_[idx]; 
    10841071          dataIndi(n) = dataIndex(ind); 
    1085 //          maskIndi(n) = mask(ind); 
    10861072 
    10871073          if (hasValue) 
     
    11071093        listData.push_back(CMessage()); 
    11081094        listData.back() << this->getId() 
    1109                         << list_indi.back() << list_dataInd.back(); //<< list_mask.back(); 
     1095                        << list_indi.back() << list_dataInd.back(); 
    11101096 
    11111097        listData.back() << hasValue; 
     
    11681154      buffer >> vec_indi[idx]; 
    11691155      buffer >> vec_dataInd[idx];       
    1170 //      buffer >> vec_mask[idx]; 
    11711156 
    11721157      buffer >> hasValue; 
     
    12051190         if (0 == globalLocalIndexMap_.count(gloInd)) 
    12061191         { 
    1207 //           index(nbIndLoc) = gloInd % n_glo; 
    1208 //           globalLocalIndexMap_[gloInd] = nbIndLoc; 
    1209 //           ++nbIndexGlob; 
    12101192           index(nbIndexGlob) = gloInd % n_glo; 
    12111193           globalLocalIndexMap_[gloInd] = nbIndexGlob; 
     
    12221204    CArray<int,1> nonCompressedData(nbData); 
    12231205    nonCompressedData = -1;    
    1224 //    mask.resize(nbData); 
    1225 //    mask = true; 
    12261206    // Mask is incorporated into data_index and is not sent/received anymore 
    12271207    mask.resize(0); 
     
    12381218      CArray<int,1>& indi = vec_indi[idx]; 
    12391219      CArray<int,1>& dataIndi = vec_dataInd[idx]; 
    1240 //      CArray<bool,1>& maskIndi = vec_mask[idx]; 
    12411220      int nb = indi.numElements(); 
    12421221      for (int n = 0; n < nb; ++n) 
     
    12461225        nonCompressedData(locInd) = (-1 == nonCompressedData(locInd)) ? dataIndi(n) : nonCompressedData(locInd); 
    12471226 
    1248 //        if (!mask(locInd)) // Only rewrite mask if it's not true 
    1249 //          mask(locInd) = maskIndi(n); 
    1250          
    12511227        if (hasValue) 
    12521228          value(locInd) = vec_val[idx](n); 
  • XIOS/dev/dev_olga/src/node/axis.hpp

    r1571 r1589  
    114114         void computeWrittenIndex(); 
    115115         void computeWrittenCompressedIndex(MPI_Comm); 
    116  
    117          template <class T> void outputAxis(CArray<T,1>& valueIn, CArray<T,1>& valueOut); 
    118  
    119116         bool hasTransformation(); 
    120117         void solveInheritanceTransformation(); 
     
    129126        bool hasLabel; 
    130127 
    131 //        CArray<size_t,1> localIndexToWriteOnServer; 
    132128        CArray<int,1> localIndexToWriteOnServer; 
    133         CArray<size_t,1> localIndexToWriteOnClient; 
    134129 
    135130      private: 
     
    188183   }; // class CAxis 
    189184 
    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      else 
    203      // a hole 
    204      { 
    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  
    216185   // Declare/Define CAxisGroup and CAxisDefinition 
    217186   DECLARE_GROUP(CAxis); 
  • XIOS/dev/dev_olga/src/node/domain.cpp

    r1576 r1589  
    3333      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 
    3434      , globalLocalIndexMap_(), computedWrittenIndex_(false) 
    35       , clients() 
     35      , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false) 
     36      , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false) 
    3637   { 
    3738   } 
     
    4546      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 
    4647      , globalLocalIndexMap_(), computedWrittenIndex_(false) 
    47       , clients() 
     48      , clients(), hasLatInReadFile_(false), hasBoundsLatInReadFile_(false) 
     49      , hasLonInReadFile_(false), hasBoundsLonInReadFile_(false) 
    4850   { 
    4951    } 
     
    161163       // size estimation for sendIndex (and sendArea which is always smaller or equal) 
    162164       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        // } 
    169165 
    170166       // size estimation for sendLonLat 
     
    19081904                                       itSrve = writtenGlobalIndex.end(), itSrv; 
    19091905 
    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); 
    19201906      localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 
    1921  
    19221907      nbWritten = 0; 
    19231908      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 
     
    19341919        ++nbWritten; 
    19351920      } 
    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       //   else 
    1979       //     totalNumberWrittenIndexes_ = numberWrittenIndexes_; 
    1980       // }       
    19811921   } 
    19821922 
     
    25332473           jIndex = (jIndex < 0) ? 0 : jIndex; 
    25342474           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; 
    25462479         }  
    25472480      }  
     
    30012934         dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data 
    30022935         dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);   
    3003  
    3004 //         if (!domainMask(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes 
    3005 //         { 
    3006 //           dataIIndex(lInd) = dataJIndex(lInd) = -1; 
    3007 //         } 
    30082936      }  
    30092937    } 
  • XIOS/dev/dev_olga/src/node/domain.hpp

    r1571 r1589  
    151151         bool hasLonLat; 
    152152         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 
    153157 
    154158         void computeLocalMask(void) ; 
  • XIOS/dev/dev_olga/src/node/grid.cpp

    r1584 r1589  
    423423      } 
    424424   } 
    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 mask 
    432 */ 
    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 //  } 
    470425       
    471426   /* 
     
    17881743          nGlob.push_back(1);   
    17891744        } 
    1790  
    1791 //        modifyMaskSize(nSize, false); 
    1792 //        modifyMaskSize(nSize, true);   // Grid mask should be gone beyond client source filter 
    1793 // 
    1794 //        // These below codes are reserved for future 
    1795 //        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); 
    18271745      } 
    18281746 
  • XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.cpp

    r1584 r1589  
    846846                                                                                 vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, 
    847847                                                                                 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) 
    852848{ 
    853849 
     
    985981  } 
    986982 
    987 // just get the local src mask 
    988 //  CArray<bool,1> localMaskOnSrcGrid; 
    989 //  gridSrc->getLocalMask(localMaskOnSrcGrid) ; 
    990 // intermediate grid, mask is not initialized => set up mask to true 
    991 //  if (localMaskOnSrcGrid.isEmpty()) 
    992 //  { 
    993 //    localMaskOnSrcGrid.resize(nlocalIndexSrc) ; 
    994 //    localMaskOnSrcGrid=true ; 
    995 //  } 
    996    
    997  
    998 //  localMaskOnGridDest.resize(nlocalIndexDest,false) ; 
    999  
    1000983  vector<vector<vector<pair<int,double> > > > dstIndWeight(transformationMapping_.size()) ; 
    1001984    
     
    10381021                                                                   int& t, vector<vector<vector<pair<int,double> > > >& dstIndWeight, int currentInd, 
    10391022                                                                   vector<int>& localSrc, vector<int>& localDst, vector<double>& weight) 
    1040 //                                                                   CArray<bool,1>& localMaskOnGridSrc 
    1041 //                                                                   , vector<bool>& localMaskOnGridDest ) 
    10421023{ 
    10431024  int masked_ ; 
     
    10521033        masked_=masked ; 
    10531034        if (!mask(i)) masked_=false ; 
    1054 //        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, dstIndWeight, currentInd, localSrc, localDst, weight, localMaskOnGridSrc, localMaskOnGridDest) ; 
    10551035        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, srcIndCompressed, nIndexSrc, t, 
    1056                                      dstIndWeight, currentInd, localSrc, localDst, weight);//, localMaskOnGridDest) ; 
     1036                                     dstIndWeight, currentInd, localSrc, localDst, weight); 
    10571037      } 
    10581038    } 
     
    10681048            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][currentInd].begin(); it!=dstIndWeight[t][currentInd].end(); ++it) 
    10691049            { 
    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) ; 
    10771053              (it->first)++ ; 
    10781054            } 
    10791055          } 
    10801056          if (t < dstIndWeight.size()-1) t++ ; 
    1081 //          if (localMaskOnGridSrc(srcInd)) 
    10821057            srcIndCompressed ++ ; 
    10831058        } 
     
    11001075        nonDistributedrecursiveFunct(currentPos-1, masked_, elementPositionInGrid, maskSrc, maskDst, srcInd, 
    11011076                                     srcIndCompressed, nIndexSrc, t, dstIndWeight , i,  localSrc, localDst, weight); 
    1102 //                                     localMaskOnGridSrc, 
    1103 //                                     localMaskOnGridDest) ; 
    11041077      } 
    11051078    } 
     
    11151088            for(vector<pair<int,double> >::iterator it = dstIndWeight[t][i].begin(); it!=dstIndWeight[t][i].end(); ++it) 
    11161089            { 
    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) ; 
    11241093              (it->first)++ ; 
    11251094            } 
    11261095           } 
    11271096          if (t < dstIndWeight.size()-1) t++ ; 
    1128 //          if (localMaskOnGridSrc(srcInd)) 
    1129             srcIndCompressed ++ ; 
     1097          srcIndCompressed ++ ; 
    11301098        } 
    11311099        srcInd++ ; 
     
    11351103 
    11361104} 
    1137  
    1138  
    1139  
    1140  
    1141  
    1142  
    1143  
    1144  
    1145  
    1146  
    11471105 
    11481106/*! 
  • XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.hpp

    r1584 r1589  
    9191  void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 
    9292                                                  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) ; 
    9993  void nonDistributedrecursiveFunct(int currentPos, bool masked, int elementPositionInGrid,  vector< CArray<bool,1>* >& maskSrc, vector< CArray<bool,1>* >& maskDst, 
    10094                                    int& srcInd, int& srcIndCompressed, vector<int>& nIndexSrc, 
  • XIOS/dev/dev_olga/src/transformation/grid_transformation.cpp

    r1584 r1589  
    346346      std::list<RecvIndexGridDestinationMap>().swap(localIndexToReceiveOnGridDest_); 
    347347      std::list<size_t>().swap(nbLocalIndexOnGridDest_); 
    348 //      std::list<std::vector<bool> >().swap(localMaskOnGridDest_); 
    349348    } 
    350349    else 
     
    400399        vector<double> weight ; 
    401400        int nbLocalIndexOnGridDest; 
    402 //        localMaskOnGridDest_.push_back(vector<bool>()) ; 
    403401        CTimer::get("computeTransformationMappingNonDistributed").resume();   
    404402//        algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_, 
     
    409407 
    410408        CTimer::get("computeTransformationMappingConvert").resume();   
    411 //        nbLocalIndexOnGridDest_.push_back(localMaskOnGridDest_.back().size()) ; 
    412 //        nbLocalIndexOnGridDest_.push_back(localMaskOnGridDest_.back().size()) ; 
    413409        nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ; 
    414410        int clientRank=client->clientRank ; 
     
    662658        recvTmp[recvRank][realRecvSize].first = globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]; 
    663659        recvTmp[recvRank][realRecvSize].second = recvWeightDst(idx); 
    664 //        tmpMask[globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]] = true; 
    665660         ++realRecvSize; 
    666661      } 
     
    715710} 
    716711 
    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  
    4949  const std::list<RecvIndexGridDestinationMap>& getLocalIndexToReceiveOnGridDest() const; 
    5050  const std::list<size_t>& getNbLocalIndexToReceiveOnGridDest() const; 
    51 //  const std::list<std::vector<bool> >& getLocalMaskIndexOnGridDest() const; 
    5251 
    5352  CGrid* getGridSource() { return originalGridSource_; } 
     
    8483  //! Number of local index of data to receive on grid destination 
    8584  std::list<size_t> nbLocalIndexOnGridDest_; 
    86 //  std::list<std::vector<bool> > localMaskOnGridDest_; 
    8785 
    8886  bool dynamicalTransformation_; 
Note: See TracChangeset for help on using the changeset viewer.