- Timestamp:
- 09/20/21 18:18:17 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/distribution/grid_remote_connector.cpp
r2179 r2236 111 111 /** 112 112 * \brief Compute the connector, i.e. compute the \b elements_ attribute. 113 * \detail Depending of the distributions of the view computed in the computeViewDistribution() call, the connector is computed in computeConnectorMethods(), and to achieve better optimisation 114 * some redondant ranks can be removed from the elements_ map. 115 */ 116 void CGridRemoteConnector::computeConnector(void) 117 { 118 computeViewDistribution() ; 119 computeConnectorMethods() ; 120 computeRedondantRanks() ; 121 for(auto& rank : rankToRemove_) 122 for(auto& element : elements_) element.erase(rank) ; 123 } 124 /** 125 * \brief Compute the connector, i.e. compute the \b elements_ attribute. 113 126 * \detail In order to achive better optimisation, 114 127 * we distingute the case when the grid is not distributed on source grid (\bcomputeSrcNonDistributed), … … 120 133 * redondantly the the remote servers 121 134 */ 122 void CGridRemoteConnector::computeConnector(void) 123 { 124 computeViewDistribution() ; 135 void CGridRemoteConnector::computeConnectorMethods(void) 136 { 125 137 vector<CLocalView*> srcView ; 126 138 vector<CDistributedView*> dstView ; … … 129 141 130 142 bool srcViewsNonDistributed=true ; 131 for(int i=0;i<srcView_.size();i++) srcViewsNonDistributed &=!isSrcViewDistributed_[i] ;143 for(int i=0;i<srcView_.size();i++) srcViewsNonDistributed = srcViewsNonDistributed && !isSrcViewDistributed_[i] ; 132 144 133 145 bool dstViewsNonDistributed=true ; 134 for(int i=0;i<dstView_.size();i++) dstViewsNonDistributed &=!isDstViewDistributed_[i] ;146 for(int i=0;i<dstView_.size();i++) dstViewsNonDistributed = dstViewsNonDistributed && !isDstViewDistributed_[i] ; 135 147 136 148 if (srcViewsNonDistributed) … … 184 196 } 185 197 186 removeRedondantRanks() ;187 198 } 188 199 … … 570 581 571 582 /** 572 * \brief Once the connector is computed (compute \b elements_), redondant data can be send to the server. 583 * \brief Once the connector is computed (compute \b elements_), redondant data can be avoid to be sent to the server. 584 * This call compute the redondant rank and store them in \b rankToRemove_ attribute. 573 585 * The goal of this method is to make a hash of each block of indice that determine wich data to send to a 574 586 * of a specific server rank using a hash method. So data to send to a rank is associated to a hash. 575 587 * After we compare hash between local rank and remove redondant data corresponding to the same hash. 576 588 */ 577 void CGridRemoteConnector:: removeRedondantRanks(void)589 void CGridRemoteConnector::computeRedondantRanks(void) 578 590 { 579 591 int commRank ; … … 635 647 // only the process with the lowest rank get in charge of sendinf data to remote server 636 648 for(int rank : ranks) if (commRank>rank) first=false ; 637 if (!first) 638 { 639 int rankToRemove=hashRank[hash] ; 640 for(auto& element : elements_) element.erase(rankToRemove) ; 641 } 642 } 643 644 645 } 649 if (!first) rankToRemove_.insert(hashRank[hash]) ; 650 } 651 } 652 646 653 }
Note: See TracChangeset
for help on using the changeset viewer.