Ignore:
Timestamp:
10/08/20 13:10:29 (4 years ago)
Author:
ymipsl
Message:

Xios coupling

  • fix problem when sending grid mask from client to server
  • remove methods about grid compression, which will be managed in other ways

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/domain.cpp

    r1943 r1956  
    246246 
    247247   /*! 
    248     * Test whether the data defined on the domain can be outputted in a compressed way. 
    249     * 
    250     * \return true if and only if a mask was defined for this domain 
     248    * Compute if the domain can be ouput in a compressed way. 
     249    * In this case the workflow view on server side must be the same 
     250    * than the full view for all context rank. The result is stored on 
     251    * internal isCompressible_ attribute. 
    251252    */ 
    252    bool CDomain::isCompressible(void) const 
    253    TRY 
    254    { 
    255       return isCompressible_; 
     253   void CDomain::computeIsCompressible(void) 
     254   TRY 
     255   { 
     256     // mesh is compressible contains some masked or indexed value, ie if full view is different of workflow view. 
     257     // But now assume that the size of the 2 view must be equal for everybody. True on server side 
     258     int isSameView = getLocalView(CElementView::FULL)->getSize() ==  getLocalView(CElementView::WORKFLOW)->getSize(); 
     259     MPI_Allreduce(MPI_IN_PLACE, &isSameView, 1, MPI_INT, MPI_LAND, CContext::getCurrent()->getIntraComm()) ; 
     260     if (isSameView) isCompressible_ = false ; 
     261     else isCompressible_ = true ; 
     262     isCompressibleComputed_=true ; 
    256263   } 
    257264   CATCH 
     
    13071314   CATCH_DUMP_ATTR 
    13081315 
    1309    void CDomain::checkEligibilityForCompressedOutput(void) 
    1310    TRY 
    1311    { 
    1312      // We don't check if the mask or the indexes are valid here, just if they have been defined at this point. 
    1313      isCompressible_ = !mask_1d.isEmpty() || !mask_2d.isEmpty() || !data_i_index.isEmpty(); 
    1314    } 
    1315    CATCH_DUMP_ATTR 
    13161316 
    13171317   //---------------------------------------------------------------- 
     
    22952295  
    22962296 
    2297   void CDomain::distributeToServer(CContextClient* client, map<int, CArray<size_t,1>>& globalIndex, const string& domainId) 
     2297  void CDomain::distributeToServer(CContextClient* client, map<int, CArray<size_t,1>>& globalIndex, 
     2298                                   CScattererConnector* &scattererConnector, const string& domainId) 
    22982299  TRY 
    22992300  { 
     
    23052306    CDistributedElement scatteredElement(ni_glo*nj_glo, globalIndex) ; 
    23062307    scatteredElement.addFullView() ; 
    2307     CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL),  
     2308    scattererConnector = new CScattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL),  
    23082309                                           context->getIntraComm(), client->getRemoteSize()) ; 
    2309     scattererConnector.computeConnector() ; 
     2310    scattererConnector->computeConnector() ; 
    23102311 
    23112312    // phase 0 
     
    23212322    CMessage message1 ; 
    23222323    message1<<serverDomainId<<1<<localElement_->getView(CElementView::FULL)->getGlobalSize() ;  
    2323     scattererConnector.transfer(localElement_->getView(CElementView::FULL)->getGlobalIndex(),client,event1,message1) ; 
     2324    scattererConnector->transfer(localElement_->getView(CElementView::FULL)->getGlobalIndex(),client,event1,message1) ; 
    23242325     
    2325     sendDistributedAttributes(client, scattererConnector, domainId) ; 
     2326    sendDistributedAttributes(client, *scattererConnector, domainId) ; 
    23262327 
    23272328   
     
    23382339    map<int,CArray<size_t,1>> workflowGlobalIndex ; 
    23392340    map<int,CArray<bool,1>> maskOut2 ;  
    2340     scattererConnector.transfer(maskOut, maskOut2, false) ; 
     2341    scattererConnector->transfer(maskOut, maskOut2, false) ; 
    23412342    scatteredElement.addView(CElementView::WORKFLOW, maskOut2) ; 
    23422343    scatteredElement.getView(CElementView::WORKFLOW)->getGlobalIndexView(workflowGlobalIndex) ; 
     
    24072408    else if (phasis==2) 
    24082409    { 
    2409       delete gathererConnector_ ; 
     2410//      delete gathererConnector_ ; 
    24102411      elementFrom_ = new  CDistributedElement(event) ; 
    24112412      elementFrom_->addFullView() ; 
    2412       gathererConnector_ =  new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::FULL)) ; 
    2413       gathererConnector_ -> computeConnector() ; 
     2413//      gathererConnector_ =  new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::FULL)) ; 
     2414//      gathererConnector_ -> computeConnector() ; 
    24142415    } 
    24152416  } 
Note: See TracChangeset for help on using the changeset viewer.