Ignore:
Timestamp:
01/31/19 12:12:52 (5 years ago)
Author:
yushan
Message:

branch merged with trunk @1645. arch file (ep&mpi) added for ADA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/src/transformation/grid_transformation.cpp

    r1601 r1646  
    3838*/ 
    3939void CGridTransformation::selectScalarAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     40TRY 
    4041{ 
    4142  std::vector<CScalar*> scaListDestP = gridDestination_->getScalars(); 
     
    5960  algoTransformation_.push_back(algo); 
    6061} 
     62CATCH 
    6163 
    6264/*! 
     
    6769*/ 
    6870void CGridTransformation::selectAxisAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     71TRY 
    6972{ 
    7073  std::vector<CAxis*> axisListDestP = gridDestination_->getAxis(); 
     
    8891  algoTransformation_.push_back(algo); 
    8992} 
     93CATCH 
    9094 
    9195/*! 
     
    96100*/ 
    97101void CGridTransformation::selectDomainAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder) 
     102TRY 
    98103{ 
    99104  std::vector<CDomain*> domainListDestP = gridDestination_->getDomains(); 
     
    117122  algoTransformation_.push_back(algo); 
    118123} 
     124CATCH 
    119125 
    120126/*! 
     
    123129*/ 
    124130std::map<int,std::pair<int,int> > CGridTransformation::getElementPosition(CGrid* grid) 
     131TRY 
    125132{ 
    126133  std::vector<CScalar*> scalarListP = grid->getScalars();  
     
    155162  return elementPosition;   
    156163} 
     164CATCH 
    157165 
    158166/*! 
     
    163171*/ 
    164172void CGridTransformation::setUpGridDestination(int elementPositionInGrid, ETranformationType transType) 
     173TRY 
    165174{ 
    166175  if (isSpecialTransformation(transType)) return; 
     
    240249  tempGridDests_.push_back(tmpGridDestination_); 
    241250} 
     251CATCH 
    242252 
    243253/*! 
     
    249259*/ 
    250260void CGridTransformation::setUpGridSource(int elementPositionInGrid) 
     261TRY 
    251262{ 
    252263  if (!tempGridSrcs_.empty() && (getNbAlgo()-1) == tempGridSrcs_.size()) 
     
    326337  tempGridSrcs_.push_back(gridSource_); 
    327338} 
     339CATCH 
    328340 
    329341/*! 
     
    336348*/ 
    337349void CGridTransformation::computeAll(const std::vector<CArray<double,1>* >& dataAuxInputs, Time timeStamp) 
     350TRY 
    338351{ 
    339352  if (nbNormalAlgos_ < 1) return; 
     
    346359      std::list<RecvIndexGridDestinationMap>().swap(localIndexToReceiveOnGridDest_); 
    347360      std::list<size_t>().swap(nbLocalIndexOnGridDest_); 
    348       std::list<std::vector<bool> >().swap(localMaskOnGridDest_); 
    349361    } 
    350362    else 
     
    399411        vector<int> localDst ; 
    400412        vector<double> weight ; 
    401         localMaskOnGridDest_.push_back(vector<bool>()) ; 
     413        int nbLocalIndexOnGridDest; 
    402414        CTimer::get("computeTransformationMappingNonDistributed").resume();   
    403415        algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_,  
    404                                                          localSrc, localDst, weight, localMaskOnGridDest_.back()) ; 
     416                                                         localSrc, localDst, weight, nbLocalIndexOnGridDest) ; 
    405417        CTimer::get("computeTransformationMappingNonDistributed").suspend();   
    406418 
    407419        CTimer::get("computeTransformationMappingConvert").resume();   
    408         nbLocalIndexOnGridDest_.push_back(localMaskOnGridDest_.back().size()) ; 
     420        nbLocalIndexOnGridDest_.push_back(nbLocalIndexOnGridDest) ; 
    409421        int clientRank=client->clientRank ; 
    410422        { 
     
    453465  } 
    454466} 
     467CATCH 
    455468 
    456469/*! 
     
    459472*/ 
    460473void CGridTransformation::computeTransformationMapping(const SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 
     474TRY 
    461475{ 
    462476  CContext* context = CContext::getCurrent(); 
     
    472486  size_t nbLocalIndex = globalLocalIndexGridDestSendToServer.size(); 
    473487  nbLocalIndexOnGridDest_.push_back(nbLocalIndex); 
    474   localMaskOnGridDest_.push_back(std::vector<bool>()); 
    475   std::vector<bool>& tmpMask = localMaskOnGridDest_.back(); 
    476   tmpMask.resize(nbLocalIndex,false); 
     488//  localMaskOnGridDest_.push_back(std::vector<bool>()); 
     489//  std::vector<bool>& tmpMask = localMaskOnGridDest_.back(); 
     490//  tmpMask.resize(nbLocalIndex,false); 
    477491 
    478492  // Find out number of index sent from grid source and number of index received on grid destination 
     
    653667        recvTmp[recvRank][realRecvSize].first = globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]; 
    654668        recvTmp[recvRank][realRecvSize].second = recvWeightDst(idx); 
    655         tmpMask[globalLocalIndexGridDestSendToServer[recvIndexDst(idx)]] = true; 
    656669         ++realRecvSize; 
    657670      } 
     
    678691 
    679692} 
     693CATCH 
    680694 
    681695/*! 
     
    684698*/ 
    685699const std::list<CGridTransformation::SendingIndexGridSourceMap>& CGridTransformation::getLocalIndexToSendFromGridSource() const 
     700TRY 
    686701{ 
    687702  return localIndexToSendFromGridSource_; 
    688703} 
     704CATCH 
    689705 
    690706/*! 
     
    693709*/ 
    694710const std::list<CGridTransformation::RecvIndexGridDestinationMap>& CGridTransformation::getLocalIndexToReceiveOnGridDest() const 
     711TRY 
    695712{ 
    696713  return localIndexToReceiveOnGridDest_; 
    697714} 
     715CATCH 
    698716 
    699717/*! 
     
    702720*/ 
    703721const std::list<size_t>& CGridTransformation::getNbLocalIndexToReceiveOnGridDest() const 
     722TRY 
    704723{ 
    705724  return nbLocalIndexOnGridDest_; 
    706725} 
    707  
    708 /*! 
    709   Local mask of data which will be received on the grid destination 
    710   \return local mask of data 
    711 */ 
    712 const std::list<std::vector<bool> >& CGridTransformation::getLocalMaskIndexOnGridDest() const 
    713 { 
    714   return localMaskOnGridDest_; 
    715 } 
    716  
    717 } 
     726CATCH 
     727 
     728} 
Note: See TracChangeset for help on using the changeset viewer.