Changeset 1570


Ignore:
Timestamp:
08/31/18 14:15:54 (6 years ago)
Author:
oabramkina
Message:

Further simplifications on sending data/grid indexes.

(1) Domain/axis mask is not sent anymore. It has been incorporated into data index.

(2) Creating a map that holds grid mask only in case if grid mask is defined.

Still to fix: a hole in a domain or axis.

Location:
XIOS/dev/dev_olga/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/distribution_client.cpp

    r1568 r1570  
    1515   , axisDomainOrder_() 
    1616   , nLocal_(), nGlob_(), nBeginLocal_(), nBeginGlobal_() 
    17    , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_(), domainMasks_(), axisMasks_() 
     17   , dataNIndex_(), dataDims_(), dataBegin_(), dataIndex_()//, domainMasks_()//, axisMasks_() 
    1818   , gridMask_(), indexMap_() 
    1919   , isDataDistributed_(true), axisNum_(0), domainNum_(0) 
     
    117117  axisDomainOrder_ = axisDomainOrder; 
    118118 
    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   } 
     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//  } 
    133133 
    134134  // Because domain and axis can be in any order (axis1, domain1, axis2, axis3, ) 
     
    282282 
    283283        if ((iIdx >= nBeginLocal_[indexMap_[i]]) && (iIdx < nLocal_[indexMap_[i]]) && 
    284            (jIdx >= nBeginLocal_[indexMap_[i]+1]) && (jIdx < nLocal_[indexMap_[i]+1]) 
    285            && (domainMasks_[idxDomain](iIdx + jIdx*nLocal_[indexMap_[i]]))) 
     284           (jIdx >= nBeginLocal_[indexMap_[i]+1]) && (jIdx < nLocal_[indexMap_[i]+1])) 
     285//           && (domainMasks_[idxDomain](iIdx + jIdx*nLocal_[indexMap_[i]]))) 
    286286        { 
    287287          ++count; 
     
    330330        iIdx = getAxisIndex((dataIndex_[indexMap_[i]])(j), dataBegin_[indexMap_[i]], nLocal_[indexMap_[i]]); 
    331331        if ((iIdx >= nBeginLocal_[indexMap_[i]]) && 
    332            (iIdx < nLocal_[indexMap_[i]]) && (axisMasks_[idxAxis](iIdx))) 
     332           (iIdx < nLocal_[indexMap_[i]]) )//&& (axisMasks_[idxAxis](iIdx))) 
    333333        { 
    334334          ++count; 
     
    413413 
    414414  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   } 
     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//  } 
    460460 
    461461  // 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())); 
     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())); 
     467 
     468  localDataIndex_.resize(ssize); 
     469  if (!gridMask_.isEmpty()) localMaskIndex_.resize(ssize); 
     470  localMaskedDataIndex_.resize(ssize); 
     471  globalDataIndex_.rehash(std::ceil(ssize/globalDataIndex_.max_load_factor())); 
     472  globalLocalDataSendToServerMap_.rehash(std::ceil(ssize/globalLocalDataSendToServerMap_.max_load_factor())); 
     473 
    467474 
    468475  // We need to loop with data index 
     
    524531          bool maskGridTmp = true; 
    525532 
    526           // Domain or axis mask: only unmasked values will be sent 
    527           int idxDomain = 0, idxAxis = 0; 
    528           for (int elem = 0; elem < numElement_; ++elem) 
    529           { 
    530             if (2 == axisDomainOrder_(elem)) 
     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) 
    531553            { 
    532               maskTmp = maskTmp && domainMasks_[idxDomain](currentIndex[elem]); 
    533               ++idxDomain; 
     554              globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k]; 
    534555            } 
    535             else if (1 == axisDomainOrder_(elem)) 
    536             { 
    537               maskTmp = maskTmp && axisMasks_[idxAxis](currentIndex[elem]); 
    538               ++idxAxis; 
    539             } 
    540           } 
     556            globalDataIndex_[globalIndex] = indexLocalDataOnClientCount; 
     557            localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 
     558            globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount; 
     559            localMaskedDataIndex_[indexLocalDataOnClientCount] = indexLocalDataOnClientCount; 
     560//          } 
    541561 
    542562          // Grid mask: unmasked values will be replaces by NaN and then all values will be sent 
     
    549569            } 
    550570            maskGridTmp =  gridMask_(gridMaskIndex); 
    551           } 
    552  
    553           if (maskTmp) 
    554           { 
    555             size_t globalIndex = 0; 
    556             for (int k = 0; k < numElement_; ++k) 
    557             { 
    558               globalIndex += (currentGlobalIndex[k])*elementNGlobal_[k]; 
    559             } 
    560             globalDataIndex_[globalIndex] = indexLocalDataOnClientCount; 
    561             localDataIndex_[indexLocalDataOnClientCount] = countLocalData; 
    562571            if (maskGridTmp) 
    563572              localMaskIndex_[indexLocalDataOnClientCount] = true; 
    564573            else 
    565574              localMaskIndex_[indexLocalDataOnClientCount] = false; 
    566             globalLocalDataSendToServerMap_[globalIndex] = indexLocalDataOnClientCount; 
    567             localMaskedDataIndex_[indexLocalDataOnClientCount] = indexLocalDataOnClientCount; 
    568             ++indexLocalDataOnClientCount; 
    569575          } 
     576 
     577          ++indexLocalDataOnClientCount; 
     578 
    570579        } 
    571580        ++countLocalData; 
     
    600609                                        const int& dataDim, const int& ni, int& j) 
    601610{ 
     611  int i; 
    602612  int tempI = dataIIndex + dataIBegin, 
    603613      tempJ = (dataJIndex + dataJBegin); 
    604614  if (ni == 0) 
    605615  { 
    606     int i = 0; 
    607     j = 0; 
     616    i = -1; 
     617    j = -1; 
    608618    return i; 
    609619  } 
    610   int i = (dataDim == 1) ? (tempI) % ni 
    611                          : (tempI) ; 
    612   j = (dataDim == 1) ? (tempI) / ni 
    613                      : (tempJ) ; 
    614  
     620  if ((tempI < 0) || (tempJ < 0)) 
     621  { 
     622    i = -1; 
     623    j = -1; 
     624    return i; 
     625  } 
     626  else 
     627  { 
     628    i = (dataDim == 1) ? (tempI) % ni : (tempI) ; 
     629    j = (dataDim == 1) ? (tempI) / ni : (tempJ) ; 
     630  } 
    615631  return i; 
    616632} 
     
    629645    return -1; 
    630646  } 
    631   int tempI = dataIndex; //+ dataBegin; 
     647  int tempI = dataIndex; 
    632648  if ((tempI < 0) || (tempI > ni)) 
    633649    return -1; 
  • XIOS/dev/dev_olga/src/distribution_client.hpp

    r1568 r1570  
    9393    std::vector<int> localDataIndex_; 
    9494 
    95     /*! Array holding grid mask. 
     95    /*! Array holding grid mask. If grid mask is not defined, its size is zero. 
    9696     * It is used by source filter of client for replacing unmasked data by NaN. 
    9797    */ 
     
    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 
     120//    std::vector<CArray<bool,1> > domainMasks_; //!< Domain mask 
     121//    std::vector<CArray<bool,1> > axisMasks_; //!< Axis mask 
    122122 
    123123    std::vector<int> indexMap_; //!< Mapping element index to dimension index 
  • XIOS/dev/dev_olga/src/node/axis.cpp

    r1568 r1570  
    300300      if (context->hasClient) 
    301301      { 
     302        this->checkMask(); 
    302303        this->checkData(); 
    303         this->checkMask(); 
    304304        this->checkLabel(); 
    305305      } 
     
    307307 
    308308   /*! 
    309       Check the validity of data and fill in values if any. 
     309      Check the validity of data, fill in values if any, and apply mask. 
    310310   */ 
    311311 
     
    331331        { 
    332332          if ((i+data_begin) >= 0 && (i+data_begin<n)) 
    333             data_index(i) = i+data_begin; 
     333          { 
     334            if (mask(i+data_begin)) 
     335              data_index(i) = i+data_begin; 
     336            else 
     337              data_index(i) = -1; 
     338          } 
    334339          else 
    335340            data_index(i) = -1; 
     
    344349                << "The size of data_index = "<< data_index.numElements() << "is not equal to the data size data_n = " << data_n.getValue() << ")."); 
    345350        } 
    346         data_index.resize(data_n); 
    347351        for (int i = 0; i < data_n; ++i) 
    348352        { 
    349           if ((i+data_begin) >= 0 && (i+data_begin<n)) 
    350             data_index(i) = data_index(i); 
    351           else 
     353          if ((i+data_begin) >= 0 && (i+data_begin<n) && !mask(i+data_begin)) 
    352354            data_index(i) = -1; 
    353355        } 
     
    10701072          ind = globalLocalIndexMap_[idx]; 
    10711073          dataIndi(n) = dataIndex(ind); 
    1072           maskIndi(n) = mask(ind); 
     1074//          maskIndi(n) = mask(ind); 
    10731075 
    10741076          if (hasValue) 
     
    10941096        listData.push_back(CMessage()); 
    10951097        listData.back() << this->getId() 
    1096                         << list_indi.back() << list_dataInd.back() << list_mask.back(); 
     1098                        << list_indi.back() << list_dataInd.back(); //<< list_mask.back(); 
    10971099 
    10981100        listData.back() << hasValue; 
     
    11551157      buffer >> vec_indi[idx]; 
    11561158      buffer >> vec_dataInd[idx];       
    1157       buffer >> vec_mask[idx]; 
     1159//      buffer >> vec_mask[idx]; 
    11581160 
    11591161      buffer >> hasValue; 
     
    12061208    CArray<int,1> nonCompressedData(nbData); 
    12071209    nonCompressedData = -1;    
    1208     mask.resize(nbData); 
    1209     mask = true; 
     1210//    mask.resize(nbData); 
     1211//    mask = true; 
     1212    // Mask is incorporated into data_index and is not sent/received anymore 
     1213    mask.resize(0); 
    12101214    if (hasValue) 
    12111215      value.resize(nbData); 
     
    12201224      CArray<int,1>& indi = vec_indi[idx]; 
    12211225      CArray<int,1>& dataIndi = vec_dataInd[idx]; 
    1222       CArray<bool,1>& maskIndi = vec_mask[idx]; 
     1226//      CArray<bool,1>& maskIndi = vec_mask[idx]; 
    12231227      int nb = indi.numElements(); 
    12241228      for (int n = 0; n < nb; ++n) 
     
    12281232        nonCompressedData(locInd) = (-1 == nonCompressedData(locInd)) ? dataIndi(n) : nonCompressedData(locInd); 
    12291233 
    1230         if (!mask(locInd)) // Only rewrite mask if it's not true 
    1231           mask(locInd) = maskIndi(n); 
     1234//        if (!mask(locInd)) // Only rewrite mask if it's not true 
     1235//          mask(locInd) = maskIndi(n); 
    12321236         
    12331237        if (hasValue) 
  • XIOS/dev/dev_olga/src/node/domain.cpp

    r1568 r1570  
    10811081   void CDomain::checkCompression(void) 
    10821082   { 
     1083     int i,j,ind; 
    10831084      if (!data_i_index.isEmpty()) 
    10841085      { 
     
    11011102                   << "'data_j_index' must be defined when 'data_i_index' is set and 'data_dim' is 2."); 
    11021103          } 
     1104          for (int k=0; k<data_i_index.numElements(); ++k) 
     1105          { 
     1106            i = data_i_index(k)+data_ibegin ; 
     1107            j = data_j_index(k)+data_jbegin ; 
     1108            if (i>=0 && i<ni && j>=0 && j<nj) 
     1109            { 
     1110              ind=j*ni+i ; 
     1111              if (!domainMask(ind)) 
     1112              { 
     1113                data_i_index(k) = -1; 
     1114                data_j_index(k) = -1; 
     1115              } 
     1116            } 
     1117            else 
     1118            { 
     1119              data_i_index(k) = -1; 
     1120              data_j_index(k) = -1; 
     1121            } 
     1122          } 
    11031123        } 
    11041124        else // (1 == data_dim) 
     
    11071127          { 
    11081128            data_j_index.resize(data_ni); 
    1109             for (int j = 0; j < data_ni; ++j) data_j_index(j) = 0; 
     1129            data_j_index(j) = 0; 
     1130          } 
     1131          for (int k=0; k<data_i_index.numElements(); ++k) 
     1132          { 
     1133            i=data_i_index(k)+data_ibegin ; 
     1134            if (i>=0 && i < domainMask.size()) 
     1135            { 
     1136              if (!domainMask(i)) data_i_index(k) = -1; 
     1137            } 
     1138            else 
     1139              data_i_index(k) = -1; 
     1140 
     1141            if (!domainMask(i)) data_i_index(k) = -1; 
    11101142          } 
    11111143        } 
     
    11221154          data_i_index.resize(data_ni); 
    11231155          data_j_index.resize(data_ni); 
    1124  
    1125           for (int i = 0; i < data_ni; ++i) 
     1156          data_j_index = 0; 
     1157 
     1158          for (int k = 0; k < data_ni; ++k) 
    11261159          { 
    1127             data_i_index(i) = i; 
    1128             data_j_index(i) = 0; 
     1160            i=k+data_ibegin ; 
     1161            if (i>=0 && i < domainMask.size()) 
     1162            { 
     1163              if (domainMask(i)) 
     1164                data_i_index(k) = k; 
     1165              else 
     1166                data_i_index(k) = -1; 
     1167            } 
     1168            else 
     1169              data_i_index(k) = -1; 
    11291170          } 
    11301171        } 
     
    11351176          data_j_index.resize(dsize); 
    11361177 
    1137           for(int count = 0, j = 0; j < data_nj; ++j) 
     1178          for(int count = 0, kj = 0; kj < data_nj; ++kj) 
    11381179          { 
    1139             for(int i = 0; i < data_ni; ++i, ++count) 
     1180            for(int ki = 0; ki < data_ni; ++ki, ++count) 
    11401181            { 
    1141               data_i_index(count) = i; 
    1142               data_j_index(count) = j; 
     1182              i = ki + data_ibegin; 
     1183              j = kj + data_jbegin; 
     1184              ind=j*ni+i ; 
     1185              if (i>=0 && i<ni && j>=0 && j<nj) 
     1186              { 
     1187                if (domainMask(ind)) 
     1188                { 
     1189                  data_i_index(count) = ki; 
     1190                  data_j_index(count) = kj; 
     1191                } 
     1192                else 
     1193                { 
     1194                  data_i_index(count) = -1; 
     1195                  data_j_index(count) = -1; 
     1196                } 
     1197              } 
     1198              else 
     1199              { 
     1200                data_i_index(count) = -1; 
     1201                data_j_index(count) = -1; 
     1202              } 
    11431203            } 
    11441204          } 
     
    19762036    sendDistributionAttributes(); 
    19772037    sendIndex();        
    1978     sendMask(); 
     2038//    sendMask(); 
    19792039    sendLonLat(); 
    19802040    sendArea();     
     
    24472507         { 
    24482508           iIndex = (index%ni_glo)-ibegin; 
    2449            iIndex = (iIndex < 0) ? 0 : iIndex;    // ?? 
     2509           iIndex = (iIndex < 0) ? 0 : iIndex; 
    24502510           jIndex = (index/ni_glo)-jbegin; 
    2451            jIndex = (jIndex < 0) ? 0 : jIndex;    // ?? 
     2511           jIndex = (jIndex < 0) ? 0 : jIndex; 
    24522512           nbIndLoc = iIndex + ni * jIndex; 
    2453            if (nbIndLoc < nbIndexGlobMax) 
     2513//           if (nbIndLoc < nbIndexGlobMax)  // THIS CONDITION IMPEDES THE CASE OF A HOLE 
    24542514           { 
    24552515             i_index(nbIndLoc) = index % ni_glo; 
     
    24762536      j_index.resizeAndPreserve(nbIndGlob); 
    24772537    } 
     2538 
     2539    domainMask.resize(0); // Mask is not defined anymore on servers 
    24782540  } 
    24792541 
     
    28962958      buffer >> recvDataJIndex[i]; 
    28972959    } 
    2898  
     2960    
    28992961    int nbIndex = i_index.numElements(); 
    29002962    CArray<int,1> dataIIndex(nbIndex), dataJIndex(nbIndex); 
    29012963    dataIIndex = -1; dataJIndex = -1; 
    2902  
     2964      
    29032965    nbIndex = 0; 
    29042966    for (i = 0; i < nbReceived; ++i) 
     
    29182980         dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);   
    29192981 
    2920          if (!domainMask(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes 
    2921          { 
    2922            dataIIndex(lInd) = dataJIndex(lInd) = -1; 
    2923          } 
     2982//         if (!domainMask(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes 
     2983//         { 
     2984//           dataIIndex(lInd) = dataJIndex(lInd) = -1; 
     2985//         } 
    29242986      }  
    29252987    } 
  • XIOS/dev/dev_olga/src/node/grid.cpp

    r1568 r1570  
    693693     CContext* context = CContext::getCurrent(); 
    694694 
    695      CContextClient* client = context->client;  // Here it's not important which contextClient to recuperate 
     695     CContextClient* client = context->client; 
    696696     int rank = client->clientRank; 
    697697 
     
    699699     // Get local data index on client 
    700700     int nbStoreIndex = clientDistribution_->getLocalDataIndexOnClient().size(); 
     701     int nbStoreGridMask = clientDistribution_->getLocalMaskIndexOnClient().size(); 
     702     // nbStoreGridMask = nbStoreIndex if grid mask is defined, and 0 otherwise 
    701703     storeIndex_client.resize(nbStoreIndex); 
    702      storeMask_client.resize(nbStoreIndex); 
    703      for (int idx = 0; idx < nbStoreIndex; ++idx) 
    704      { 
    705        storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 
    706        storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 
    707      } 
     704     storeMask_client.resize(nbStoreGridMask); 
     705     for (int idx = 0; idx < nbStoreIndex; ++idx) storeIndex_client(idx) = (clientDistribution_->getLocalDataIndexOnClient())[idx]; 
     706     for (int idx = 0; idx < nbStoreGridMask; ++idx) storeMask_client(idx) = (clientDistribution_->getLocalMaskIndexOnClient())[idx]; 
    708707 
    709708     if (0 == serverDistribution_) isDataDistributed_= clientDistribution_->isDataDistributed(); 
     
    13021301      const StdSize size = storeIndex_client.numElements(); 
    13031302      stored.resize(size); 
    1304  
    13051303      const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
    1306       for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue; 
     1304 
     1305      if (storeMask_client.numElements() != 0) 
     1306        for(StdSize i = 0; i < size; i++) stored(i) = (storeMask_client(i)) ? data[storeIndex_client(i)] : nanValue; 
     1307      else 
     1308        for(StdSize i = 0; i < size; i++) stored(i) = data[storeIndex_client(i)]; 
    13071309   } 
    13081310 
Note: See TracChangeset for help on using the changeset viewer.