Changeset 2507


Ignore:
Timestamp:
06/01/23 10:58:08 (12 months ago)
Author:
ymipsl
Message:

Merging XIOS3_ATTACHED branch into XIOS3 trunk.

YM

Location:
XIOS3/trunk/src
Files:
25 added
50 edited

Legend:

Unmodified
Added
Removed
  • XIOS3/trunk/src/config/domain_attribute.conf

    r2479 r2507  
    6262 
    6363DECLARE_ARRAY(double, 2, area, false) 
     64DECLARE_ARRAY(double, 2, area_2d, false) 
     65DECLARE_ARRAY(double, 1, area_1d, false) 
    6466DECLARE_ATTRIBUTE(double, radius) 
    6567 
  • XIOS3/trunk/src/config/node_type.conf

    r2458 r2507  
    132132#endif //__XIOS_CServiceNode__ 
    133133 
     134#ifdef __XIOS_CRedistributeDomain__ 
     135   DECLARE_NODE(RedistributeDomain, redistribute_domain) 
     136#endif //__XIOS_CRedistributeDomain__ 
     137 
     138#ifdef __XIOS_CRedistributeAxis__ 
     139   DECLARE_NODE(RedistributeAxis, redistribute_axis) 
     140#endif //__XIOS_CRedistributeAxis__ 
     141 
     142#ifdef __XIOS_CRedistributeScalar__ 
     143   DECLARE_NODE(RedistributeScalar, redistribute_scalar) 
     144#endif //__XIOS_CRedistributeScalar__ 
     145 
    134146#ifdef __XIOS_CContext__ 
    135147   DECLARE_NODE_PAR(Context, context) 
  • XIOS3/trunk/src/distribution/grid_remote_connector.cpp

    r2397 r2507  
    9999      size_t globalIndexSize = globalIndex.numElements() ; 
    100100       
    101       size_t allEqual ; 
    102       MPI_Allreduce(&globalIndexSize, &allEqual, 1, MPI_SIZE_T, MPI_BXOR, localComm_) ; 
    103       if (allEqual!=0)  
     101      size_t minVal,maxVal ; 
     102      MPI_Allreduce(&globalIndexSize, &minVal, 1, MPI_SIZE_T, MPI_MIN, localComm_) ; 
     103      MPI_Allreduce(&globalIndexSize, &maxVal, 1, MPI_SIZE_T, MPI_MAX, localComm_) ; 
     104      if (minVal!=maxVal)  
    104105      { 
    105106        isSrcViewDistributed_[i]=true ; 
     
    110111      size_t hashValue=0 ; 
    111112      for(size_t ind=0;ind<globalIndexSize;ind++) hashValue += hashGlobalIndex(globalIndex(ind)) ; 
    112       MPI_Allreduce(&hashValue, &allEqual, 1, MPI_SIZE_T, MPI_BXOR, localComm_) ; 
    113       if (allEqual!=0) isSrcViewDistributed_[i]=true ; 
     113      MPI_Allreduce(&hashValue, &minVal, 1, MPI_SIZE_T, MPI_MIN, localComm_) ; 
     114      MPI_Allreduce(&hashValue, &maxVal, 1, MPI_SIZE_T, MPI_MAX, localComm_) ; 
     115      if (minVal!=maxVal) isSrcViewDistributed_[i]=true ; 
    114116      else isSrcViewDistributed_[i]=false ; 
    115117    } 
  • XIOS3/trunk/src/distribution/transform_connector.hpp

    r2267 r2507  
    3232    
    3333    public: 
     34       
     35 
    3436      template<typename T>  
    35       void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut) 
     37      void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, bool useMissingValue, T missingValue) 
    3638      { 
    3739        map<int,CArray<T,1>> tmpArrayIn ; 
     
    5860        MPI_Waitall(requests.size(), requests.data(),status.data()) ; 
    5961         
    60         const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
    61         gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, nanValue) ; 
     62        if (useMissingValue) gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, missingValue) ; 
     63        else gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut) ; 
     64 //       const double nanValue = std::numeric_limits<double>::quiet_NaN(); 
     65 //       gathererConnector_->transfer(repeat, sizeT , tmpArrayOut, dataOut, nanValue) ; 
     66      } 
     67 
     68      template<typename T>  
     69      void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut) 
     70      { 
     71        T missingValue ; 
     72        transfer(1, sizeT, dataIn, dataOut, false, missingValue) ; 
     73      } 
     74 
     75      template<typename T>  
     76      void transfer(int repeat, int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue) 
     77      { 
     78        transfer(1, sizeT, dataIn, dataOut, true, missingValue) ; 
    6279      } 
    6380 
     
    6683      { 
    6784        transfer(1, sizeT, dataIn, dataOut) ; 
     85      } 
     86 
     87      template<typename T>  
     88      void transfer(int sizeT, const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue) 
     89      { 
     90        transfer(1, sizeT, dataIn, dataOut, missingValue) ; 
    6891      } 
    6992    
     
    7497      } 
    7598 
     99      template<typename T>  
     100      void transfer(const CArray<T,1>& dataIn, CArray<T,1>& dataOut, T missingValue) 
     101      { 
     102        transfer(1, 1, dataIn, dataOut, missingValue) ; 
     103      } 
     104 
    76105  }; 
    77106 
  • XIOS3/trunk/src/filter/file_writer_store_filter.cpp

    r2143 r2507  
    2929    if (!field->prec.isEmpty() && field->prec == 2) hasRounding_ = true ; 
    3030    if (!field->default_value.isEmpty()) {hasDefaultValue_=true ; defaultValue_ = field->default_value ;} 
     31    context->registerFileToWrite(file_) ; 
    3132  } 
    3233 
  • XIOS3/trunk/src/filter/output_pin.hpp

    r2143 r2507  
    3030       * \param inputSlot the input slot number 
    3131       */ 
    32       void connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot); 
     32      void virtual connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot); 
    3333 
    3434      /*! 
  • XIOS3/trunk/src/generate_fortran_interface.cpp

    r2338 r2507  
    5353  CDuplicateScalarToAxis duplicateScalarToAxis; 
    5454  CReduceScalarToScalar reduceScalarToScalar; 
     55 
     56  CRedistributeDomain redistributeDomain ; 
     57  CRedistributeAxis   redistributeAxis ; 
     58  CRedistributeScalar redistributeScalar ; 
    5559   
    5660  ostringstream oss; 
     
    329333  file.open((path+"ireorder_domain_attr.F90").c_str()); 
    330334  reorderDomain.generateFortranInterface(file); 
     335  file.close(); 
     336 
     337  file.open((path+"iredistribute_domain_attr.F90").c_str()); 
     338  redistributeDomain.generateFortranInterface(file); 
    331339  file.close(); 
    332340   
     
    435443  duplicateScalarToAxis.generateFortranInterface(file); 
    436444  file.close(); 
     445 
     446  file.open((path+"iredistribute_axis_attr.F90").c_str()); 
     447  redistributeAxis.generateFortranInterface(file); 
     448  file.close(); 
     449 
    437450  /*! 
    438451    Scalar transformations 
     
    488501  file.close(); 
    489502 
     503  file.open((path+"iredistribute_scalar_attr.F90").c_str()); 
     504  redistributeScalar.generateFortranInterface(file); 
     505  file.close(); 
    490506 
    491507 
  • XIOS3/trunk/src/group_factory_decl.cpp

    r2458 r2507  
    5050  macro(CPoolNodeGroup) 
    5151  macro(CServiceNodeGroup) 
     52  macro(CRedistributeDomainGroup) 
     53  macro(CRedistributeAxisGroup) 
     54  macro(CRedistributeScalarGroup) 
    5255 
    5356} 
  • XIOS3/trunk/src/group_template_decl.cpp

    r2458 r2507  
    3939  macro(PoolNode) 
    4040  macro(ServiceNode) 
     41  macro(RedistributeDomain) 
     42  macro(RedistributeAxis) 
     43  macro(RedistributeScalar) 
    4144 
    4245} 
  • XIOS3/trunk/src/io/nc4_data_input.cpp

    r2338 r2507  
    8181            if ((domain->type) != CDomain::type_attr::unstructured) 
    8282            { 
    83               start.push_back(domain->jbegin); 
    84               count.push_back(domain->nj); 
     83              start.push_back(domain->jbeginValue_); 
     84              count.push_back(domain->njValue_); 
    8585            } 
    86             start.push_back(domain->ibegin); 
    87             count.push_back(domain->ni); 
     86            start.push_back(domain->ibeginValue_); 
     87            count.push_back(domain->niValue_); 
    8888            --idxDomain; 
    8989          } 
     
    131131    // Verify the compatibility of dimension of declared grid and real grid in file 
    132132    int realGridDim = 1; 
    133     bool isUnstructuredGrid = ((gridDim < 2) ? false :  SuperClassWriter::isUnstructured(fieldId)); 
     133    bool isUnstructuredGrid = ((gridDim < 2 || domainP.size()==0) ? false :  SuperClassWriter::isUnstructured(fieldId)); 
    134134    std::map<StdString, StdSize> dimSizeMap = SuperClassWriter::getDimensions(&fieldId); 
    135135    std::list<StdString> dimList = SuperClassWriter::getDimensionsList(&fieldId); 
  • XIOS3/trunk/src/io/nc4_data_output.cpp

    r2481 r2507  
    202202                 else bounds_latid = "bounds_"+latName+appendDomid; 
    203203 
    204                  SuperClassWriter::addDimension(dimXid, domain->ni); 
    205                  SuperClassWriter::addDimension(dimYid, domain->nj); 
     204                 SuperClassWriter::addDimension(dimXid, domain->niValue_); 
     205                 SuperClassWriter::addDimension(dimYid, domain->njValue_); 
    206206 
    207207                 if (domain->hasBounds) 
     
    210210                 if (context->intraCommSize_ > 1) 
    211211                 { 
    212                    this->writeLocalAttributes(domain->ibegin, 
    213                                               domain->ni, 
    214                                               domain->jbegin, 
    215                                               domain->nj, 
     212                   this->writeLocalAttributes(domain->ibeginValue_, 
     213                                              domain->niValue_, 
     214                                              domain->jbeginValue_, 
     215                                              domain->njValue_, 
    216216                                              appendDomid); 
    217217 
    218218                   if (singleDomain) 
    219219                    this->writeLocalAttributes_IOIPSL(dimXid, dimYid, 
    220                                                       domain->ibegin, 
    221                                                       domain->ni, 
    222                                                       domain->jbegin, 
    223                                                       domain->nj, 
     220                                                      domain->ibeginValue_, 
     221                                                      domain->niValue_, 
     222                                                      domain->jbeginValue_, 
     223                                                      domain->njValue_, 
    224224                                                      domain->ni_glo,domain->nj_glo, 
    225225                                                      context->intraCommRank_,context->intraCommSize_); 
     
    373373                     std::vector<StdSize> start(2) ; 
    374374                     std::vector<StdSize> count(2) ; 
    375                      start[1]=domain->ibegin; 
    376                      start[0]=domain->jbegin; 
    377                      count[1]=domain->ni ; count[0]=domain->nj ; 
     375                     start[1]=domain->ibeginValue_; 
     376                     start[0]=domain->jbeginValue_; 
     377                     count[1]=domain->niValue_ ; count[0]=domain->njValue_ ; 
    378378 
    379379                     if (domain->hasLonLat) 
     
    391391                       std::vector<StdSize> count(1) ; 
    392392                        
    393                        start[0]=domain->jbegin; 
    394                        count[0]=domain->nj; 
     393                       start[0]=domain->jbeginValue_; 
     394                       count[0]=domain->njValue_; 
    395395                       CArray<double,1> lat; 
    396                        lat.resize( domain->nj.getValue() ); 
    397                        for (int j=0;j<domain->nj.getValue();j++) lat(j) = domain->latvalue(j*domain->ni.getValue()); 
     396                       lat.resize( domain->njValue_); 
     397                       for (int j=0;j<domain->njValue_;j++) lat(j) = domain->latvalue(j*domain->niValue_); 
    398398                       SuperClassWriter::writeData(CArray<double,1>(lat.copy()), latid, isCollective, 0,&start,&count); 
    399399 
    400                        start[0]=domain->ibegin; 
    401                        count[0]=domain->ni; 
    402                        CArray<double,1> lon = domain->lonvalue(Range(0,domain->ni-1)); 
     400                       start[0]=domain->ibeginValue_; 
     401                       count[0]=domain->niValue_; 
     402                       CArray<double,1> lon = domain->lonvalue(Range(0,domain->niValue_-1)); 
    403403                       SuperClassWriter::writeData(CArray<double,1>(lon.copy()), lonid, isCollective, 0,&start,&count); 
    404404                     } 
     
    419419                   { 
    420420                     start[2] = 0; 
    421                      start[1] = domain->ibegin; 
    422                      start[0] = domain->jbegin; 
     421                     start[1] = domain->ibeginValue_; 
     422                     start[0] = domain->jbeginValue_; 
    423423                     count[2] = domain->nvertex; 
    424                      count[1] = domain->ni; 
    425                      count[0] = domain->nj; 
     424                     count[1] = domain->niValue_; 
     425                     count[0] = domain->njValue_; 
    426426                   } 
    427427                  
     
    435435                   std::vector<StdSize> count(2); 
    436436 
    437                    start[1] = domain->ibegin; 
    438                    start[0] = domain->jbegin; 
    439                    count[1] = domain->ni; 
    440                    count[0] = domain->nj; 
     437                   start[1] = domain->ibeginValue_; 
     438                   start[0] = domain->jbeginValue_; 
     439                   count[1] = domain->niValue_; 
     440                   count[0] = domain->njValue_; 
    441441                    
    442442                   SuperClassWriter::writeData(domain->areavalue, areaId, isCollective, 0, &start, &count); 
     
    703703               else 
    704704               { 
    705                  startNodes[0] = domain->ibegin; 
    706                  countNodes[0] = domain->ni ; 
     705                 startNodes[0] = domain->ibeginValue_; 
     706                 countNodes[0] = domain->niValue_ ; 
    707707               } 
    708708 
     
    726726               else 
    727727               { 
    728                  startEdges[0] = domain->ibegin; 
    729                  countEdges[0] = domain->ni; 
     728                 startEdges[0] = domain->ibeginValue_; 
     729                 countEdges[0] = domain->niValue_; 
    730730                 startNodes[0] = domain->mesh->node_start; 
    731731                 countNodes[0] = domain->mesh->node_count; 
    732732                 if (countNodes[0]==0) startNodes[0]=0 ; // for netcdf error 
    733                  startEdgeNodes[0] = domain->ibegin; 
     733                 startEdgeNodes[0] = domain->ibeginValue_; 
    734734                 startEdgeNodes[1] = 0; 
    735                  countEdgeNodes[0] = domain->ni; 
     735                 countEdgeNodes[0] = domain->niValue_; 
    736736                 countEdgeNodes[1] = 2; 
    737737               } 
     
    763763               else 
    764764               { 
    765                  startFaces[0] = domain->ibegin; 
    766                  countFaces[0] = domain->ni ; 
     765                 startFaces[0] = domain->ibeginValue_; 
     766                 countFaces[0] = domain->niValue_ ; 
    767767                 startNodes[0] = domain->mesh->node_start; 
    768768                 countNodes[0] = domain->mesh->node_count; 
     
    785785                 countEdgeFaces[1]= 2; 
    786786                  
    787                  startFaceConctv[0] = domain->ibegin; 
    788                  countFaceConctv[0] = domain->ni; 
     787                 startFaceConctv[0] = domain->ibeginValue_; 
     788                 countFaceConctv[0] = domain->niValue_; 
    789789                 startFaceConctv[1] = 0; 
    790790                 countFaceConctv[1] = domain->nvertex; 
     
    998998                 else 
    999999                 { 
    1000                    start[0]=domain->ibegin; 
    1001                    count[0]=domain->ni; 
    1002                    startBounds[0]=domain->ibegin; 
     1000                   start[0]=domain->ibeginValue_; 
     1001                   count[0]=domain->niValue_; 
     1002                   startBounds[0]=domain->ibeginValue_; 
    10031003                   startBounds[1]=0 ; 
    1004                    countBounds[0]=domain->ni; 
     1004                   countBounds[0]=domain->niValue_; 
    10051005                   countBounds[1]=nvertex ; 
    10061006                 } 
     
    11101110          if (!axis->label.isEmpty() && !SuperClassWriter::dimExist(strId)) SuperClassWriter::addDimension(strId, stringArrayLen); 
    11111111 
    1112           if (axis->hasValue || !axis->label.isEmpty()) 
     1112          if (axis->hasValue() || !axis->label.isEmpty()) 
    11131113          { 
    11141114            if (!axis->label.isEmpty()) dims.push_back(strId); 
     
    14991499              } 
    15001500 
    1501               firstGlobalIndex = domain->ibegin + domain->jbegin * domain->ni_glo; 
     1501              firstGlobalIndex = domain->ibeginValue_ + domain->jbeginValue_ * domain->ni_glo; 
    15021502 
    15031503              domain->addRelFileCompressed(this->filename); 
     
    23232323                        if ((domain->type) != CDomain::type_attr::unstructured) 
    23242324                        { 
    2325                           start.push_back(domain->jbegin); 
    2326                           count.push_back(domain->nj); 
     2325                          start.push_back(domain->jbeginValue_); 
     2326                          count.push_back(domain->njValue_); 
    23272327                        } 
    23282328                        --idx; 
    2329                         start.push_back(domain->ibegin); 
    2330                         count.push_back(domain->ni); 
     2329                        start.push_back(domain->ibeginValue_); 
     2330                        count.push_back(domain->niValue_); 
    23312331                        --idx; 
    23322332                      } 
     
    23832383                      if ((domain->type) != CDomain::type_attr::unstructured) 
    23842384                      { 
    2385                         start.push_back(domain->jbegin); 
    2386                         count.push_back(domain->nj); 
     2385                        start.push_back(domain->jbeginValue_); 
     2386                        count.push_back(domain->njValue_); 
    23872387                      } 
    23882388                      --idx ; 
    23892389 
    2390                         start.push_back(domain->ibegin); 
    2391                         count.push_back(domain->ni); 
     2390                        start.push_back(domain->ibeginValue_); 
     2391                        count.push_back(domain->niValue_); 
    23922392                      --idx ; 
    23932393                      --idxDomain; 
  • XIOS3/trunk/src/manager/services_manager.cpp

    r2498 r2507  
    227227    int leader ; 
    228228 
    229     services_.clear() ; 
    230229    int nbServices ; 
    231230    buffer>>nbServices ; 
     231    bool newServices = nbServices != services_.size() ;  
     232 
     233    services_.clear() ; 
    232234 
    233235    for(int i=0;i<nbServices;i++)  
     
    235237      buffer>>poolId>>serviceId>>partitionId>>type>>size>>nbPartitions>>leader ; 
    236238      services_[std::tuple<std::string,std::string,int>(poolId,serviceId,partitionId)]=std::make_tuple(type,size,nbPartitions,leader) ; 
     239      if (newServices) 
     240        info(40)<<"Receive new services informations : "<<poolId<<"::"<<serviceId<<"::"<<partitionId<<" => type : "<<type<<"  size : "<<size<<"  nbPartitions : "<<nbPartitions<<"  leader : "<<leader<<endl ; 
    237241    } 
    238242  } 
     
    256260                                        int& size, int& nbPartitions, int& leader, bool wait) 
    257261  { 
    258      
    259262    winServices_->lockWindowShared(managerGlobalLeader_) ; 
    260263    winServices_->updateFromLockedWindow(managerGlobalLeader_, this, &CServicesManager::servicesDumpIn) ; 
    261264    winServices_->unlockWindow(managerGlobalLeader_) ; 
    262  
     265     
     266    if (wait) waitServiceRegistration(poolId, serviceId, partitionId) ; 
    263267    auto it=services_.find(std::tuple<std::string,std::string,int>(poolId,serviceId,partitionId)) ; 
    264     if ( it == services_.end() && !wait) return false ; 
     268    if ( it == services_.end()) return false ; 
    265269    else 
    266270    { 
    267       if (wait) waitServiceRegistration(poolId, serviceId, partitionId) ; 
    268271      type= std::get<0>(it->second);  
    269272      size= std::get<1>(it->second);  
     
    279282    int size ; 
    280283    int nbPartitions; 
    281     //return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ; 
    282     return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader) ; 
     284    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ; 
    283285  } 
    284286 
     
    288290    int nbPartitions; 
    289291    int leader; 
    290     //return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ; 
    291     return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader) ; 
     292    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ; 
    292293  } 
    293294 
     
    297298    int type; 
    298299    int leader; 
    299     //return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ; 
    300     return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader) ; 
     300    return getServiceInfo(poolId, serviceId, partitionId, type, size, nbPartitions, leader, wait) ; 
    301301  } 
    302302 
    303303  bool CServicesManager::hasService(const std::string& poolId, const std::string& serviceId, const int& partitionId) 
    304304  { 
    305     winServices_->lockWindow(managerGlobalLeader_,0) ; 
    306     winServices_->updateFromWindow(managerGlobalLeader_, this, &CServicesManager::servicesDumpIn) ; 
    307     winServices_->unlockWindow(managerGlobalLeader_,0) ; 
     305    winServices_->lockWindowShared(managerGlobalLeader_) ; 
     306    winServices_->updateFromLockedWindow(managerGlobalLeader_, this, &CServicesManager::servicesDumpIn) ; 
     307    winServices_->unlockWindow(managerGlobalLeader_) ; 
    308308    auto it=services_.find(std::tuple<std::string, std::string, int>(poolId, serviceId, partitionId)) ; 
    309309    if ( it == services_.end()) return false ; 
  • XIOS3/trunk/src/mpi_tools.cpp

    r2118 r2507  
    2828 
    2929  template<> 
     30  MPI_Datatype MPI_GetType<bool>(void) { return MPI_CXX_BOOL ;} 
     31 
     32  template<> 
    3033  MPI_Datatype MPI_GetType<char>(void) { return MPI_CHAR ;} 
    3134 
  • XIOS3/trunk/src/node/axis.cpp

    r2397 r2507  
    2424      : CObjectTemplate<CAxis>() 
    2525      , CAxisAttributes(), isChecked(false), relFiles() 
    26       , hasBounds(false), isCompressible_(false) 
    27       , transformationMap_(), hasValue(false), hasLabel(false) 
     26      , hasBounds_(false), isCompressible_(false) 
     27      , transformationMap_() 
    2828      , clients() 
    2929   { 
     
    3333      : CObjectTemplate<CAxis>(id) 
    3434      , CAxisAttributes(), isChecked(false), relFiles() 
    35       , hasBounds(false), isCompressible_(false) 
    36       , transformationMap_(), hasValue(false), hasLabel(false) 
     35      , hasBounds_(false), isCompressible_(false) 
     36      , transformationMap_() 
    3737      , clients() 
    3838   { 
     
    5656     m["temporal_splitting"] = TRANS_TEMPORAL_SPLITTING; 
    5757     m["duplicate_scalar"] = TRANS_DUPLICATE_SCALAR_TO_AXIS; 
     58     m["redistribute_axis"] = TRANS_REDISTRIBUTE_AXIS; 
     59 
    5860     return true; 
    5961   } 
     
    165167         size += CArray<bool,1>::size(n_glo); 
    166168         size += CArray<double,1>::size(n_glo); 
    167          if (hasBounds) 
     169         if (hasBounds_) 
    168170           size += CArray<double,2>::size(2*n_glo); 
    169          if (hasLabel) 
     171         if (hasLabel_) 
    170172          size += CArray<StdString,1>::size(n_glo); 
    171173       } 
     
    198200         size += CArray<bool,1>::size(it->second.size()); 
    199201         size += CArray<double,1>::size(it->second.size()); 
    200          if (hasBounds) 
     202         if (hasBounds_) 
    201203           size += CArray<double,2>::size(2 * it->second.size()); 
    202          if (hasLabel) 
     204         if (hasLabel_) 
    203205           size += CArray<StdString,1>::size(it->second.size()); 
    204206 
     
    457459                                   << ") than the one defined by the \'size\' attribute (" << n.getValue() << ").") 
    458460          else return false ;  
    459         this->hasValue = true; 
     461        this->hasValue_ = true; 
    460462      } 
    461463 
     
    567569                               << "Bounds size is "<< bounds.extent(0) << " x " << bounds.extent(1) << ".") 
    568570         else return false ; 
    569        hasBounds = true; 
    570      } 
    571      else hasBounds = false; 
     571       hasBounds_ = true; 
     572     } 
     573     else hasBounds_ = false; 
    572574     return true ; 
    573575   } 
     
    585587                              << "label size is "<< label.extent(0)<<  " .") 
    586588        else return false ; 
    587       hasLabel = true; 
    588     } 
    589     else hasLabel = false; 
     589      hasLabel_ = true; 
     590    } 
     591    else hasLabel_ = false; 
    590592    return true ; 
    591593  } 
     
    11631165    CContext* context = CContext::getCurrent(); 
    11641166 
    1165     if (hasValue) 
     1167    if (hasValue_) 
    11661168    { 
    11671169      { // send level value 
     
    11731175    } 
    11741176 
    1175     if (hasBounds) 
     1177    if (hasBounds_) 
    11761178    { 
    11771179      { // send bounds level value 
     
    11831185    } 
    11841186 
    1185     if (hasLabel) 
     1187    if (hasLabel_) 
    11861188    { 
    11871189      { // send label 
  • XIOS3/trunk/src/node/axis.hpp

    r2397 r2507  
    175175         bool isEqual(CAxis* axis); 
    176176 
    177       public:  
    178         bool hasValue;         
    179         bool hasBounds; 
    180         bool hasLabel; 
     177      private:  
     178        bool hasValue_= false;         
     179        bool hasBounds_= false; 
     180        bool hasLabel_= false; 
     181      public: 
     182        bool hasValue(void) { return hasValue_ ;} 
     183        bool hasBounds(void) { return hasBounds_ ;} 
     184        bool hasLabel(void) { return hasLabel_ ;} 
    181185 
    182186      private: 
  • XIOS3/trunk/src/node/context.cpp

    r2498 r2507  
    77#include "duration.hpp" 
    88 
     9#include "online_context_client.hpp" 
    910#include "legacy_context_client.hpp" 
    1011#include "legacy_context_server.hpp" 
     
    662663       
    663664      int serviceType ; 
    664       //if (intraCommRank_==0) CXios::getServicesManager()->getServiceType(poolId, serviceId, 0, serviceType, true) ; 
    665       if (intraCommRank_==0) CXios::getServicesManager()->getServiceType(poolId, serviceId, 0, serviceType) ; 
     665      if (intraCommRank_==0) CXios::getServicesManager()->getServiceType(poolId, serviceId, 0, serviceType, true) ; 
    666666      MPI_Bcast(&serviceType,1,MPI_INT,0,intraComm_) ; 
    667667       
     
    679679  vector<CContextClient*> CContext::getContextClient(const string& poolId, const string& serviceId) 
    680680  { 
    681     vector<pair<CContextClient*,CContextServer*>> clientServers ; 
    682     getServerInterComm(poolId, serviceId, clientServers ) ; 
    683     vector<CContextClient*> ret ; 
    684     for(auto& clientServer : clientServers) ret.push_back(clientServer.first) ; 
     681     vector<CContextClient*> ret ; 
     682     
     683    if (serviceId=="attached") ret.push_back(onlineContextClient_) ; 
     684    else 
     685    { 
     686      vector<pair<CContextClient*,CContextServer*>> clientServers ; 
     687      getServerInterComm(poolId, serviceId, clientServers ) ; 
     688      for(auto& clientServer : clientServers) ret.push_back(clientServer.first) ; 
     689    } 
    685690    return ret ; 
    686691  } 
     
    808813      if (serviceType_==CServicesManager::CLIENT) 
    809814      { 
    810 //ym        doPreTimestepOperationsForEnabledReadModeFiles(); // For now we only use server level 1 to read data 
    811815        triggerLateFields() ; 
    812816 
     
    986990 
    987991     CTimer::get("Context : close definition").resume() ; 
     992 
     993     onlineContextClient_=CContextClient::getNew<CContextClient::online>(this,intraComm_, intraComm_); 
    988994           
    989995     // create intercommunicator with servers.  
     
    11461152    { 
    11471153      for(auto field : fileInField)  
    1148       { 
    1149         field->sendFieldToInputFileServer() ; 
    1150         field->connectToServerInput(garbageCollector) ; // connect the field to server filter 
     1154        if (field->getContextClient()->getType() != CContextClient::online) field->sendFieldToInputFileServer() ; 
     1155 
     1156      for(auto field : fileInField)  
     1157      { 
     1158        if (field->getContextClient()->getType() == CContextClient::online) field->connectToOnlineReader(garbageCollector) ; 
     1159        else field->connectToServerInput(garbageCollector) ; // connect the field to server filter 
    11511160        fileInFields_.push_back(field) ; 
    11521161      } 
     
    11581167      for(auto field : fileOutField)  
    11591168      { 
    1160         field->connectToFileServer(garbageCollector) ; // connect the field to server filter 
    1161       } 
    1162       for(auto field : fileOutField) field->sendFieldToFileServer() ; 
     1169        if (field->getContextClient()->getType() == CContextClient::online)  field->connectToOnlineWriter(garbageCollector) ; 
     1170        else  field->connectToFileServer(garbageCollector) ; // connect the field to server filter 
     1171      } 
     1172      for(auto field : fileOutField)  
     1173        if (field->getContextClient()->getType() != CContextClient::online) field->sendFieldToFileServer() ; 
    11631174    } 
    11641175 
     
    11771188      for(auto field : fileInField)  
    11781189      { 
    1179         field->connectToServerToClient(garbageCollector) ; 
     1190        if (field->getContextClient()->getType() == CContextClient::online) field->connectToOnlineReader(garbageCollector) ; 
     1191        else field->connectToServerToClient(garbageCollector) ; 
    11801192      } 
    11811193    } 
     
    12321244    if (serviceType_==CServicesManager::CLIENT)  
    12331245    { 
    1234       for(auto field : fileOutField) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ;  
    1235       for(auto field : fileInField) slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ;  
     1246      for(auto field : fileOutField) 
     1247        if (field->getContextClient()->getType()!=CContextClient::online)  slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ;  
     1248      for(auto field : fileInField)  
     1249        if (field->getContextClient()->getType()!=CContextClient::online)  slaves[clientsId_[field->getContextClient()]] = field->getContextClient() ;  
    12361250    } 
    12371251    else if (serviceType_==CServicesManager::GATHERER)  
     
    12421256    for(auto& slaveServer : slaveServers_) sendCloseDefinition(slaveServer) ; 
    12431257 
    1244     if (serviceType_==CServicesManager::WRITER)   
    1245     { 
    1246       createFileHeader(); 
    1247     } 
    1248  
    1249     if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles(); 
     1258    createFileHeader(); 
     1259    
     1260    //if (serviceType_==CServicesManager::CLIENT) startPrefetchingOfEnabledReadModeFiles(); 
     1261    if (serviceType_==CServicesManager::CLIENT)  
     1262       for(auto field : fileInField) field->sendReadDataRequest(getCalendar()->getCurrentDate());   
    12501263    
    12511264    // send signal to couplerIn context that definition phasis is done 
     
    13561369   CATCH_DUMP_ATTR 
    13571370 
    1358  
    1359    void CContext::postProcessFilterGraph() 
    1360    TRY 
    1361    { 
    1362      int size = enabledFiles.size(); 
    1363      for (int i = 0; i < size; ++i) 
    1364      { 
    1365         enabledFiles[i]->postProcessFilterGraph(); 
    1366      } 
    1367    } 
    1368    CATCH_DUMP_ATTR 
    1369  
    13701371   void CContext::startPrefetchingOfEnabledReadModeFiles() 
    13711372   TRY 
     
    13751376     { 
    13761377        enabledReadModeFiles[i]->prefetchEnabledReadModeFields(); 
    1377      } 
    1378    } 
    1379    CATCH_DUMP_ATTR 
    1380  
    1381    void CContext::doPreTimestepOperationsForEnabledReadModeFiles() 
    1382    TRY 
    1383    { 
    1384      int size = enabledReadModeFiles.size(); 
    1385      for (int i = 0; i < size; ++i) 
    1386      { 
    1387         enabledReadModeFiles[i]->doPreTimestepOperationsForEnabledReadModeFields(); 
    13881378     } 
    13891379   } 
     
    21772167        if (serviceType_==CServicesManager::CLIENT) // For now we only use server level 1 to read data 
    21782168        { 
    2179           doPostTimestepOperationsForEnabledReadModeFiles(); 
     2169         // doPostTimestepOperationsForEnabledReadModeFiles(); 
     2170          for(auto& field : fileInFields_) field->sendReadDataRequestIfNeeded() ; 
    21802171          garbageCollector.invalidate(calendar->getCurrentDate()); 
    21812172        } 
     
    22022193   CATCH_DUMP_ATTR 
    22032194 
    2204    //! Server side: Create header of netcdf file 
     2195   //! Create header of netcdf file 
    22052196   void CContext::createFileHeader(void) 
    22062197   TRY 
    22072198   { 
    2208       vector<CFile*>::const_iterator it; 
    2209  
    2210       //for (it=enabledFiles.begin(); it != enabledFiles.end(); it++) 
    2211       for (it=enabledWriteModeFiles.begin(); it != enabledWriteModeFiles.end(); it++) 
    2212       { 
    2213          (*it)->initWrite(); 
    2214       } 
     2199      for(auto& file : filesToWrite_) file->initWrite(); 
    22152200   } 
    22162201   CATCH_DUMP_ATTR 
  • XIOS3/trunk/src/node/context.hpp

    r2458 r2507  
    141141         void initReadFiles(void); 
    142142         void prepareTimeseries(void); 
    143          void postProcessFilterGraph(); 
    144143         void startPrefetchingOfEnabledReadModeFiles(); 
    145          void doPreTimestepOperationsForEnabledReadModeFiles(); 
    146144         void doPostTimestepOperationsForEnabledReadModeFiles(); 
    147145         void findFieldsWithReadAccess(void); 
     
    298296         // Determine context on server or not 
    299297         bool hasServer; 
    300  
     298      public: 
     299        void registerFileToWrite(CFile* file) { filesToWrite_.insert(file); } // Add a file that need to be write for example to create headers 
     300      private:   
     301        std::set<CFile*> filesToWrite_ ;   
    301302 
    302303      private: 
     304        CContextClient* onlineContextClient_=nullptr ; 
     305         
    303306        std::string defaultPoolWriterId_ ; 
    304307        std::string defaultPoolReaderId_ ; 
  • XIOS3/trunk/src/node/domain.cpp

    r2424 r2507  
    293293    \param [in] nbLocalDomain number of local domain on the domain destination 
    294294   */ 
     295 
    295296   void CDomain::redistribute(int nbLocalDomain) 
    296297   TRY 
     
    862863         
    863864 
    864         if (!area.isEmpty()) area.transposeSelf(1, 0); // => to be checked why is it transposed 
     865//        if (!area.isEmpty()) area.transposeSelf(1, 0); // => to be checked why is it transposed 
    865866     } 
    866867 
     
    914915   CATCH_DUMP_ATTR 
    915916 
     917   void CDomain::compute2dBox(void) 
     918   { 
     919     if (i_index.numElements()==0) 
     920     { 
     921       ibeginValue_= 0 ; 
     922       jbeginValue_= 0 ; 
     923       niValue_= 0 ; 
     924       njValue_= 0 ; 
     925     } 
     926     else 
     927     { 
     928       int maxI=0 ; 
     929       int maxJ=0 ; 
     930       int minI=nj_glo*ni_glo ; 
     931       int minJ=nj_glo*ni_glo ; 
     932       int i,j,k,ij ; 
     933       for(int k=0; k<i_index.numElements(); k++) 
     934       { 
     935         ij=j_index(k)*ni_glo + i_index(k) ; 
     936         i=ij%ni_glo ; 
     937         j=ij/ni_glo ; 
     938         if (i<minI) minI=i; 
     939         if (j<minJ) minJ=j; 
     940         if (i>maxI) maxI=i; 
     941         if (j>maxJ) maxJ=j; 
     942       } 
     943       ibeginValue_=minI ; 
     944       jbeginValue_=minJ ; 
     945       niValue_=maxI-minI+1 ; 
     946       njValue_=maxJ-minJ+1 ; 
     947     } 
     948   } 
     949 
    916950   size_t CDomain::getGlobalWrittenSize(void) 
    917951   { 
     
    943977        {           
    944978         // No information about ni 
    945           int minIndex = ni_glo - 1; 
     979          int minIndex = ni_glo*nj_glo - 1; 
    946980          int maxIndex = 0; 
    947981          for (int idx = 0; idx < i_index.numElements(); ++idx) 
     
    950984            if (i_index(idx) > maxIndex) maxIndex = i_index(idx); 
    951985          } 
    952           if (i_index.numElements()) { 
     986                if (i_index.numElements()) 
     987          { 
    953988            ni = maxIndex - minIndex + 1;  
    954989            minIIndex = minIndex; 
    955990          }          
    956           else { 
    957             ni = 0; 
    958           } 
    959         } 
     991                else ni = 0; 
     992              } 
    960993 
    961994        // It's not so correct but if ibegin is not the first value of i_index  
     
    10101043        { 
    10111044          // No information about nj 
    1012           int minIndex = nj_glo - 1; 
     1045          int minIndex = ni_glo*nj_glo - 1; 
    10131046          int maxIndex = 0; 
    10141047          for (int idx = 0; idx < j_index.numElements(); ++idx) 
     
    13541387     } 
    13551388     else if (!lonvalue_1d.isEmpty()  && !lonlatValueExisted) 
     1389     { 
     1390       if (type_attr::rectilinear == type) 
     1391       { 
     1392         if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements()) 
     1393         { 
     1394           lonvalue.resize(ni * nj); 
     1395           latvalue.resize(ni * nj); 
     1396           if (hasBounds) 
     1397           { 
     1398             bounds_lonvalue.resize(nvertex, ni * nj); 
     1399             bounds_latvalue.resize(nvertex, ni * nj); 
     1400           } 
     1401 
     1402           for (int j = 0; j < nj; ++j) 
     1403           { 
     1404             for (int i = 0; i < ni; ++i) 
     1405             { 
     1406               int k = j * ni + i; 
     1407 
     1408               lonvalue(k) = lonvalue_1d(i); 
     1409               latvalue(k) = latvalue_1d(j); 
     1410 
     1411               if (hasBounds) 
     1412               { 
     1413                 for (int n = 0; n < nvertex; ++n) 
     1414                 { 
     1415                   bounds_lonvalue(n,k) = bounds_lon_1d(n,i); 
     1416                   bounds_latvalue(n,k) = bounds_lat_1d(n,j); 
     1417                 } 
     1418               } 
     1419             } 
     1420           } 
     1421         } 
     1422         else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements()  && !lonlatValueExisted) 
     1423         { 
     1424           lonvalue.reference(lonvalue_1d.copy()); 
     1425           latvalue.reference(latvalue_1d.copy()); 
     1426           if (hasBounds) 
     1427           { 
     1428             bounds_lonvalue.reference(bounds_lon_1d.copy()); 
     1429             bounds_latvalue.reference(bounds_lat_1d.copy()); 
     1430           } 
     1431         } 
     1432         else 
     1433           ERROR("CDomain::completeLonClient(void)", 
     1434                 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
     1435                 << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl 
     1436                 << "'lonvalue_1d' size is " << lonvalue_1d.numElements()  
     1437                 << " and 'latvalue_1d' size is " << latvalue_1d.numElements() << std::endl  
     1438                 << " They should be correspondingly " << ni.getValue() << " and "  << nj.getValue() << " or " << std::endl 
     1439                 << i_index.numElements() << " and "  << j_index.numElements() << "."); 
     1440       } 
     1441       else if (type == type_attr::curvilinear || type == type_attr::unstructured  && !lonlatValueExisted) 
     1442       { 
     1443         lonvalue.reference(lonvalue_1d.copy()); 
     1444         latvalue.reference(latvalue_1d.copy()); 
     1445         if (hasBounds) 
     1446         { 
     1447           bounds_lonvalue.reference(bounds_lon_1d.copy()); 
     1448           bounds_latvalue.reference(bounds_lat_1d.copy()); 
     1449         } 
     1450       } 
     1451     } 
     1452 
     1453     if (!area_2d.isEmpty() && areavalue.isEmpty()) 
     1454     { 
     1455       areavalue.resize(ni*nj); 
     1456       for (int j = 0; j < nj; ++j) 
     1457       { 
     1458         for (int i = 0; i < ni; ++i) 
     1459         { 
     1460           int k = j * ni + i; 
     1461           areavalue(k) = area_2d(i,j); 
     1462         } 
     1463       } 
     1464     } 
     1465     else if (!area_1d.isEmpty() && areavalue.isEmpty()) areavalue.reference(area_1d.copy()); 
     1466 
     1467   } 
     1468   CATCH_DUMP_ATTR 
     1469 
     1470   /* 
     1471     Convert internal longitude latitude value used by XIOS to "lonvalue_*" which can be retrieved with Fortran interface 
     1472   */ 
     1473   void CDomain::convertLonLatValue(void) 
     1474   TRY 
     1475   { 
     1476     bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
     1477     if (!lonvalue_2d.isEmpty() && lonlatValueExisted) 
     1478     { 
     1479       lonvalue_2d.resize(ni,nj); 
     1480       latvalue_2d.resize(ni,nj); 
     1481       if (hasBounds) 
     1482       { 
     1483         bounds_lon_2d.resize(nvertex, ni, nj); 
     1484         bounds_lat_2d.resize(nvertex, ni, nj); 
     1485       } 
     1486 
     1487       for (int j = 0; j < nj; ++j) 
     1488       { 
     1489         for (int i = 0; i < ni; ++i) 
     1490         { 
     1491           int k = j * ni + i; 
     1492 
     1493           lonvalue_2d(i,j) = lonvalue(k); 
     1494           latvalue_2d(i,j) = latvalue(k); 
     1495 
     1496           if (hasBounds) 
     1497           { 
     1498             for (int n = 0; n < nvertex; ++n) 
     1499             { 
     1500               bounds_lon_2d(n,i,j) = bounds_lonvalue(n,k); 
     1501               bounds_lat_2d(n,i,j) = bounds_latvalue(n,k); 
     1502             } 
     1503           } 
     1504         } 
     1505       } 
     1506     } 
     1507     else if (!lonvalue_1d.isEmpty()  && lonlatValueExisted) 
    13561508     { 
    13571509       if (type_attr::rectilinear == type) 
     
    14171569       } 
    14181570     } 
    1419  
    1420      if (!area.isEmpty() && areavalue.isEmpty()) 
    1421      { 
    1422         areavalue.resize(ni*nj); 
    1423        for (int j = 0; j < nj; ++j) 
    1424        { 
    1425          for (int i = 0; i < ni; ++i) 
    1426          { 
    1427            int k = j * ni + i; 
    1428            areavalue(k) = area(i,j); 
    1429          } 
    1430        } 
    1431      } 
    1432    } 
    1433    CATCH_DUMP_ATTR 
    1434  
    1435    /* 
    1436      Convert internal longitude latitude value used by XIOS to "lonvalue_*" which can be retrieved with Fortran interface 
    1437    */ 
    1438    void CDomain::convertLonLatValue(void) 
    1439    TRY 
    1440    { 
    1441      bool lonlatValueExisted = (0 != lonvalue.numElements()) || (0 != latvalue.numElements()); 
    1442      if (!lonvalue_2d.isEmpty() && lonlatValueExisted) 
    1443      { 
    1444        lonvalue_2d.resize(ni,nj); 
    1445        latvalue_2d.resize(ni,nj); 
    1446        if (hasBounds) 
    1447        { 
    1448          bounds_lon_2d.resize(nvertex, ni, nj); 
    1449          bounds_lat_2d.resize(nvertex, ni, nj); 
    1450        } 
    1451  
    1452        for (int j = 0; j < nj; ++j) 
    1453        { 
    1454          for (int i = 0; i < ni; ++i) 
    1455          { 
    1456            int k = j * ni + i; 
    1457  
    1458            lonvalue_2d(i,j) = lonvalue(k); 
    1459            latvalue_2d(i,j) = latvalue(k); 
    1460  
    1461            if (hasBounds) 
    1462            { 
    1463              for (int n = 0; n < nvertex; ++n) 
    1464              { 
    1465                bounds_lon_2d(n,i,j) = bounds_lonvalue(n,k); 
    1466                bounds_lat_2d(n,i,j) = bounds_latvalue(n,k); 
    1467              } 
    1468            } 
    1469          } 
    1470        } 
    1471      } 
    1472      else if (!lonvalue_1d.isEmpty()  && lonlatValueExisted) 
    1473      { 
    1474        if (type_attr::rectilinear == type) 
    1475        { 
    1476          if (ni == lonvalue_1d.numElements() && nj == latvalue_1d.numElements()) 
    1477          { 
    1478            lonvalue.resize(ni * nj); 
    1479            latvalue.resize(ni * nj); 
    1480            if (hasBounds) 
    1481            { 
    1482              bounds_lonvalue.resize(nvertex, ni * nj); 
    1483              bounds_latvalue.resize(nvertex, ni * nj); 
    1484            } 
    1485  
    1486            for (int j = 0; j < nj; ++j) 
    1487            { 
    1488              for (int i = 0; i < ni; ++i) 
    1489              { 
    1490                int k = j * ni + i; 
    1491  
    1492                lonvalue(k) = lonvalue_1d(i); 
    1493                latvalue(k) = latvalue_1d(j); 
    1494  
    1495                if (hasBounds) 
    1496                { 
    1497                  for (int n = 0; n < nvertex; ++n) 
    1498                  { 
    1499                    bounds_lonvalue(n,k) = bounds_lon_1d(n,i); 
    1500                    bounds_latvalue(n,k) = bounds_lat_1d(n,j); 
    1501                  } 
    1502                } 
    1503              } 
    1504            } 
    1505          } 
    1506          else if (i_index.numElements() == lonvalue_1d.numElements() && j_index.numElements() == latvalue_1d.numElements()  && !lonlatValueExisted) 
    1507          { 
    1508            lonvalue.reference(lonvalue_1d); 
    1509            latvalue.reference(latvalue_1d); 
    1510             if (hasBounds) 
    1511            { 
    1512              bounds_lonvalue.reference(bounds_lon_1d); 
    1513              bounds_latvalue.reference(bounds_lat_1d); 
    1514            } 
    1515          } 
    1516          else 
    1517            ERROR("CDomain::completeLonClient(void)", 
    1518                  << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
    1519                  << "'lonvalue_1d' and 'latvalue_1d' does not have the same size as the local domain." << std::endl 
    1520                  << "'lonvalue_1d' size is " << lonvalue_1d.numElements()  
    1521                  << " and 'latvalue_1d' size is " << latvalue_1d.numElements() << std::endl  
    1522                  << " They should be correspondingly " << ni.getValue() << " and "  << nj.getValue() << " or " << std::endl 
    1523                  << i_index.numElements() << " and "  << j_index.numElements() << "."); 
    1524        } 
    1525        else if (type == type_attr::curvilinear || type == type_attr::unstructured  && !lonlatValueExisted) 
    1526        { 
    1527          lonvalue.reference(lonvalue_1d); 
    1528          latvalue.reference(latvalue_1d); 
    1529          if (hasBounds) 
    1530          { 
    1531            bounds_lonvalue.reference(bounds_lon_1d); 
    1532            bounds_latvalue.reference(bounds_lat_1d); 
    1533          } 
    1534        } 
    1535      } 
    15361571   } 
    15371572   CATCH_DUMP_ATTR 
     
    16361671   { 
    16371672     bool hasAreaValue = (!areavalue.isEmpty() && 0 != areavalue.numElements()); 
    1638      hasArea = !area.isEmpty(); 
     1673     hasArea = !area_1d.isEmpty() || !area_2d.isEmpty(); 
    16391674     if (hasArea && !hasAreaValue) 
    16401675     { 
    1641        if (area.extent(0) != ni || area.extent(1) != nj) 
     1676       if (!area_2d.isEmpty() && (area_2d.extent(0) != ni || area_2d.extent(1) != nj)) 
    16421677       { 
    16431678         ERROR("CDomain::checkArea(void)", 
     
    16451680               << "The area does not have the same size as the local domain." << std::endl 
    16461681               << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 
    1647                << "Area size is " << area.extent(0) << " x " << area.extent(1) << "."); 
    1648        } 
    1649 //       if (areavalue.isEmpty()) 
    1650 //       { 
    1651 //          areavalue.resize(ni*nj); 
    1652 //         for (int j = 0; j < nj; ++j) 
    1653 //         { 
    1654 //           for (int i = 0; i < ni; ++i) 
    1655 //           { 
    1656 //             int k = j * ni + i; 
    1657 //             areavalue(k) = area(i,j); 
    1658 //           } 
    1659 //         } 
    1660 //       } 
     1682               << "Area size is " << area_2d.extent(0) << " x " << area_2d.extent(1) << "."); 
     1683       } 
     1684        
     1685       if (!area_1d.isEmpty() && area_1d.extent(0) != ni*nj) 
     1686       { 
     1687         ERROR("CDomain::checkArea(void)", 
     1688               << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " 
     1689               << "The area does not have the same size as the local domain." << std::endl 
     1690               << "Local size is " << ni.getValue() << " x " << nj.getValue() << "." << std::endl 
     1691               << "Area size is " << area_1d.extent(0) << " but must be ni*nj=" << ni*nj << " ."); 
     1692       } 
     1693 
    16611694     } 
    16621695   } 
     
    17311764      if (this->checkAttributes_done_) return; 
    17321765      this->checkDomain(); 
     1766      this->compute2dBox() ; 
    17331767      this->checkLonLat(); 
    17341768      this->checkBounds(); 
     
    18031837     excludedAttr.insert(excludedAttr.end(), { "mask_1d", "mask_2d" }); // ??? 
    18041838     excludedAttr.insert(excludedAttr.end(), { "bounds_lon_1d", "bounds_lat_1d", "bounds_lon_2d", "bounds_lat_2d" }); 
    1805      excludedAttr.insert(excludedAttr.end(), { "area" }); 
     1839     excludedAttr.insert(excludedAttr.end(), { "area_1d", "area_2d" }); 
    18061840     // private 
    18071841     excludedAttr.insert(excludedAttr.end(), { "lon_start", "lon_end", "lat_start", "lat_end" }); 
     
    19521986    CContext* context = CContext::getCurrent(); 
    19531987    map<int, CArray<size_t,1>> globalIndex ; 
    1954 /* old method 
    1955     if (type==EDistributionType::BANDS) // Bands distribution to send to file server 
    1956     { 
    1957       int nbServer = client->getRemoteSize(); 
    1958       std::vector<int> nGlobDomain(2); 
    1959       nGlobDomain[0] = this->ni_glo; 
    1960       nGlobDomain[1] = this->nj_glo; 
    1961  
    1962       // to be changed in future, need to rewrite more simply domain distribution 
    1963       CServerDistributionDescription serverDescription(nGlobDomain, nbServer); 
    1964       int distributedPosition ; 
    1965       if (isUnstructed_) distributedPosition = 0 ; 
    1966       else distributedPosition = 1 ; 
    1967        
    1968       std::vector<std::vector<int> > serverIndexBegin = serverDescription.getServerIndexBegin(); 
    1969       std::vector<std::vector<int> > serverDimensionSizes = serverDescription.getServerDimensionSizes(); 
    1970       vector<unordered_map<size_t,vector<int>>> indexServerOnElement ; 
    1971       CArray<int,1> axisDomainOrder(1) ; axisDomainOrder(0)=2 ; 
    1972       auto zeroIndex=serverDescription.computeServerGlobalByElement(indexServerOnElement, context->getIntraCommRank(), context->getIntraCommSize(), 
    1973                                                                   axisDomainOrder,distributedPosition) ; 
    1974       // distribution is very bad => to redo 
    1975       // convert indexServerOnElement => map<int,CArray<size_t,1>> - need to be changed later 
    1976       map<int, vector<size_t>> vectGlobalIndex ; 
    1977       for(auto& indexRanks : indexServerOnElement[0]) 
    1978       { 
    1979         size_t index=indexRanks.first ; 
    1980         auto& ranks=indexRanks.second ; 
    1981         for(int rank : ranks) vectGlobalIndex[rank].push_back(index) ; 
    1982       } 
    1983       for(auto& vect : vectGlobalIndex ) globalIndex.emplace(vect.first, CArray<size_t,1>(vect.second.data(), shape(vect.second.size()),duplicateData)) ; 
    1984     // some servers receves no index (zeroIndex array) => root process take them into account. 
    1985       if (context->getIntraCommRank()==0)  
    1986         for(auto& rank : zeroIndex) globalIndex[rank] = CArray<size_t,1>() ;  
    1987     } 
    1988 */     
     1988 
    19891989    if (distType==EDistributionType::BANDS && isUnstructed_) distType=EDistributionType::COLUMNS ; 
    19901990 
     
    21342134  CATCH 
    21352135 
    2136   
    2137  
    21382136  void CDomain::distributeToServer(CContextClient* client, bool inOut, map<int, CArray<size_t,1>>& globalIndexOut, std::map<int, CArray<size_t,1>>& globalIndexIn, 
    21392137                                   shared_ptr<CScattererConnector> &scattererConnector, const string& domainId) 
     
    24092407      CArray<double,1> value ; 
    24102408      gathererConnector_->transfer(event, value, 0.);  
    2411       area.resize(ni,nj) ; 
    2412       if (area.numElements()>0) area=CArray<double,2>(value.dataFirst(),shape(ni,nj),neverDeleteData) ;  
     2409      area_2d.resize(ni,nj) ; 
     2410      if (area_2d.numElements()>0) area_2d=CArray<double,2>(value.dataFirst(),shape(ni,nj),neverDeleteData) ;  
    24132411    } 
    24142412  } 
     
    24912489    m["reorder_domain"] = TRANS_REORDER_DOMAIN; 
    24922490    m["extract_domain"] = TRANS_EXTRACT_DOMAIN; 
     2491    m["redistribute_domain"] = TRANS_REDISTRIBUTE_DOMAIN; 
    24932492    return true; 
    24942493  } 
  • XIOS3/trunk/src/node/domain.hpp

    r2397 r2507  
    214214         CArray<double, 2> bounds_lonvalue, bounds_latvalue; 
    215215         CArray<double, 1> areavalue; 
     216         int niValue_ ; 
     217         int njValue_ ; 
     218         int ibeginValue_ ; 
     219         int jbeginValue_ ; 
    216220 
    217221 
     
    241245         void checkArea(void); 
    242246         void checkLonLat(); 
     247         void compute2dBox(void) ; 
    243248          
    244249       public: 
  • XIOS3/trunk/src/node/field.cpp

    r2433 r2507  
    2020#include "temporal_filter.hpp" 
    2121#include "server_from_client_source_filter.hpp" 
     22#include "client_online_reader_filter.hpp" 
    2223#include "file_reader_source_filter.hpp" 
     24#include "grid_redistribute_filter.hpp" 
    2325#include "tracer.hpp" 
    2426#include "graph_package.hpp" 
     
    205207  TRY 
    206208  { 
    207     return clientFromServerSourceFilter_->sendReadDataRequest(tsDataRequested) ; 
     209    if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->sendReadDataRequest(tsDataRequested) ; 
     210    else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->sendReadDataRequest(tsDataRequested) ; 
     211    else ERROR("bool CField::sendReadDataRequest(const CDate& tsDataRequested)", << "uninitialized source filter"); 
    208212  } 
    209213  CATCH_DUMP_ATTR 
     
    217221  TRY 
    218222  { 
    219     return clientFromServerSourceFilter_->sendReadDataRequestIfNeeded() ; 
     223    if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->sendReadDataRequestIfNeeded() ; 
     224    else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->sendReadDataRequestIfNeeded() ; 
     225    else ERROR("bool CField::sendReadDataRequestIfNeeded(void)", << "uninitialized source filter"); 
    220226  } 
    221227  CATCH_DUMP_ATTR 
     
    304310  TRY 
    305311  { 
    306     clientFromServerSourceFilter_->checkForLateData() ; 
     312    if (clientFromServerSourceFilter_) return clientFromServerSourceFilter_->checkForLateData() ; 
     313    else if (clientOnlineReaderFilter_) return clientOnlineReaderFilter_->checkForLateData() ; 
     314    else ERROR("void CField::checkForLateDataFromServer(void)", << "uninitialized source filter"); 
    307315  } 
    308316  CATCH_DUMP_ATTR  
     
    315323    { 
    316324      checkForLateDataFromServer() ; 
    317       clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 
     325      if (clientFromServerSourceFilter_) clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 
     326      else if (clientOnlineReaderFilter_) clientOnlineReaderFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()) ; 
    318327    }  
    319328    else if (hasCouplerIn()) 
     
    325334  CATCH_DUMP_ATTR 
    326335 
    327  
    328   void CField::checkIfMustAutoTrigger(void) 
    329   TRY 
    330   { 
    331     mustAutoTrigger = clientFromServerSourceFilter_ ? clientFromServerSourceFilter_->mustAutoTrigger() : false; 
    332   } 
    333   CATCH_DUMP_ATTR 
    334  
    335   void CField::autoTriggerIfNeeded(void) 
    336   TRY 
    337   { 
    338     if (mustAutoTrigger) 
    339       clientFromServerSourceFilter_->trigger(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    340   } 
    341   CATCH_DUMP_ATTR 
    342  
     336   
    343337 
    344338  //---------------------------------------------------------------- 
     
    506500                                              bool bufferForWriting) 
    507501  { 
    508     auto& contextBufferSize = bufferSize[client] ; 
    509     auto& contextMaxEventSize = maxEventSize[client] ; 
    510     const std::map<int, size_t> mapSize = grid_->getDataBufferSize(client, getId(), bufferForWriting); 
     502    auto& contextBufferSize = bufferSize[client_] ; 
     503    auto& contextMaxEventSize = maxEventSize[client_] ; 
     504    const std::map<int, size_t> mapSize = grid_->getDataBufferSize(client_, getId(), bufferForWriting); 
    511505    for(auto& it : mapSize ) 
    512506    { 
     
    525519                                                   bool bufferForWriting) 
    526520  { 
    527     auto& contextBufferSize = bufferSize[client] ; 
    528     auto& contextMaxEventSize = maxEventSize[client] ; 
    529     const std::map<int, size_t> mapSize = grid_->getAttributesBufferSize(client, bufferForWriting); 
     521    auto& contextBufferSize = bufferSize[client_] ; 
     522    auto& contextMaxEventSize = maxEventSize[client_] ; 
     523    const std::map<int, size_t> mapSize = grid_->getAttributesBufferSize(client_, bufferForWriting); 
    530524    for(auto& it : mapSize ) 
    531525    { 
     
    797791  { 
    798792    // insert temporal filter before sending to files 
    799     clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client)); 
     793    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client_)); 
    800794    // insert temporal filter before sending to files 
    801795    getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(clientToServerStoreFilter_, 0); 
     
    809803  }  
    810804 
     805/* 
     806  void CField::connectToOnlineWriter(CGarbageCollector& gc) 
     807  { 
     808    // insert temporal filter before sending to files 
     809    CField* fieldOut ; 
     810    redistributeFilter_ = std::shared_ptr<CGridRedistributeFilter>(new CGridRedistributeFilter(gc, this, fieldOut)); 
     811    fieldOut->setFileOut(this->getFileOut()); 
     812    fileOut_->replaceEnabledFields(this, fieldOut) ; 
     813    // insert temporal filter before sending to files 
     814    getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(redistributeFilter_, 0); 
     815    fieldOut->inputFilter = std::shared_ptr<CPassThroughFilter>(new CPassThroughFilter(gc));  
     816    fieldOut->instantDataFilter = fieldOut->inputFilter ; 
     817    redistributeFilter_->connectOutput(fieldOut->inputFilter, 0); 
     818    fieldOut->connectToFileWriter(gc) ; 
     819    fieldOut->solveServerOperation() ; // might not be called, create a new time functor.... find a better solution later 
     820    const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ; 
     821   
     822    if(buildGraph_)  
     823    { 
     824      clientToServerStoreFilter_->graphPackage = new CGraphPackage; 
     825      clientToServerStoreFilter_->graphEnabled = true; 
     826      clientToServerStoreFilter_->graphPackage->inFields.push_back(this); 
     827    } 
     828  }  
     829*/ 
     830  void CField::connectToOnlineWriter(CGarbageCollector& gc) 
     831  { 
     832    // insert temporal filter before sending to files 
     833    clientOnlineWriterFilter_ = std::shared_ptr<CClientOnlineWriterFilter>(new CClientOnlineWriterFilter(gc,this)) ; 
     834    getTemporalDataFilter(gc, fileOut_->output_freq)->connectOutput(clientOnlineReaderFilter_, 0); 
     835    
     836    const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ; 
     837   
     838    if(buildGraph_)  
     839    { 
     840      // to do 
     841    } 
     842  }  
     843 
     844  void CField::connectToOnlineReader(CGarbageCollector& gc) 
     845  { 
     846    // insert temporal filter before sending to files 
     847    clientOnlineReaderFilter_ = std::shared_ptr<CClientOnlineReaderFilter>(new CClientOnlineReaderFilter(gc,this)) ; 
     848    clientOnlineReaderFilter_ -> connectOutput(inputFilter,0) ; 
     849  }  
     850 
    811851  void CField::connectToCouplerOut(CGarbageCollector& gc) 
    812852  { 
    813853    // insert temporal filter before sending to files 
    814     clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client)); 
     854    clientToServerStoreFilter_ = std::shared_ptr<CClientToServerStoreFilter>(new CClientToServerStoreFilter(gc, this, client_)); 
    815855    instantDataFilter->connectOutput(clientToServerStoreFilter_, 0); 
    816856    const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ; 
     
    951991  void CField::connectToServerToClient(CGarbageCollector& gc) 
    952992  { 
    953     serverToClientStoreFilter_ = std::shared_ptr<CServerToClientStoreFilter>(new CServerToClientStoreFilter(gc, this, client)); 
     993    serverToClientStoreFilter_ = std::shared_ptr<CServerToClientStoreFilter>(new CServerToClientStoreFilter(gc, this, client_)); 
    954994    instantDataFilter->connectOutput(serverToClientStoreFilter_, 0); 
    955995    const bool buildGraph_ = !build_workflow_graph.isEmpty() && build_workflow_graph == true ; 
     
    14351475  { 
    14361476    CContext* context = CContext::getCurrent(); 
    1437     client = contextClient; 
     1477    client_ = contextClient; 
    14381478   
    14391479    // A grid is sent by a client (both for read or write) or by primary server (write only) 
     
    14411481    { 
    14421482      if (getRelFile()->mode.isEmpty() || (!getRelFile()->mode.isEmpty() && getRelFile()->mode == CFile::mode_attr::write)) 
    1443         grid_->setContextClient(contextClient); 
     1483        /*grid_->setContextClient(contextClient) */; // => nothing to do with thats now, to remove... 
    14441484    } 
    14451485    else if (context->getServiceType()==CServicesManager::CLIENT) 
    14461486    { 
    14471487      if (grid_) 
    1448         grid_->setContextClient(contextClient); 
     1488        /*grid_->setContextClient(contextClient)*/; // => nothing to do with thats now, to remove... 
    14491489      else 
     1490 
    14501491        ERROR( "CField::setContextClient(contextClient)", 
    14511492               << "Grid not defined for " << getId() 
     
    14591500  void CField::sendFieldToFileServer(void) 
    14601501  { 
    1461     CContext::getCurrent()->sendContextToFileServer(client); 
    1462     getRelFile()->sendFileToFileServer(client); 
     1502    CContext::getCurrent()->sendContextToFileServer(client_); 
     1503    getRelFile()->sendFileToFileServer(client_); 
    14631504    sentGrid_ = grid_-> duplicateSentGrid() ; 
    1464     sentGrid_->sendGridToFileServer(client, false); 
     1505    sentGrid_->sendGridToFileServer(client_, false); 
    14651506    name = getFieldOutputName() ; 
    1466     this->sendAllAttributesToServer(client); 
    1467     this->sendAddAllVariables(client); 
     1507    this->sendAllAttributesToServer(client_); 
     1508    this->sendAddAllVariables(client_); 
    14681509  } 
    14691510 
    14701511  void CField::sendFieldToInputFileServer(void) 
    14711512  { 
    1472     CContext::getCurrent()->sendContextToFileServer(client); 
    1473     getRelFile()->sendFileToFileServer(client); 
     1513    CContext::getCurrent()->sendContextToFileServer(client_); 
     1514    getRelFile()->sendFileToFileServer(client_); 
    14741515    sentGrid_ = grid_-> duplicateSentGrid() ; 
    1475     sentGrid_->sendGridToFileServer(client, true); 
     1516    sentGrid_->sendGridToFileServer(client_, true); 
    14761517    read_access=true ; // not the best solution, but on server side, the field must be a starting point of the workflow 
    14771518                       // must be replace by a better solution when implementing filters for reading and send to client 
    14781519                       // on server side 
    1479     this->sendAllAttributesToServer(client); 
    1480     this->sendAddAllVariables(client); 
     1520    this->sendAllAttributesToServer(client_); 
     1521    this->sendAddAllVariables(client_); 
    14811522  } 
    14821523 
     
    14861527    else sendFieldToCouplerOut_done_=true ; 
    14871528    sentGrid_ = grid_-> duplicateSentGrid() ; 
    1488     sentGrid_->sendGridToCouplerOut(client, this->getId()); 
     1529    sentGrid_->sendGridToCouplerOut(client_, this->getId()); 
    14891530    this->sendGridCompleted(); 
    14901531 
     
    15021543      CEventClient event(getType(),EVENT_ID_GRID_COMPLETED); 
    15031544 
    1504       if (client->isServerLeader()) 
     1545      if (client_->isServerLeader()) 
    15051546      { 
    15061547        CMessage msg; 
    15071548        msg<<this->getId(); 
    1508         for (auto& rank : client->getRanksServerLeader()) event.push(rank,1,msg); 
    1509         client->sendEvent(event); 
    1510       } 
    1511       else client->sendEvent(event); 
     1549        for (auto& rank : client_->getRanksServerLeader()) event.push(rank,1,msg); 
     1550        client_->sendEvent(event); 
     1551      } 
     1552      else client_->sendEvent(event); 
    15121553   } 
    15131554   CATCH_DUMP_ATTR 
  • XIOS3/trunk/src/node/field.hpp

    r2406 r2507  
    2828#include "client_to_server_store_filter.hpp" 
    2929#include "file_reader_source_filter.hpp" 
     30#include "client_online_reader_filter.hpp" 
     31#include "client_online_writer_filter.hpp" 
    3032 
    3133 
     
    5658   class CSourceFilter; 
    5759   class CServerToClientFilter; 
     60   class CGridRedistributeFilter; 
    5861   ///-------------------------------------------------------------- 
    5962 
     
    199202        void checkForLateDataFromCoupler(void) ; 
    200203 
    201         void checkIfMustAutoTrigger(void); // ym obsolete 
    202         void autoTriggerIfNeeded(void); //ym obsolete 
    203204        void triggerLateField(void) ; 
    204205 
     
    237238        void connectToFileReader(CGarbageCollector& gc) ; 
    238239        void connectToServerToClient(CGarbageCollector& gc) ; 
     240        void connectToOnlineWriter(CGarbageCollector& gc) ; 
     241        void connectToOnlineReader(CGarbageCollector& gc) ; 
    239242 
    240243        void setContextClientDataBufferSize(map<CContextClient*,map<int,size_t>>& bufferSize,  
     
    267270         CGrid*  grid_=nullptr; 
    268271         CGrid* getGrid(void) { return grid_; }  
     272         void setGrid(CGrid* grid) { grid_=grid; }  
    269273       
    270274      private: 
     
    327331         
    328332      private: 
    329          CContextClient* client; 
     333         CContextClient* client_; 
    330334      public: 
    331335         void setContextClient(CContextClient* newContextClient); 
    332          CContextClient* getContextClient(void) {return client;} 
     336         CContextClient* getContextClient(void) {return client_;} 
    333337 
    334338      private: 
     
    372376         std::shared_ptr<COutputPin> selfReferenceFilter; // probably redondant with inputFilter 
    373377 
    374          //! The source filter for data provided by the client 
    375 //         std::shared_ptr<CSourceFilter> clientSourceFilter; // obsolete to remove 
    376378  
    377379         //! The source filter for data provided by the model to enter the client workflow 
     
    393395         std::shared_ptr<CFileReaderSourceFilter> fileReaderSourceFilter_; 
    394396 
    395          //! The source filter for data provided by the server 
    396 //         std::shared_ptr<CSourceFilter> serverSourceFilter; // obsolete to remove 
    397          
    398397         //! The terminal filter which send data to server for writing 
    399398         std::shared_ptr<CClientToServerStoreFilter> clientToServerStoreFilter_; 
     
    405404         std::shared_ptr<CServerToClientStoreFilter> serverToClientStoreFilter_; 
    406405 
     406         //! the filter to redistribute data before to call the fileWriterStoreFilter ==> to remove 
     407         std::shared_ptr<CGridRedistributeFilter>  redistributeFilter_ ; 
     408 
     409          //! the filter to connect to online reader 
     410         std::shared_ptr<CClientOnlineReaderFilter>  clientOnlineReaderFilter_ ; 
     411 
     412          //! the filter to connect to online writer 
     413         std::shared_ptr<CClientOnlineWriterFilter>  clientOnlineWriterFilter_ ; 
     414 
    407415 
    408416   }; // class CField 
  • XIOS3/trunk/src/node/file.cpp

    r2458 r2507  
    178178 
    179179      return (this->enabledFields); 
     180   } 
     181   CATCH_DUMP_ATTR 
     182 
     183   void CFile::replaceEnabledFields(CField* fieldIn, CField* fieldOut) 
     184   TRY 
     185   { 
     186     for(auto& enableField : enabledFields) if (enableField==fieldIn) enableField=fieldOut ; 
    180187   } 
    181188   CATCH_DUMP_ATTR 
     
    979986 
    980987   /*! 
    981     * Post-process the filter graph for each active field. 
    982     */ 
    983    void CFile::postProcessFilterGraph() 
    984    TRY 
    985    { 
    986      int size = this->enabledFields.size(); 
    987      for (int i = 0; i < size; ++i) 
    988      { 
    989        this->enabledFields[i]->checkIfMustAutoTrigger(); 
    990      } 
    991    } 
    992    CATCH_DUMP_ATTR 
    993  
    994    /*! 
    995988     Prefetching the data for enabled fields read from file. 
    996989   */ 
     
    1004997     for (int i = 0; i < size; ++i) 
    1005998       this->enabledFields[i]->sendReadDataRequest(CContext::getCurrent()->getCalendar()->getCurrentDate()); 
    1006    } 
    1007    CATCH_DUMP_ATTR 
    1008  
    1009    /*! 
    1010      Do all pre timestep operations for enabled fields in read mode: 
    1011       - Check that the data excepted from server has been received 
    1012       - Check if some filters must auto-trigger 
    1013    */ 
    1014    void CFile::doPreTimestepOperationsForEnabledReadModeFields(void) 
    1015    TRY 
    1016    { 
    1017      if (mode.isEmpty() || mode.getValue() != mode_attr::read) 
    1018        return; 
    1019  
    1020      int size = this->enabledFields.size(); 
    1021      for (int i = 0; i < size; ++i) 
    1022      { 
    1023        this->enabledFields[i]->checkForLateDataFromServer(); 
    1024        this->enabledFields[i]->autoTriggerIfNeeded(); 
    1025      } 
    1026999   } 
    10271000   CATCH_DUMP_ATTR 
  • XIOS3/trunk/src/node/file.hpp

    r2458 r2507  
    8383                                                int default_level = 1, 
    8484                                                bool default_enabled = true); 
     85         void replaceEnabledFields(CField* fieldIn, CField* fieldOut) ; 
    8586 
    8687         StdString dumpClassAttributes(void); 
     
    112113         void processEnabledFile(void); 
    113114          
    114          void postProcessFilterGraph(); 
    115115         void prefetchEnabledReadModeFields(); 
    116          void doPreTimestepOperationsForEnabledReadModeFields(); 
    117116         void doPostTimestepOperationsForEnabledReadModeFields(); 
    118117 
     
    212211        
    213212       private: 
    214  
    215  
     213         bool isOnline_=false; 
     214       public: 
     215         bool isOnline(void) { return isOnline_ ;} 
     216         void setOnline(bool online=true) { isOnline_=online ;}  
    216217      public: 
    217218        //         virtual void toBinary  (StdOStream& os) const; 
  • XIOS3/trunk/src/node/grid.cpp

    r2397 r2507  
    2929#include "generic_algorithm_transformation.hpp" 
    3030#include "algo_types.hpp" 
     31#include "redistribute_domain.hpp" 
     32#include "redistribute_axis.hpp" 
     33#include "redistribute_scalar.hpp" 
     34 
    3135 
    3236#include <regex> 
     
    4852      , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 
    4953      , gridSrc_(), order_() 
    50       , clients() 
    5154   { 
    5255     setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group")); 
     
    6669      , axisPositionInGrid_(), hasDomainAxisBaseRef_(false) 
    6770      , gridSrc_(), order_() 
    68       , clients() 
    6971   { 
    7072     setVirtualDomainGroup(CDomainGroup::create(getId() + "_virtual_domain_group")); 
     
    14681470    distributeGridToServer(client, false, fieldId) ; 
    14691471  } 
     1472 
     1473  CGrid* CGrid::redistributeGridToWriter(void) 
     1474  { 
     1475    CContext* context = CContext::getCurrent(); 
     1476    CGrid* redistributedGrid ; 
     1477    string redistributeGridId="redistributedToWriter__"+getId() ; 
     1478    if (has(redistributeGridId)) redistributedGrid = get(redistributeGridId) ; 
     1479    else 
     1480    { 
     1481      redistributedGrid = CGrid::create(redistributeGridId) ; 
     1482      // simple Distribution for now  
     1483      // distribute over the fisrt element except if it is a scalar 
     1484      auto& elements = getElements() ; 
     1485      int posDistributed = 0 ; 
     1486      for(auto& element : elements) 
     1487      { 
     1488        if (element.type==TYPE_DOMAIN) break ; 
     1489        else if (element.type==TYPE_AXIS) break ; 
     1490        else if (element.type==TYPE_SCALAR) posDistributed++ ; 
     1491      } 
     1492      if (posDistributed==elements.size()) posDistributed=0 ; // grid composed only of scalar 
     1493     
     1494      for(int i=0 ; i<elements.size() ; i++) 
     1495      { 
     1496        if (elements[i].type==TYPE_DOMAIN)  
     1497        { 
     1498          CDomain* domain = redistributedGrid->addDomain() ; 
     1499          domain->domain_ref=elements[i].domain->getId() ; 
     1500          domain->name = elements[i].domain->getDomainOutputName() ; 
     1501          CRedistributeDomain* redistributeDomain = dynamic_cast<CRedistributeDomain *>(domain->addTransformation(TRANS_REDISTRIBUTE_DOMAIN, "")) ; 
     1502          redistributeDomain->type.setValue(posDistributed==i ? CRedistributeDomain::type_attr::bands : CRedistributeDomain::type_attr::full); 
     1503        } 
     1504        else if (elements[i].type==TYPE_AXIS)       
     1505        { 
     1506          CAxis* axis = redistributedGrid->addAxis() ; 
     1507          axis->axis_ref=elements[i].axis->getId() ; 
     1508          axis->name = elements[i].axis->getAxisOutputName() ; 
     1509          CRedistributeAxis* redistributeAxis = dynamic_cast<CRedistributeAxis *>(axis->addTransformation(TRANS_REDISTRIBUTE_AXIS, "")) ; 
     1510          redistributeAxis->type.setValue(posDistributed==i ? CRedistributeAxis::type_attr::bands : CRedistributeAxis::type_attr::full); 
     1511        } 
     1512        else if (elements[i].type==TYPE_SCALAR)       
     1513        { 
     1514          CScalar* scalar = redistributedGrid->addScalar() ; 
     1515          scalar->scalar_ref=elements[i].scalar->getId() ; 
     1516          scalar->name = elements[i].scalar->getScalarOutputName() ; 
     1517          CRedistributeScalar* redistributeScalar = dynamic_cast<CRedistributeScalar *>(scalar->addTransformation(TRANS_REDISTRIBUTE_SCALAR, "")) ; 
     1518          redistributeScalar->type.setValue(posDistributed==i ? CRedistributeScalar::type_attr::root : CRedistributeScalar::type_attr::full); 
     1519        } 
     1520      } 
     1521    } 
     1522 
     1523    return redistributedGrid ;  
     1524  } 
     1525 
     1526 
    14701527 
    14711528 
     
    23692426  TRY 
    23702427  { 
    2371     if (clientsSet.find(contextClient)==clientsSet.end()) 
    2372     { 
    2373       clients.push_back(contextClient) ; 
    2374       clientsSet.insert(contextClient); 
    2375     } 
    23762428    for (auto domain : getDomains()) domain->setContextClient(contextClient); 
    23772429    for (auto axis : getAxis()) axis->setContextClient(contextClient); 
    23782430    for (auto scalar : getScalars()) scalar->setContextClient(contextClient); 
    2379     
    23802431  } 
    23812432  CATCH_DUMP_ATTR 
     
    24732524  } 
    24742525 
     2526  void CGrid::computeRedistributeToWriterConnector(CGrid* gridSrc) 
     2527  { 
     2528    CContext* context = CContext::getCurrent(); 
     2529 
     2530    vector<shared_ptr<CLocalView>> srcViews ; 
     2531    vector<shared_ptr<CLocalView>> dstViews ; 
     2532         
     2533    for(auto& element : gridSrc->getElements()) 
     2534    { 
     2535      if (element.type==TYPE_DOMAIN) srcViews.push_back(element.domain->getLocalView(CElementView::WORKFLOW)) ; 
     2536      else if (element.type==TYPE_AXIS) srcViews.push_back(element.axis->getLocalView(CElementView::WORKFLOW)) ;  
     2537      else if (element.type==TYPE_SCALAR) srcViews.push_back(element.scalar->getLocalView(CElementView::WORKFLOW)) ;  
     2538    } 
     2539 
     2540    for(auto& element : this->getElements()) 
     2541    { 
     2542      if (element.type==TYPE_DOMAIN) dstViews.push_back(element.domain->getLocalView(CElementView::WORKFLOW)) ; 
     2543      else if (element.type==TYPE_AXIS) dstViews.push_back(element.axis->getLocalView(CElementView::WORKFLOW)) ;  
     2544      else if (element.type==TYPE_SCALAR) dstViews.push_back(element.scalar->getLocalView(CElementView::WORKFLOW)) ;  
     2545    } 
     2546 
     2547    redistributeToWriterConnector_ = make_shared<CGridTransformConnector>(srcViews, dstViews, context->getIntraComm()) ; 
     2548    redistributeToWriterConnector_ -> computeConnector(true) ; 
     2549  } 
    24752550   
    24762551} // namespace xios 
  • XIOS3/trunk/src/node/grid.hpp

    r2397 r2507  
    279279 
    280280        bool isDataDistributed(void) ;  
    281       private: 
    282  
    283 /** Clients that have to send a grid. There can be multiple clients in case of secondary server, otherwise only one client. */ 
    284         std::list<CContextClient*> clients; 
    285         std::set<CContextClient*> clientsSet; 
    286281 
    287282      private: 
     
    327322     ////////////////////////////////////////////////////////////////////////////////////// 
    328323      public: 
     324        CGrid* redistributeGridToWriter(void) ; 
     325      public: 
    329326       CGrid* duplicateSentGrid(void) ; 
    330327      private: 
     
    402399         void computeServerFromClientConnector(void) ; 
    403400 
     401      private: 
     402         shared_ptr<CGridTransformConnector> redistributeToWriterConnector_ = nullptr ; 
     403      public: 
     404         shared_ptr<CGridTransformConnector> getRedistributeToWriterConnector(CGrid* gridSrc) { if (redistributeToWriterConnector_==nullptr) computeRedistributeToWriterConnector(gridSrc) ; return redistributeToWriterConnector_;} 
     405         void computeRedistributeToWriterConnector(CGrid* gridSrc) ; 
     406 
     407 
    404408   }; // class CGrid 
    405409 
  • XIOS3/trunk/src/node/node_enum.hpp

    r2458 r2507  
    4545         ePoolNode,gPoolNode, 
    4646         eServiceNode,gServiceNode, 
    47 //         eService, gService 
     47         eRedistributeDomain, gRedistributeDomain, 
     48         eRedistributeAxis, gRedistributeAxis, 
     49         eRedistributeScalar, gRedistributeScalar, 
    4850       } ENodeType; 
    4951 
  • XIOS3/trunk/src/node/node_type.hpp

    r2458 r2507  
    3535#include "pool_node.hpp" 
    3636#include "service_node.hpp" 
     37#include "redistribute_domain.hpp" 
     38#include "redistribute_axis.hpp" 
     39#include "redistribute_scalar.hpp" 
    3740 
    3841 
  • XIOS3/trunk/src/node/scalar.cpp

    r2397 r2507  
    4747    m["reduce_domain"] = TRANS_REDUCE_DOMAIN_TO_SCALAR; 
    4848    m["reduce_scalar"] = TRANS_REDUCE_SCALAR_TO_SCALAR; 
     49    m["redistribute_scalar"] = TRANS_REDISTRIBUTE_SCALAR; 
    4950    return true; 
    5051  } 
     
    122123    if (n.isEmpty()) n=1 ; 
    123124    if (mask.isEmpty()) mask=true ; 
     125     
     126    hasValue_ =  (value.isEmpty())  ? false :true ; 
     127    hasBounds_ = (bounds.isEmpty()) ? false :true ; 
     128    hasLabel_ =  (label.isEmpty())  ? false :true ; 
     129 
    124130 
    125131    initializeLocalElement() ; 
  • XIOS3/trunk/src/node/scalar.hpp

    r2397 r2507  
    143143 
    144144      bool isEqual(CScalar* scalar); 
     145 
     146    public: 
     147      bool hasValue() { return hasValue_; } 
     148      bool hasBounds() { return hasBounds_; } 
     149      bool hasLabel() { return hasLabel_; } 
     150    private: 
     151      bool hasValue_  = false ; 
     152      bool hasBounds_ = false ; 
     153      bool hasLabel_  = false ; 
    145154    private:   
    146155          /** Clients that have to send a scalar. There can be multiple clients in case of secondary server, otherwise only one client. */ 
  • XIOS3/trunk/src/object_factory_decl2.cpp

    r2458 r2507  
    2323  macro(CPoolNode) 
    2424  macro(CServiceNode) 
     25  macro(CRedistributeDomain) 
     26  macro(CRedistributeAxis) 
     27  macro(CRedistributeScalar) 
    2528} 
    2629 
  • XIOS3/trunk/src/object_factory_decl4.cpp

    r1591 r2507  
    1919  macro(CReorderDomainGroup) 
    2020  macro(CExtractDomainGroup) 
     21  macro(CRedistributeDomainGroup) 
     22  macro(CRedistributeAxisGroup) 
     23  macro(CRedistributeScalarGroup) 
    2124} 
    2225 
  • XIOS3/trunk/src/object_template_decl.cpp

    r2458 r2507  
    3838  template class CObjectTemplate<CPoolNode>; 
    3939  template class CObjectTemplate<CServiceNode>; 
     40  template class CObjectTemplate<CRedistributeDomain>; 
     41  template class CObjectTemplate<CRedistributeAxis>; 
     42  template class CObjectTemplate<CRedistributeScalar>; 
     43 
    4044   
    4145  template class CObjectTemplate<CContextGroup>; 
     
    7175  template class CObjectTemplate<CPoolNodeGroup>; 
    7276  template class CObjectTemplate<CServiceNodeGroup>; 
     77  template class CObjectTemplate<CRedistributeDomainGroup>; 
     78  template class CObjectTemplate<CRedistributeAxisGroup>; 
     79  template class CObjectTemplate<CRedistributeScalarGroup>; 
    7380 
    7481} 
  • XIOS3/trunk/src/transformation/algo_types.cpp

    r2011 r2507  
    1010      if (!first) return ; 
    1111      bool ret ; 
    12       std::cout<<"register Transformation"<<std::endl ; 
    1312      ret=CScalarAlgorithmReduceAxis::registerTrans(); 
    1413      ret=CScalarAlgorithmExtractAxis::registerTrans(); 
    1514      ret=CScalarAlgorithmReduceDomain::registerTrans(); 
    1615      ret=CScalarAlgorithmReduceScalar::registerTrans(); 
    17  
     16      ret=CScalarAlgorithmRedistribute::registerTrans() ; 
    1817      //! Axis 
    1918      ret=CAxisAlgorithmZoom::registerTrans(); 
     
    2726      ret=CAxisAlgorithmTemporalSplitting::registerTrans(); 
    2827      ret=CAxisAlgorithmDuplicateScalar::registerTrans(); 
     28      ret=CAxisAlgorithmRedistribute::registerTrans() ; 
    2929 
    3030      //! Domain 
     
    3636      ret=CDomainAlgorithmExtract::registerTrans(); 
    3737      ret=CDomainAlgorithmGenerateRectilinear::registerTrans() ; 
     38      ret=CDomainAlgorithmRedistribute::registerTrans() ; 
    3839      first=false ; 
    3940    } 
  • XIOS3/trunk/src/transformation/algo_types.hpp

    r2018 r2507  
    1414#include "scalar_algorithm_reduce_domain.hpp" 
    1515#include "scalar_algorithm_reduce_scalar.hpp" 
     16#include "scalar_algorithm_redistribute.hpp" 
    1617 
    1718#include "axis_algorithm_inverse.hpp" 
     
    2526#include "axis_algorithm_temporal_splitting.hpp" 
    2627#include "axis_algorithm_duplicate_scalar.hpp" 
    27  
     28#include "axis_algorithm_redistribute.hpp" 
    2829 
    2930#include "domain_algorithm_zoom.hpp" 
     
    3435#include "domain_algorithm_reorder.hpp" 
    3536#include "domain_algorithm_extract.hpp" 
     37#include "domain_algorithm_redistribute.hpp" 
    3638 
    3739namespace xios 
  • XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_extract.cpp

    r2270 r2507  
    9292  } 
    9393 
    94   if (axisSrc_->hasValue) axisDest_->value.resize(nDest); 
    95   if (axisSrc_->hasLabel) axisDest_->label.resize(nDest); 
    96   if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest); 
     94  if (axisSrc_->hasValue()) axisDest_->value.resize(nDest); 
     95  if (axisSrc_->hasLabel()) axisDest_->label.resize(nDest); 
     96  if (axisSrc_->hasBounds()) axisDest_->bounds.resize(2,nDest); 
    9797 
    9898  auto& transMap = this->transformationMapping_; 
     
    142142      // ----------------------------------------------------------------------------- 
    143143 
    144       if (axisSrc_->hasValue) 
     144      if (axisSrc_->hasValue()) 
    145145      { 
    146146        axisDest_->value(countDest) = axisSrc_->value(countSrc); 
    147147      } 
    148       if (axisSrc_->hasLabel) 
     148      if (axisSrc_->hasLabel()) 
    149149      { 
    150150        axisDest_->label(countDest) = axisSrc_->label(countSrc); 
    151151      } 
    152       if (axisSrc_->hasBounds) 
     152      if (axisSrc_->hasBounds()) 
    153153      { 
    154154        axisDest_->bounds(0,countDest) = axisSrc_->bounds(0,countSrc); 
  • XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_inverse.cpp

    r2270 r2507  
    123123  } 
    124124 
    125   if (axisSrc_->hasValue) 
     125  if (axisSrc_->hasValue()) 
    126126  { 
    127127    axisDestination->value.resize(indexSize); 
     
    132132  } 
    133133 
    134   if (axisSrc_->hasBounds) 
     134  if (axisSrc_->hasBounds()) 
    135135  { 
    136136    axisDestination->bounds.resize(2,indexSize); 
  • XIOS3/trunk/src/transformation/axis_algorithm/axis_algorithm_zoom.cpp

    r2270 r2507  
    7979 
    8080  axisDest_->mask.resize(nDest); 
    81   if (axisSrc_->hasValue) axisDest_->value.resize(nDest); 
    82   if (axisSrc_->hasLabel) axisDest_->label.resize(nDest); 
    83   if (axisSrc_->hasBounds) axisDest_->bounds.resize(2,nDest); 
     81  if (axisSrc_->hasValue()) axisDest_->value.resize(nDest); 
     82  if (axisSrc_->hasLabel()) axisDest_->label.resize(nDest); 
     83  if (axisSrc_->hasBounds()) axisDest_->bounds.resize(2,nDest); 
    8484 
    8585  auto& transMap = this->transformationMapping_; 
     
    9292    axisDest_->mask(iDest) = axisSrc_->mask(iSrc); 
    9393 
    94     if (axisSrc_->hasValue) 
     94    if (axisSrc_->hasValue()) 
    9595      axisDest_->value(iDest) = axisSrc_->value(iSrc); 
    96     if (axisSrc_->hasLabel) 
     96    if (axisSrc_->hasLabel()) 
    9797      axisDest_->label(iDest) = axisSrc_->label(iSrc); 
    98     if (axisSrc_->hasBounds) 
     98    if (axisSrc_->hasBounds()) 
    9999    { 
    100100      axisDest_->bounds(0,iDest) = axisSrc_->bounds(0,iSrc); 
  • XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_extract.cpp

    r2340 r2507  
    7676   domainDestination->bounds_lon_2d.reset(); 
    7777   domainDestination->bounds_lat_2d.reset(); 
    78    domainDestination->area.reset(); 
     78   domainDestination->area_1d.reset(); 
     79   domainDestination->area_2d.reset(); 
    7980   domainDestination->radius.reset(); 
    8081    
     
    175176    } 
    176177  } 
    177   if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 
    178  
     178  if (domainSrc_->hasArea)  
     179  { 
     180    if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest); 
     181    else if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest); 
     182  } 
    179183  // Set attributes required to define domainDestination->localElement_ and associated views, full and workflow) 
    180184  CArray<size_t,1> sourceGlobalIdx = domainSource->getLocalElement()->getGlobalIndex(); 
     
    241245 
    242246      // area 
    243       if (!domainSrc_->area.isEmpty()) 
    244       { 
    245         domainDest_->area(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area(iIdxSrcLocal,jIdxSrcLocal); 
    246       } 
     247      if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iIdxDestLocal,jIdxDestLocal) = domainSrc_->area_2d(iIdxSrcLocal,jIdxSrcLocal); 
     248      else if (!domainSrc_->area_1d.isEmpty())  domainDest_->area_1d(countDest) = domainSrc_->area_1d(countSrc); 
    247249 
    248250      // bounds 
  • XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_reorder.cpp

    r2270 r2507  
    128128   else if (!domainSource->lonvalue_2d.isEmpty() ) 
    129129   { 
    130      domainDestination->latvalue_2d.resize( domainSource->latvalue_2d.numElements() ); 
    131      domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d.numElements() ); 
     130     domainDestination->latvalue_2d.resize( domainSource->latvalue_2d.shape() ); 
     131     domainDestination->lonvalue_2d.resize( domainSource->lonvalue_2d.shape() ); 
    132132     domainDestination->latvalue_2d = domainSource->latvalue_2d; 
    133133     domainDestination->lonvalue_2d = domainSource->lonvalue_2d; 
     
    145145   else if (!domainSource->bounds_lon_2d.isEmpty() ) 
    146146   { 
    147      domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d.numElements() ); 
    148      domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d.numElements() ); 
     147     domainDestination->bounds_lon_2d.resize( domainSource->bounds_lon_2d.shape() ); 
     148     domainDestination->bounds_lat_2d.resize( domainSource->bounds_lat_2d.shape() ); 
    149149     domainDestination->bounds_lon_2d = domainSource->bounds_lon_2d; 
    150150     domainDestination->bounds_lat_2d = domainSource->bounds_lat_2d; 
    151151   } 
    152152   // set area 
    153    if (!domainSource->area.isEmpty() ) 
    154    { 
    155      domainDestination->area.resize( domainSource->area.numElements() ); 
    156      domainDestination->area = domainSource->area;     
    157    } 
     153   if (!domainSource->area_1d.isEmpty() ) 
     154   { 
     155     domainDestination->area_1d.resize( domainSource->area_1d.numElements() ); 
     156     domainDestination->area_1d = domainSource->area_1d;     
     157   } 
     158   else if (!domainSource->area_2d.isEmpty() ) 
     159   { 
     160     domainDestination->area_2d.resize( domainSource->area_2d.shape() ); 
     161     domainDestination->area_2d = domainSource->area_2d;     
     162   } 
     163 
    158164   if (!domainSource->radius.isEmpty() ) 
    159165     domainDestination->radius = domainSource->radius; 
  • XIOS3/trunk/src/transformation/domain_algorithm/domain_algorithm_zoom.cpp

    r2270 r2507  
    173173    } 
    174174  } 
    175   if (domainSrc_->hasArea) domainDest_->area.resize(niDest,njDest); 
    176  
     175  if (domainSrc_->hasArea) 
     176  { 
     177    if (!domainSrc_->area_1d.isEmpty()) domainDest_->area_1d.resize(niDest*njDest); 
     178    else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d.resize(niDest,njDest); 
     179  } 
    177180 
    178181  for (int iDest = 0; iDest < niDest; iDest++) 
     
    196199 
    197200      if (domainSrc_->hasArea) 
    198         domainDest_->area(iDest,jDest) = domainSrc_->area(iSrc,jSrc); 
     201      {   
     202         if (!domainSrc_->area_1d.isEmpty())      domainDest_->area_1d(indLocDest)  = domainSrc_->area_1d(ind); 
     203         else if (!domainSrc_->area_2d.isEmpty()) domainDest_->area_2d(iDest,jDest) = domainSrc_->area_2d(iSrc,jSrc); 
     204      } 
    199205 
    200206      if (domainSrc_->hasLonLat) 
  • XIOS3/trunk/src/transformation/scalar_algorithm/scalar_algorithm_extract_axis.cpp

    r2303 r2507  
    108108    } 
    109109 
    110     if (axisSource->hasValue) 
     110    if (axisSource->hasValue()) 
    111111    { 
    112112      scalarDestination->value = axisSource->value(idxSrc); 
  • XIOS3/trunk/src/transformation/transformation_enum.hpp

    r1984 r2507  
    2626        TRANS_REORDER_DOMAIN = 17, 
    2727        TRANS_EXTRACT_DOMAIN = 18, 
    28         TRANS_EXTRACT_AXIS = 19 
     28        TRANS_EXTRACT_AXIS = 19, 
     29        TRANS_REDISTRIBUTE_DOMAIN = 20, 
     30        TRANS_REDISTRIBUTE_AXIS = 21, 
     31        TRANS_REDISTRIBUTE_SCALAR = 22 
    2932      } ETranformationType; 
    3033 
  • XIOS3/trunk/src/transport/context_client.cpp

    r2343 r2507  
    1818#include "one_sided_context_client.hpp" 
    1919#include "legacy_context_client.hpp" 
     20#include "online_context_client.hpp" 
     21 
    2022 
    2123namespace xios 
     
    6163      if (defaultProtocol=="one_sided") return getNew<CContextClient::oneSided>(parent, intraComm, interComm) ; 
    6264      else if  (defaultProtocol=="legacy") return getNew<CContextClient::legacy>(parent, intraComm, interComm) ; 
     65      else if  (defaultProtocol=="online") return getNew<CContextClient::online>(parent, intraComm, interComm) ; 
    6366      else if  (defaultProtocol=="default") return getNew<CContextClient::legacy>(parent, intraComm, interComm) ; 
    6467      else ERROR("CContextClient* CContextClient::getNew<CContextClient::generic>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer)", 
     
    7679    {  
    7780      return new CLegacyContextClient(parent, intraComm, interComm, parentServer);  
     81    } 
     82 
     83    template<> 
     84    CContextClient* CContextClient::getNew<CContextClient::online>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) 
     85    {  
     86      return new COnlineContextClient(parent, intraComm, interComm, parentServer);  
    7887    } 
    7988 
  • XIOS3/trunk/src/transport/context_client.hpp

    r2343 r2507  
    2828  { 
    2929    public: 
    30       enum ETransport { generic, legacy, oneSided}  ; 
     30      enum ETransport { generic, legacy, oneSided, online}  ; 
    3131       
    3232      template<ETransport transport=generic>  
     
    5656 
    5757 
     58      virtual ETransport getType(void) = 0 ; 
    5859      // Send event to server 
    5960      virtual void sendEvent(CEventClient& event)=0; 
     
    6869      virtual void setBufferSize(const std::map<int,StdSize>& mapSize)=0; 
    6970 
    70  
     71      public:  
     72        static CContextClient* ONLINE(void) { return reinterpret_cast<CContextClient*>(0xdeaddead);} 
    7173    protected: 
    7274 
     
    104106  CContextClient* CContextClient::getNew<CContextClient::legacy>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) ; 
    105107 
     108  template<> 
     109  CContextClient* CContextClient::getNew<CContextClient::online>(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer) ; 
     110 
    106111 
    107112} 
  • XIOS3/trunk/src/transport/legacy_context_client.cpp

    r2458 r2507  
    4040    } 
    4141 
     42    CContextClient::ETransport getType(void) {return CContextClient::legacy ;} 
    4243 
    4344    /*! 
  • XIOS3/trunk/src/transport/legacy_context_client.hpp

    r2458 r2507  
    3131 
    3232      // Send event to server 
     33      ETransport getType(void) {return legacy ;} 
    3334      void sendEvent(CEventClient& event); 
    3435      void eventLoop(void) ; 
  • XIOS3/trunk/src/transport/legacy_context_server.cpp

    r2458 r2507  
    323323        { 
    324324          eventScheduler_->registerEvent(currentTimeLine,hashId); 
     325          info(100)<<"Context id "<<context->getId()<<"Schedule event : "<< currentTimeLine <<"  "<<hashId<<endl ; 
    325326          scheduled=true; 
    326327        } 
     
    342343            if (!flag) return ; 
    343344            eventScheduled_=false ; 
     345          } 
     346           
     347          if (CXios::checkEventSync) 
     348          { 
     349            int typeId, classId, typeId_in, classId_in; 
     350            long long timeLine_out; 
     351            long long timeLine_in( currentTimeLine ); 
     352            typeId_in=event->type ; 
     353            classId_in=event->classId ; 
     354   //        MPI_Allreduce(&timeLine,&timeLine_out, 1, MPI_UINT64_T, MPI_SUM, intraComm) ; // MPI_UINT64_T standardized by MPI 3 
     355            MPI_Allreduce(&timeLine_in,&timeLine_out, 1, MPI_LONG_LONG_INT, MPI_SUM, intraComm) ;  
     356            MPI_Allreduce(&typeId_in,&typeId, 1, MPI_INT, MPI_SUM, intraComm) ; 
     357            MPI_Allreduce(&classId_in,&classId, 1, MPI_INT, MPI_SUM, intraComm) ; 
     358            if (typeId/intraCommSize!=event->type || classId/intraCommSize!=event->classId || timeLine_out/intraCommSize!=currentTimeLine) 
     359            { 
     360               ERROR("void CLegacyContextClient::sendEvent(CEventClient& event)", 
     361                  << "Event are not coherent between client for timeline = "<<currentTimeLine); 
     362            } 
    344363          } 
    345364 
  • XIOS3/trunk/src/transport/one_sided_context_client.hpp

    r2458 r2507  
    3030      COneSidedContextClient(CContext* parent, MPI_Comm intraComm, MPI_Comm interComm, CContext* parentServer = 0); 
    3131 
     32      ETransport getType(void) {return oneSided ;} 
    3233      // Send event to server 
    3334      void sendEvent(CEventClient& event); 
  • XIOS3/trunk/src/type/type_util.hpp

    r2458 r2507  
    7070    class CServiceNode ; 
    7171    class CServiceNodeGroup ; 
    72        
     72    class CRedistributeDomain; 
     73    class CRedistributeDomainGroup; 
     74    class CRedistributeAxis; 
     75    class CRedistributeAxisGroup; 
     76    class CRedistributeScalar; 
     77    class CRedistributeScalarGroup; 
     78        
    7379  template <typename T> inline string getStrType(void); 
    7480 
     
    158164  macro(CServiceNode) 
    159165  macro(CServiceNodeGroup) 
    160    
     166  macro(CRedistributeDomain) 
     167  macro(CRedistributeDomainGroup)   
     168  macro(CRedistributeAxis) 
     169  macro(CRedistributeAxisGroup)   
     170  macro(CRedistributeScalar) 
     171  macro(CRedistributeScalarGroup)   
     172 
    161173#undef macro 
    162174} 
  • XIOS3/trunk/src/xml_parser_decl.cpp

    r2458 r2507  
    4444    macro( PoolNode ) 
    4545    macro( ServiceNode ) 
     46    macro( RedistributeDomain ) 
     47    macro( RedistributeAxis ) 
     48    macro( RedistributeScalar ) 
     49 
    4650  } 
    4751} 
Note: See TracChangeset for help on using the changeset viewer.