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/axis.cpp

    r1950 r1956  
    9999 
    100100   /*! 
    101     * Test whether the data defined on the axis can be outputted in a compressed way. 
    102     * 
    103     * \return true if and only if a mask was defined for this axis 
     101    * Compute if the axis can be ouput in a compressed way. 
     102    * In this case the workflow view on server side must be the same 
     103    * than the full view for all context rank. The result is stored on 
     104    * internal isCompressible_ attribute. 
    104105    */ 
    105    bool CAxis::isCompressible(void) const 
    106    TRY 
    107    { 
    108       return isCompressible_; 
     106   void CAxis::computeIsCompressible(void) 
     107   TRY 
     108   { 
     109     // mesh is compressible contains some masked or indexed value, ie if full view is different of workflow view. 
     110     // But now assume that the size of the 2 view must be equal for everybody. True on server side 
     111     int isSameView = getLocalView(CElementView::FULL)->getSize() ==  getLocalView(CElementView::WORKFLOW)->getSize(); 
     112     MPI_Allreduce(MPI_IN_PLACE, &isSameView, 1, MPI_INT, MPI_LAND, CContext::getCurrent()->getIntraComm()) ; 
     113     if (isSameView) isCompressible_ = false ; 
     114     else isCompressible_ = true ; 
     115     isCompressibleComputed_=true ; 
    109116   } 
    110117   CATCH 
     
    462469  CATCH_DUMP_ATTR 
    463470 
    464   /*! 
    465     Check whether we can do compressed output 
    466   */ 
    467   void CAxis::checkEligibilityForCompressedOutput() 
    468   TRY 
    469   { 
    470     // We don't check if the mask is valid here, just if a mask has been defined at this point. 
    471     isCompressible_ = !mask.isEmpty(); 
    472   } 
    473   CATCH_DUMP_ATTR 
    474  
     471  
    475472  /*! 
    476473    Dispatch event from the lower communication layer then process event according to its type 
     
    16471644  } 
    16481645  
    1649   void CAxis::distributeToServer(CContextClient* client, std::map<int, CArray<size_t,1>>& globalIndex, const string& axisId) 
     1646  void CAxis::distributeToServer(CContextClient* client, std::map<int, CArray<size_t,1>>& globalIndex,  
     1647                                 CScattererConnector* &scattererConnector, const string& axisId) 
    16501648  { 
    16511649    string serverAxisId = axisId.empty() ? this->getId() : axisId ; 
     
    16561654    CDistributedElement scatteredElement(n_glo,globalIndex) ; 
    16571655    scatteredElement.addFullView() ; 
    1658     CScattererConnector scattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL),  
    1659                                            context->getIntraComm(), client->getRemoteSize()) ; 
    1660     scattererConnector.computeConnector() ; 
     1656    scattererConnector = new CScattererConnector(localElement_->getView(CElementView::FULL), scatteredElement.getView(CElementView::FULL),  
     1657                                                 context->getIntraComm(), client->getRemoteSize()) ; 
     1658    scattererConnector->computeConnector() ; 
    16611659     
    16621660    // phase 0 
     
    16721670    CMessage message1 ; 
    16731671    message1<<serverAxisId<<1<<localElement_->getView(CElementView::FULL)->getGlobalSize() ;  
    1674     scattererConnector.transfer(localElement_->getView(CElementView::FULL)->getGlobalIndex(),client,event1,message1) ; 
    1675  
    1676     sendDistributedAttributes(client, scattererConnector, axisId) ; 
     1672    scattererConnector->transfer(localElement_->getView(CElementView::FULL)->getGlobalIndex(),client,event1,message1) ; 
     1673 
     1674    sendDistributedAttributes(client, *scattererConnector, axisId) ; 
    16771675   
    16781676    // phase 2 send the mask : data index + mask2D 
     
    16871685    map<int,CArray<size_t,1>> workflowGlobalIndex ; 
    16881686    map<int,CArray<bool,1>> maskOut2 ;  
    1689     scattererConnector.transfer(maskOut, maskOut2) ; 
     1687    scattererConnector->transfer(maskOut, maskOut2) ; 
    16901688    scatteredElement.addView(CElementView::WORKFLOW, maskOut2) ; 
    16911689    scatteredElement.getView(CElementView::WORKFLOW)->getGlobalIndexView(workflowGlobalIndex) ; 
     
    17521750    else if (phasis==2) 
    17531751    { 
    1754       delete gathererConnector_ ; 
     1752//      delete gathererConnector_ ; 
    17551753      elementFrom_ = new  CDistributedElement(event) ; 
    17561754      elementFrom_->addFullView() ; 
    1757       gathererConnector_ =  new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::FULL)) ; 
    1758       gathererConnector_ -> computeConnector() ; 
     1755//      gathererConnector_ =  new CGathererConnector(elementFrom_->getView(CElementView::FULL), localElement_->getView(CElementView::FULL)) ; 
     1756//      gathererConnector_ -> computeConnector() ; 
    17591757    } 
    17601758   
Note: See TracChangeset for help on using the changeset viewer.