Changeset 1956 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
- Timestamp:
- 10/08/20 13:10:29 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/axis.cpp
r1950 r1956 99 99 100 100 /*! 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. 104 105 */ 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 ; 109 116 } 110 117 CATCH … … 462 469 CATCH_DUMP_ATTR 463 470 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 475 472 /*! 476 473 Dispatch event from the lower communication layer then process event according to its type … … 1647 1644 } 1648 1645 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) 1650 1648 { 1651 1649 string serverAxisId = axisId.empty() ? this->getId() : axisId ; … … 1656 1654 CDistributedElement scatteredElement(n_glo,globalIndex) ; 1657 1655 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() ; 1661 1659 1662 1660 // phase 0 … … 1672 1670 CMessage message1 ; 1673 1671 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) ; 1677 1675 1678 1676 // phase 2 send the mask : data index + mask2D … … 1687 1685 map<int,CArray<size_t,1>> workflowGlobalIndex ; 1688 1686 map<int,CArray<bool,1>> maskOut2 ; 1689 scattererConnector .transfer(maskOut, maskOut2) ;1687 scattererConnector->transfer(maskOut, maskOut2) ; 1690 1688 scatteredElement.addView(CElementView::WORKFLOW, maskOut2) ; 1691 1689 scatteredElement.getView(CElementView::WORKFLOW)->getGlobalIndexView(workflowGlobalIndex) ; … … 1752 1750 else if (phasis==2) 1753 1751 { 1754 delete gathererConnector_ ;1752 // delete gathererConnector_ ; 1755 1753 elementFrom_ = new CDistributedElement(event) ; 1756 1754 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() ; 1759 1757 } 1760 1758
Note: See TracChangeset
for help on using the changeset viewer.