Changeset 1624


Ignore:
Timestamp:
12/14/18 11:20:33 (5 years ago)
Author:
oabramkina
Message:

Bugfix for NEMO-like land processes elimination.

Values describing a domain (latitude, longitude, bounds,...) are set to -1 on land processes.

Location:
XIOS/branchs/xios-2.5/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS/branchs/xios-2.5/src/io/nc4_data_output.cpp

    r1509 r1624  
    154154*/ 
    155155 
    156          CArray<size_t, 1>& indexToWrite = domain->localIndexToWriteOnServer; 
     156         CArray<int, 1>& indexToWrite = domain->localIndexToWriteOnServer; 
    157157         int nbWritten = indexToWrite.numElements(); 
    158158         CArray<double,1> writtenLat, writtenLon; 
     
    166166           for (int idx = 0; idx < nbWritten; ++idx) 
    167167           { 
    168                   if (idx < domain->latvalue.numElements()) 
    169                   { 
    170                 writtenLat(idx) = domain->latvalue(indexToWrite(idx)); 
    171                 writtenLon(idx) = domain->lonvalue(indexToWrite(idx)); 
    172                   } 
    173                   else 
    174                   { 
    175                 writtenLat(idx) = 0.; 
    176                 writtenLon(idx) = 0.; 
    177                   } 
     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             } 
    178178           } 
    179           
    180179 
    181180           if (domain->hasBounds) 
     
    189188               for (int nv = 0; nv < nvertex; ++nv) 
    190189               { 
    191                  if (idx < boundslat.columns()) 
    192                  { 
     190                 if (indexToWrite(idx) < 0) 
     191                 { 
     192                   writtenBndsLat(nv, idx) = -1.;  // hole 
     193                   writtenBndsLon(nv, idx) = -1.; 
     194                 } 
     195                 else 
     196                 { 
    193197                   writtenBndsLat(nv, idx) = boundslat(nv, int(indexToWrite(idx))); 
    194198                   writtenBndsLon(nv, idx) = boundslon(nv, int(indexToWrite(idx))); 
    195                  } 
    196                  else 
    197                  { 
    198                    writtenBndsLat(nv, idx) = 0.; 
    199                    writtenBndsLon(nv, idx) = 0.; 
    200                  } 
     199                 } 
    201200               } 
    202201           } 
     
    208207           for (int idx = 0; idx < nbWritten; ++idx) 
    209208           { 
    210                   if (idx < domain->areavalue.numElements()) 
    211                 writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
     209                  if (indexToWrite(idx) < 0) 
     210              writtenArea(idx) = -1.; 
    212211                  else 
    213                 writtenArea(idx) = 0.; 
     212              writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
    214213           } 
    215214         } 
     
    221220              case (MULTI_FILE) : 
    222221              { 
    223   //               if (domain->isEmpty()) return; 
    224  
    225                  if (server->intraCommSize > 1) 
    226                  { 
    227   //                 SuperClassWriter::addDimension(lonid, domain->zoom_ni.getValue()); 
    228   //                 SuperClassWriter::addDimension(latid, domain->zoom_nj.getValue()); 
    229                  } 
    230  
    231222                 switch (domain->type) 
    232223                 { 
     
    434425                     std::vector<StdSize> start(2) ; 
    435426                     std::vector<StdSize> count(2) ; 
    436                      if (domain->isEmpty()) 
    437                      { 
    438                        start[0]=0 ; start[1]=0 ; 
    439                        count[0]=0 ; count[1]=0 ; 
    440                      } 
    441                      else 
     427// Comment out because it is not working for a hole 
     428//                     if (domain->isEmpty()) 
     429//                     { 
     430//                       start[0]=0 ; start[1]=0 ; 
     431//                       count[0]=0 ; count[1]=0 ; 
     432//                     } 
     433//                     else 
    442434                     { 
    443435                       start[1]=domain->zoom_ibegin-domain->global_zoom_ibegin; 
     
    883875          case (MULTI_FILE) : 
    884876          { 
     877            ERROR("CNc4DataOutput::writeDomain(domain)", 
     878            << "[ type = multiple_file ]" 
     879            << " is not yet implemented for UGRID files !"); 
    885880            break; 
    886881          } 
     
    948943         int nvertex = (domain->nvertex.isEmpty()) ? 0 : domain->nvertex; 
    949944 
    950          CArray<size_t, 1>& indexToWrite = domain->localIndexToWriteOnServer; 
     945         CArray<int, 1>& indexToWrite = domain->localIndexToWriteOnServer; 
    951946         int nbWritten = indexToWrite.numElements(); 
    952947         CArray<double,1> writtenLat, writtenLon; 
     
    960955           for (int idx = 0; idx < nbWritten; ++idx) 
    961956           { 
    962              if (idx < domain->latvalue.numElements()) 
    963              { 
    964                writtenLat(idx) = domain->latvalue(indexToWrite(idx)); 
    965                writtenLon(idx) = domain->lonvalue(indexToWrite(idx)); 
    966              } 
    967              else 
    968              { 
    969                writtenLat(idx) = 0.; 
    970                writtenLon(idx) = 0.; 
    971              } 
     957             if (indexToWrite(idx) < 0) 
     958             { 
     959               writtenLat(idx) = -1.; 
     960               writtenLon(idx) = -1.; 
     961             } 
     962             else 
     963             { 
     964               writtenLat(idx) = domain->latvalue(indexToWrite(idx)); 
     965               writtenLon(idx) = domain->lonvalue(indexToWrite(idx)); 
     966             } 
    972967           } 
    973968         } 
     
    984979             for (int nv = 0; nv < nvertex; ++nv) 
    985980             { 
    986                if (idx < boundslat.columns()) 
     981               if (indexToWrite(idx) < 0) 
     982               { 
     983                 writtenBndsLat(nv, idx) = -1.; 
     984                 writtenBndsLon(nv, idx) = -1.; 
     985               } 
     986               else 
    987987               { 
    988988                 writtenBndsLat(nv, idx) = boundslat(nv, int(indexToWrite(idx))); 
    989989                 writtenBndsLon(nv, idx) = boundslon(nv, int(indexToWrite(idx))); 
    990                } 
    991                else 
    992                { 
    993                  writtenBndsLat(nv, idx) = 0.; 
    994                  writtenBndsLon(nv, idx) = 0.; 
    995990                } 
    996991             } 
     
    1003998           for (int idx = 0; idx < nbWritten; ++idx) 
    1004999           { 
    1005                   if (idx < domain->areavalue.numElements()) 
    1006                 writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
    1007                   else 
    1008                 writtenArea(idx) = 0.; 
     1000             if (indexToWrite(idx) < 0) 
     1001               writtenArea(idx) = -1.; 
     1002             else 
     1003               writtenArea(idx) = domain->areavalue(indexToWrite(idx)); 
    10091004           } 
    10101005         } 
     
    12881283          SuperClassWriter::definition_end(); 
    12891284 
    1290           CArray<size_t, 1>& indexToWrite = axis->localIndexToWriteOnServer; 
     1285          CArray<int, 1>& indexToWrite = axis->localIndexToWriteOnServer; 
    12911286          int nbWritten = indexToWrite.numElements(); 
    12921287          CArray<double,1> axis_value(indexToWrite.numElements()); 
     
    12951290            for (int i = 0; i < nbWritten; i++) 
    12961291            { 
    1297               if (i < axis->value.numElements()) 
     1292              if (indexToWrite(i) < 0) 
     1293                axis_value(i) = -1;   // Some value in case of a hole 
     1294              else 
    12981295                axis_value(i) = axis->value(indexToWrite(i)); 
    1299               else 
    1300                 axis_value(i) = 0.; 
    13011296            } 
    13021297          } 
     
    13081303            for (int i = 0; i < nbWritten; i++) 
    13091304            { 
    1310               if (i < axis->label.numElements()) 
     1305              if (indexToWrite(i) < 0) 
     1306                axis_label(i) = boost::lexical_cast<string>(-1);  // Some value in case of a hole 
     1307              else 
    13111308                axis_label(i) = axis->label(indexToWrite(i)); 
    1312               else 
    1313                 axis_label(i) = boost::lexical_cast<string>(0);  // Write 0 as a label 
    13141309            } 
    13151310          } 
     
    13291324                  for (int i = 0; i < nbWritten; ++i) 
    13301325                  { 
    1331                     if (i < axis->bounds.columns()) 
     1326                    if (indexToWrite(i) < 0) 
     1327                    { 
     1328                      axis_bounds(0, i) = -1.; // Some value in case of a hole 
     1329                      axis_bounds(1, i) = -1.; 
     1330                    } 
     1331                    else 
    13321332                    { 
    13331333                      axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 
    13341334                      axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 
    1335                     } 
    1336                     else 
    1337                     { 
    1338                       axis_bounds(0, i) = 0.; 
    1339                       axis_bounds(1, i) = 0.; 
    1340  
    13411335                    } 
    13421336                  } 
     
    13691363                  for (int i = 0; i < nbWritten; ++i) 
    13701364                  { 
    1371                     if (i < axis->bounds.columns()) 
     1365                    if (indexToWrite(i) < 0) 
     1366                    { 
     1367                      axis_bounds(0, i) = -1.; 
     1368                      axis_bounds(1, i) = -1.; 
     1369                    } 
     1370                    else 
    13721371                    { 
    13731372                      axis_bounds(0, i) = axis->bounds(0, int(indexToWrite(i))); 
    13741373                      axis_bounds(1, i) = axis->bounds(1, int(indexToWrite(i))); 
    1375                     } 
    1376                     else 
    1377                     { 
    1378                       axis_bounds(0, i) = 0.; 
    1379                       axis_bounds(1, i) = 0.; 
    13801374                    } 
    13811375                  } 
     
    25122506                   if ( wtimeData) 
    25132507                   { 
    2514 //                     SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
    2515 //                     SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
    25162508                       SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
    25172509                       SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
     
    25192511                   if (wtimeCounter) 
    25202512                   { 
    2521 //                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
    2522 //                     if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
    25232513                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 
    25242514                     if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
     
    25962586                          count.push_back(nZoomSizeServer[idx]); 
    25972587                        } 
    2598  
    25992588                        --idxAxis; 
    26002589                        --idx; 
     
    26102599                  int numElement = axisDomainOrder.numElements(); 
    26112600                  int idxDomain = domainList.size() - 1, idxAxis = axisList.size() - 1; 
    2612                   int idx = domainList.size() * 2 + axisList.size() - 1;// nZoomBeginGlobal.size() - 1; 
     2601                  int idx = domainList.size() * 2 + axisList.size() - 1; 
    26132602 
    26142603                  start.reserve(nZoomBeginGlobal.size()); 
     
    26622651                   if ( wtimeData) 
    26632652                   { 
    2664 //                     SuperClassWriter::writeData(time_data, timeAxisId, isCollective, field->getNStep() - 1); 
    2665 //                     SuperClassWriter::writeData(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1); 
    26662653                     SuperClassWriter::writeTimeAxisData(time_data, timeAxisId, isCollective, field->getNStep() - 1, isRoot); 
    26672654                     SuperClassWriter::writeTimeAxisDataBounds(time_data_bound, timeAxisBoundId, isCollective, field->getNStep() - 1, isRoot); 
     
    26692656                   if (wtimeCounter) 
    26702657                   { 
    2671 //                     SuperClassWriter::writeData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1); 
    2672 //                     if (timeCounterType!=record) SuperClassWriter::writeData(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1); 
    26732658                     SuperClassWriter::writeTimeAxisData(time_counter, getTimeCounterName(), isCollective, field->getNStep() - 1,isRoot); 
    26742659                     if (timeCounterType!=record) SuperClassWriter::writeTimeAxisDataBounds(time_counter_bound, timeBoundId, isCollective, field->getNStep() - 1, isRoot); 
  • XIOS/branchs/xios-2.5/src/node/axis.cpp

    r1566 r1624  
    657657          connectedServerRank_[nbServer].push_back(client->clientRank % client->serverSize); 
    658658 
    659          nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]); 
     659        nbSenders[nbServer] = CClientServerMapping::computeConnectedClients(client->serverSize, client->clientSize, client->intraComm, connectedServerRank_[nbServer]); 
    660660 
    661661        delete clientServerMap; 
     
    703703        }                  
    704704      } 
     705 
     706//    localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 
     707//    nbWritten = 0; 
     708//    for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 
     709//    { 
     710//      indGlo = *itSrv; 
     711//      if (ite != globalLocalIndexMap_.find(indGlo)) 
     712//      { 
     713//        localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo]; 
     714//      } 
     715//      else 
     716//      { 
     717//        localIndexToWriteOnServer(nbWritten) = -1; 
     718//      } 
     719//      ++nbWritten; 
     720//    } 
    705721 
    706722      localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 
     
    12931309         if (0 == globalLocalIndexMap_.count(gloInd)) 
    12941310         { 
    1295            index(nbIndLoc) = gloInd % n_glo;            
    1296            globalLocalIndexMap_[gloInd] = nbIndLoc;   
     1311           index(nbIndexGlob) = gloInd % n_glo; 
     1312           globalLocalIndexMap_[gloInd] = nbIndexGlob; 
     1313//           index(nbIndLoc) = gloInd % n_glo;  
     1314//           globalLocalIndexMap_[gloInd] = nbIndLoc;   
    12971315           ++nbIndexGlob; 
    12981316         }  
     
    13451363    } 
    13461364     
    1347     int nbCompressedData = 0;  
     1365    int nbCompressedData = 0; 
    13481366    for (idx = 0; idx < nonCompressedData.numElements(); ++idx) 
    13491367    { 
    13501368      if (0 <= nonCompressedData(idx)) 
    1351         ++nbCompressedData;         
     1369        ++nbCompressedData; 
    13521370    } 
    13531371 
     
    13591377      { 
    13601378        data_index(nbCompressedData) = idx % n; 
    1361         ++nbCompressedData;         
     1379        ++nbCompressedData; 
    13621380      } 
    13631381    } 
     
    14761494      clientsSet.insert(contextClient); 
    14771495    } 
    1478 } 
     1496  } 
    14791497 
    14801498  void CAxis::parse(xml::CXMLNode & node) 
  • XIOS/branchs/xios-2.5/src/node/axis.hpp

    r1371 r1624  
    124124 
    125125      public:  
    126         bool hasValue;         
    127         CArray<size_t,1> localIndexToWriteOnServer;         
     126        bool hasValue; 
     127        CArray<int,1> localIndexToWriteOnServer; 
    128128 
    129129      private: 
  • XIOS/branchs/xios-2.5/src/node/domain.cpp

    r1565 r1624  
    3333      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 
    3434      , globalLocalIndexMap_(), computedWrittenIndex_(false) 
    35           , clients() 
     35      , clients() 
    3636   { 
    3737   } 
     
    4545      , lonvalue(), latvalue(), bounds_lonvalue(), bounds_latvalue() 
    4646      , globalLocalIndexMap_(), computedWrittenIndex_(false) 
    47           , clients() 
     47      , clients() 
    4848   { 
    4949    } 
     
    160160       // size estimation for sendIndex (and sendArea which is always smaller or equal) 
    161161       size_t sizeIndexEvent = 2 * sizeof(size_t) + 2 * CArray<int,1>::size(idxCount); 
    162        // if (isCompressible_) 
    163        // { 
    164        //   std::map<int, std::vector<int> >::const_iterator itWritten = indWrittenSrv_.find(rank); 
    165        //   size_t writtenIdxCount = (itWritten != itWrittenIndexEnd) ? itWritten->second.size() : 0; 
    166        //   sizeIndexEvent += CArray<int,1>::size(writtenIdxCount); 
    167        // } 
    168162 
    169163       // size estimation for sendLonLat 
     
    184178   bool CDomain::isEmpty(void) const 
    185179   { 
    186       return ((this->zoom_i_index.isEmpty()) || (0 == this->zoom_i_index.numElements())); 
    187  
     180     return ((this->i_index.isEmpty()) || (0 == this->i_index.numElements())); 
    188181   } 
    189182 
     
    14551448               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14561449               << "'bounds_lon_1d' dimension is not compatible with 'nvertex'." << std::endl 
    1457                << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(1) 
     1450               << "'bounds_lon_1d' dimension is " << bounds_lon_1d.extent(0) 
    14581451               << " but nvertex is " << nvertex.getValue() << "."); 
    14591452 
     
    14621455               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14631456               << "'bounds_lon_2d' dimension is not compatible with 'nvertex'." << std::endl 
    1464                << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(2) 
     1457               << "'bounds_lon_2d' dimension is " << bounds_lon_2d.extent(0) 
    14651458               << " but nvertex is " << nvertex.getValue() << "."); 
    14661459 
     
    14791472               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14801473               << "'bounds_lat_1d' dimension is not compatible with 'nvertex'." << std::endl 
    1481                << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(1) 
     1474               << "'bounds_lat_1d' dimension is " << bounds_lat_1d.extent(0) 
    14821475               << " but nvertex is " << nvertex.getValue() << "."); 
    14831476 
     
    14861479               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    14871480               << "'bounds_lat_2d' dimension is not compatible with 'nvertex'." << std::endl 
    1488                << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(2) 
     1481               << "'bounds_lat_2d' dimension is " << bounds_lat_2d.extent(0) 
    14891482               << " but nvertex is " << nvertex.getValue() << "."); 
    14901483 
     
    19011894                                       itSrve = writtenGlobalIndex.end(), itSrv; 
    19021895 
    1903 //      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 
    1904 //      { 
    1905 //        indGlo = *itSrv; 
    1906 //        if (ite != globalLocalIndexMap_.find(indGlo)) 
    1907 //        { 
    1908 //          ++nbWritten; 
    1909 //        } 
    1910 //      } 
    1911  
    1912 //      localIndexToWriteOnServer.resize(nbWritten); 
    19131896      localIndexToWriteOnServer.resize(writtenGlobalIndex.numElements()); 
    1914  
    19151897      nbWritten = 0; 
    19161898      for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 
     
    19201902        { 
    19211903          localIndexToWriteOnServer(nbWritten) = globalLocalIndexMap_[indGlo]; 
    1922           ++nbWritten; 
    19231904        } 
    19241905        else 
    19251906        { 
    1926           localIndexToWriteOnServer(nbWritten) = 0; 
    1927           ++nbWritten; 
    1928         } 
    1929       } 
    1930        
    1931       // if (isCompressible()) 
    1932       // { 
    1933       //   nbWritten = 0; 
    1934       //   boost::unordered_map<size_t,size_t> localGlobalIndexMap; 
    1935       //   for (itSrv = itSrvb; itSrv != itSrve; ++itSrv) 
    1936       //   { 
    1937       //     indGlo = *itSrv; 
    1938       //     if (ite != globalLocalIndexMap_.find(indGlo)) 
    1939       //     { 
    1940       //       localGlobalIndexMap[localIndexToWriteOnServer(nbWritten)] = indGlo; 
    1941       //       ++nbWritten; 
    1942       //     }                  
    1943       //   } 
    1944  
    1945       //   nbWritten = 0; 
    1946       //   for (int idx = 0; idx < data_i_index.numElements(); ++idx) 
    1947       //   { 
    1948       //     if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx))) 
    1949       //     { 
    1950       //       ++nbWritten; 
    1951       //     } 
    1952       //   } 
    1953  
    1954       //   compressedIndexToWriteOnServer.resize(nbWritten); 
    1955       //   nbWritten = 0; 
    1956       //   for (int idx = 0; idx < data_i_index.numElements(); ++idx) 
    1957       //   { 
    1958       //     if (localGlobalIndexMap.end() != localGlobalIndexMap.find(data_i_index(idx))) 
    1959       //     { 
    1960       //       compressedIndexToWriteOnServer(nbWritten) = localGlobalIndexMap[data_i_index(idx)]; 
    1961       //       ++nbWritten; 
    1962       //     } 
    1963       //   } 
    1964  
    1965       //   numberWrittenIndexes_ = nbWritten; 
    1966       //   if (isDistributed()) 
    1967       //   {             
    1968       //     MPI_Allreduce(&numberWrittenIndexes_, &totalNumberWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 
    1969       //     MPI_Scan(&numberWrittenIndexes_, &offsetWrittenIndexes_, 1, MPI_INT, MPI_SUM, server->intraComm); 
    1970       //     offsetWrittenIndexes_ -= numberWrittenIndexes_; 
    1971       //   } 
    1972       //   else 
    1973       //     totalNumberWrittenIndexes_ = numberWrittenIndexes_; 
    1974       // }       
     1907          localIndexToWriteOnServer(nbWritten) = -1; 
     1908        } 
     1909        ++nbWritten; 
     1910      } 
    19751911   } 
    19761912 
     
    25102446     
    25112447    globalLocalIndexMap_.rehash(std::ceil(nbIndGlob/globalLocalIndexMap_.max_load_factor())); 
    2512     i_index.resize(nbIndGlob); 
    2513     j_index.resize(nbIndGlob);    
     2448//    i_index.resize(nbIndGlob); 
     2449//    j_index.resize(nbIndGlob); 
     2450    i_index.resize(ni*nj); 
     2451    j_index.resize(ni*nj); 
     2452    i_index = -1; 
     2453    j_index = -1; 
    25142454    int nbIndexGlobMax = nbIndGlob, nbIndLoc; 
    25152455 
     
    25282468           jIndex = (jIndex < 0) ? 0 : jIndex; 
    25292469           nbIndLoc = iIndex + ni * jIndex; 
    2530            if (nbIndLoc < nbIndexGlobMax) 
    2531            { 
    2532              i_index(nbIndLoc) = index % ni_glo; 
    2533              j_index(nbIndLoc) = index / ni_glo; 
    2534              globalLocalIndexMap_[index] = nbIndLoc;   
    2535              ++nbIndGlob; 
    2536            } 
    2537            // i_index(nbIndGlob) = index % ni_glo; 
    2538            // j_index(nbIndGlob) = index / ni_glo; 
    2539            // globalLocalIndexMap_[index] = nbIndGlob;   
    2540            // ++nbIndGlob; 
     2470           i_index(nbIndLoc) = index % ni_glo; 
     2471           j_index(nbIndLoc) = index / ni_glo; 
     2472           globalLocalIndexMap_[index] = nbIndLoc; 
     2473//           i_index(nbIndGlob) = index % ni_glo; 
     2474//           j_index(nbIndGlob) = index / ni_glo; 
     2475//           globalLocalIndexMap_[index] = nbIndGlob; 
     2476           ++nbIndGlob; 
     2477//           if (nbIndLoc < nbIndexGlobMax) 
     2478//          { 
     2479//             i_index(nbIndLoc) = index % ni_glo; 
     2480//             j_index(nbIndLoc) = index / ni_glo; 
     2481//             globalLocalIndexMap_[index] = nbIndLoc;   
     2482//             ++nbIndGlob; 
     2483//           } 
     2484//           // i_index(nbIndGlob) = index % ni_glo; 
     2485//           // j_index(nbIndGlob) = index / ni_glo; 
     2486//           // globalLocalIndexMap_[index] = nbIndGlob;   
     2487//           // ++nbIndGlob; 
    25412488         }  
    25422489      }  
    25432490    }  
    25442491 
    2545     if (nbIndGlob==0) 
    2546     { 
    2547       i_index.resize(nbIndGlob); 
    2548       j_index.resize(nbIndGlob); 
    2549     } 
    2550     else 
    2551     { 
    2552       i_index.resizeAndPreserve(nbIndGlob); 
    2553       j_index.resizeAndPreserve(nbIndGlob); 
    2554     } 
     2492//    if (nbIndGlob==0) 
     2493//    { 
     2494//      i_index.resize(nbIndGlob); 
     2495//      j_index.resize(nbIndGlob); 
     2496//    } 
     2497//    else 
     2498//    { 
     2499//      i_index.resizeAndPreserve(nbIndGlob); 
     2500//      j_index.resizeAndPreserve(nbIndGlob); 
     2501//    } 
    25552502  } 
    25562503 
     
    26612608 
    26622609    nbMaskInd = globalLocalIndexMap_.size(); 
    2663     mask_1d.resize(nbMaskInd); 
    2664     domainMask.resize(nbMaskInd); 
     2610//    mask_1d.resize(nbMaskInd); 
     2611//    domainMask.resize(nbMaskInd); 
     2612    mask_1d.resize(ni*nj); 
     2613    domainMask.resize(ni*nj); 
    26652614    mask_1d = false; 
    26662615     
     
    27372686 
    27382687      nbLonInd = globalLocalIndexMap_.size(); 
    2739       lonvalue.resize(nbLonInd); 
     2688//      lonvalue.resize(nbLonInd); 
     2689      lonvalue.resize(ni*nj); 
     2690      lonvalue = -1.0; 
    27402691      if (hasBounds) 
    27412692      { 
    2742         bounds_lonvalue.resize(nvertex,nbLonInd); 
    2743         bounds_lonvalue = 0.; 
     2693//        bounds_lonvalue.resize(nvertex,nbLonInd); 
     2694//        bounds_lonvalue = 0.; 
     2695        bounds_lonvalue.resize(nvertex,ni*nj); 
     2696        bounds_lonvalue = -1.0; 
    27442697      } 
    27452698 
     
    28212774 
    28222775      nbLatInd = globalLocalIndexMap_.size(); 
    2823       latvalue.resize(nbLatInd); 
     2776//      latvalue.resize(nbLatInd); 
     2777      latvalue.resize(ni*nj); 
    28242778      if (hasBounds) 
    28252779      { 
    2826         bounds_latvalue.resize(nvertex,nbLatInd); 
    2827         bounds_latvalue = 0. ; 
     2780//        bounds_latvalue.resize(nvertex,nbLatInd); 
     2781//        bounds_latvalue = 0. ; 
     2782        bounds_latvalue.resize(nvertex,ni*nj); 
     2783        bounds_latvalue = -1. ; 
    28282784      } 
    28292785 
     
    29032859 
    29042860      nbAreaInd = globalLocalIndexMap_.size(); 
    2905       areavalue.resize(nbAreaInd); 
    2906       nbAreaInd = 0;       
     2861//      areavalue.resize(nbAreaInd); 
     2862//      nbAreaInd = 0; 
     2863      areavalue.resize(ni*nj); 
     2864      nbAreaInd = -1.0; 
    29072865      for (i = 0; i < nbReceived; ++i) 
    29082866      { 
     
    30152973         dataIIndex(lInd) = (-1 == dataIIndex(lInd)) ? tmpI(ind) : dataIIndex(lInd); // Only fill in dataIndex if there is no data 
    30162974         dataJIndex(lInd) = (-1 == dataJIndex(lInd)) ? tmpJ(ind) : dataJIndex(lInd);   
    3017  
    3018          if (!domainMask(lInd))   // Include mask info into data index on the RECEIVE getServerDimensionSizes     
    3019          { 
    3020            dataIIndex(lInd) = dataJIndex(lInd) = -1; 
    3021          } 
    30222975      }  
    30232976    } 
  • XIOS/branchs/xios-2.5/src/node/domain.hpp

    r1353 r1624  
    142142         CArray<double, 1> areavalue; 
    143143 
    144          CArray<size_t,1> localIndexToWriteOnServer;          
     144         CArray<int,1> localIndexToWriteOnServer; 
    145145 
    146146         CArray<bool, 1> domainMask; // mask_1d, mask_2d -> domainMask 
  • XIOS/branchs/xios-2.5/src/node/grid.cpp

    r1397 r1624  
    978978 
    979979     nbIndexOnServer = 0; 
    980      for (size_t j = 0; j < globalIndexElementOnServerMap.size(); ++j) 
     980//     for (size_t j = 0; j < globalIndexElementOnServerMap.size(); ++j) 
     981     for (size_t j = 0; j < globalIndexElementOnClient.numElements(); ++j) 
    981982     { 
    982983       it = globalIndexElementOnServerMap.find(globalIndexElementOnClient(j)); 
     
    13051306  { 
    13061307    CContext* context = CContext::getCurrent();     
    1307 //    int nbSrvPools = (context->hasServer) ? (context->hasClient ? context->clientPrimServer.size() : 1) : 1; // This should be changed soon 
    1308 //    for (int p = 0; p < nbSrvPools; ++p) 
    1309     { 
    1310 //      CContextClient* client = (context->hasServer) ? (context->hasClient ? context->clientPrimServer[p] : context->client) 
    1311 //                                                    : context->client; 
     1308    { 
    13121309      CContextClient* client = context->client; 
    13131310 
Note: See TracChangeset for help on using the changeset viewer.