Ignore:
Timestamp:
06/18/18 20:32:55 (6 years ago)
Author:
yushan
Message:

branch_openmp merged with trunk r1544

Location:
XIOS/dev/branch_openmp/src/transformation
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/transformation/Functions/reduction.hpp

    r1460 r1545  
    2323{ 
    2424public: 
    25   //static std::map<StdString,EReductionType> ReductionOperations; 
    2625  static std::map<StdString,EReductionType> *ReductionOperations_ptr; 
    2726  #pragma omp threadprivate(ReductionOperations_ptr) 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_extract_domain.cpp

    r1460 r1545  
    1313#include "grid.hpp" 
    1414#include "grid_transformation_factory_impl.hpp" 
    15 //#include "reduction.hpp" 
    1615 
    1716namespace xios { 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_inverse.cpp

    r1328 r1545  
    109109  } 
    110110 
    111   typedef boost::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest; 
     111  typedef std::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest; 
    112112  GlobalIndexMapFromSrcToDest globalIndexMapFromSrcToDest; 
    113113  TransformationIndexMap& transMap = this->transformationMapping_[0]; 
     
    127127  dhtIndexProcRank.computeIndexInfoMapping(globalSrcIndex); 
    128128  CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 
    129   boost::unordered_map<int, std::vector<size_t> > globalSrcIndexSendToProc; 
     129  std::unordered_map<int, std::vector<size_t> > globalSrcIndexSendToProc; 
    130130  for (int idx = 0; idx < localIndex; ++idx) 
    131131  { 
     
    138138  } 
    139139 
    140   boost::unordered_map<int, std::vector<size_t> >::const_iterator itbIndex = globalSrcIndexSendToProc.begin(), itIndex, 
     140  std::unordered_map<int, std::vector<size_t> >::const_iterator itbIndex = globalSrcIndexSendToProc.begin(), itIndex, 
    141141                                                                  iteIndex = globalSrcIndexSendToProc.end(); 
    142142  std::map<int,int> sendRankSizeMap,recvRankSizeMap; 
     
    176176  std::vector<MPI_Request> requests; 
    177177  std::vector<MPI_Status> status; 
    178   boost::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 
    179   boost::unordered_map<int, double* > sendValueToDest; 
     178  std::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 
     179  std::unordered_map<int, double* > sendValueToDest; 
    180180  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv) 
    181181  { 
     
    189189  } 
    190190 
    191   boost::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
    192   boost::unordered_map<int, double* > recvValueFromSrc; 
     191  std::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
     192  std::unordered_map<int, double* > recvValueFromSrc; 
    193193  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 
    194194  { 
     
    272272  delete [] recvSizeBuff; 
    273273 
    274   boost::unordered_map<int, double* >::const_iterator itChar; 
     274  std::unordered_map<int, double* >::const_iterator itChar; 
    275275  for (itChar = sendValueToDest.begin(); itChar != sendValueToDest.end(); ++itChar) 
    276276    delete [] itChar->second; 
    277277  for (itChar = recvValueFromSrc.begin(); itChar != recvValueFromSrc.end(); ++itChar) 
    278278    delete [] itChar->second; 
    279   boost::unordered_map<int, unsigned long* >::const_iterator itLong; 
     279  std::unordered_map<int, unsigned long* >::const_iterator itLong; 
    280280  for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong) 
    281281    delete [] itLong->second; 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_reduce_axis.cpp

    r1460 r1545  
    1212#include "grid.hpp" 
    1313#include "grid_transformation_factory_impl.hpp" 
    14 //#include "reduction.hpp" 
    1514 
    1615namespace xios { 
     
    7271    CReductionAlgorithm::initReductionOperation(); 
    7372  } 
    74   //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
     73 
    7574  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
    7675} 
  • XIOS/dev/branch_openmp/src/transformation/axis_algorithm_reduce_domain.cpp

    r1460 r1545  
    1313#include "grid.hpp" 
    1414#include "grid_transformation_factory_impl.hpp" 
    15 //#include "reduction.hpp" 
     15 
    1616 
    1717namespace xios { 
     
    7474    CReductionAlgorithm::initReductionOperation(); 
    7575  } 
    76   //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    7776  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
    7877  local = algo->local ; 
  • XIOS/dev/branch_openmp/src/transformation/domain_algorithm_interpolate.cpp

    r1540 r1545  
    88 */ 
    99#include "domain_algorithm_interpolate.hpp" 
    10 #include <boost/unordered_map.hpp> 
     10#include <unordered_map> 
    1111#include "context.hpp" 
    1212#include "context_client.hpp" 
     
    406406  CContext* context = CContext::getCurrent(); 
    407407  CContextClient* client=context->client; 
    408   //int mykey; 
    409   //ep_lib::MPI_Comm_rank(client->intraComm, &mykey); 
    410408 
    411409  ep_lib::MPI_Comm poleComme = MPI_COMM_NULL; 
    412410  ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, 0, &poleComme); 
    413   //ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, mykey, &poleComme); 
    414   //if (!poleComme.is_null()) 
    415411  if (poleComme!=MPI_COMM_NULL) 
    416412  { 
     
    540536  TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    541537 
    542   boost::unordered_map<size_t,int> globalIndexOfDomainDest; 
     538  std::unordered_map<size_t,int> globalIndexOfDomainDest; 
    543539  int ni = domainDest_->ni.getValue(); 
    544540  int nj = domainDest_->nj.getValue(); 
     
    816812  WriteNetCdf *netCdfWriter; 
    817813 
    818 //  #pragma omp barrier 
    819 //  #pragma omp master 
     814 
    820815  MPI_Barrier_local(client->intraComm); 
    821816  if(my_rank_loc==0) 
     
    843838  } 
    844839   
    845 //  #pragma omp barrier 
     840 
    846841  MPI_Barrier_local(client->intraComm); 
    847842   
     
    863858  MPI_Barrier_local(client->intraComm); 
    864859   
    865 //  #pragma omp barrier 
    866   cout<<"end write weight info"<< endl; 
     860 
    867861} 
    868862 
     
    953947       renormalizationFactor=1 ; 
    954948     } 
    955       
     949 
    956950    if (firstPass) 
    957951    { 
     
    969963      else 
    970964      { 
    971         dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second;    
     965        dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 
     966        allMissing(localIndex[idx].first) = allMissing(localIndex[idx].first) && false; // Reset flag to indicate not all data source are nan 
    972967      } 
    973968    } 
     
    999994      if (renormalizationFactor.numElements()>0) dataOut/=renormalizationFactor ; // In some case, process doesn't received any data for interpolation (mask) 
    1000995                                                                                 // so renormalizationFactor is not initialized 
    1001     }     
    1002   } 
    1003 } 
    1004  
    1005 } 
     996    } 
     997  } 
     998} 
     999 
     1000} 
  • XIOS/dev/branch_openmp/src/transformation/generic_algorithm_transformation.cpp

    r1482 r1545  
    5151      } 
    5252    } 
     53 
    5354  } 
    5455  else 
     
    164165  int nbClient = client->clientSize; 
    165166 
    166   typedef boost::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap; 
     167  typedef std::unordered_map<int, std::vector<std::pair<int,double> > > SrcToDstMap; 
    167168  int idx; 
    168169 
     
    286287        if (idx != elementPositionInGrid) 
    287288        { 
    288           boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
     289          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
    289290                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    290291          for (it = itb; it != ite; ++it) it->second.resize(1); 
     
    300301        if (idx != elementPositionInGrid) 
    301302        { 
    302           boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
     303          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
    303304                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    304305          for (it = itb; it != ite; ++it) procOfNonTransformedElements_.insert(it->first); 
     
    358359          set<int> tmpSet ;  
    359360          procList.swap(tmpSet) ; 
    360           boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
     361          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
    361362                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    362363          for (it = itb; it != ite; ++it) 
     
    394395 
    395396    // Build mapping between global source element index and global destination element index. 
    396     boost::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]); 
     397    std::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]); 
    397398    std::set<int> tmpCounter; 
    398399    itTransWeight = itbTransWeight; 
     
    425426        if (idx != elementPositionInGrid) 
    426427        { 
    427           boost::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
     428          std::unordered_map<int,std::vector<size_t> >::iterator itb = globalElementIndexOnProc_[idx].begin(), it, 
    428429                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    429430          for (it = itb; it != ite; ++it) it->second[0] = transPos(idxTrans); 
     
    455456void CGenericAlgorithmTransformation::computeGlobalGridIndexMapping(int elementPositionInGrid, 
    456457                                                                   const std::vector<int>& srcRank, 
    457                                                                    boost::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 
     458                                                                   std::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 
    458459                                                                   CGrid* gridSrc, 
    459460                                                                   CGrid* gridDst, 
    460                                                                    std::vector<boost::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 
     461                                                                   std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 
    461462                                                                   SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 
    462463{ 
     
    614615  
    615616      SourceDestinationIndexMap::iterator rankIt,rankIte ; 
    616       boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > >::iterator globalSrcIndexIt, globalSrcIndexIte ; 
     617      std::unordered_map<size_t, std::vector<std::pair<size_t,double> > >::iterator globalSrcIndexIt, globalSrcIndexIte ; 
    617618      std::vector<std::pair<size_t,double> >::iterator vectIt,vectIte ; 
    618619    
     
    652653                                                                 CScalar* scalarSrc, 
    653654                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    654                                                                  boost::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc) 
     655                                                                 std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc) 
    655656{ 
    656657  CContext* context = CContext::getCurrent(); 
     
    676677                                                               CAxis* axisSrc, 
    677678                                                               CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    678                                                                boost::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc) 
     679                                                               std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc) 
    679680{ 
    680681  CContext* context = CContext::getCurrent(); 
     
    745746                                                                 CDomain* domainSrc, 
    746747                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    747                                                                  boost::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc) 
     748                                                                 std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc) 
    748749{ 
    749750  CContext* context = CContext::getCurrent(); 
  • XIOS/dev/branch_openmp/src/transformation/generic_algorithm_transformation.hpp

    r1460 r1545  
    3838public: 
    3939  // Mapping between global index map of DESTINATION and its local index with pair of global index of SOURCE and weights 
    40   typedef boost::unordered_map<int, boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > > > SourceDestinationIndexMap; 
     40  typedef std::unordered_map<int, std::unordered_map<size_t, std::vector<std::pair<size_t,double> > > > SourceDestinationIndexMap; 
    4141 
    4242protected: 
    43   typedef boost::unordered_map<size_t,int> GlobalLocalMap; 
     43  typedef std::unordered_map<size_t,int> GlobalLocalMap; 
    4444protected: 
    45   typedef boost::unordered_map<int, std::vector<int> > TransformationIndexMap; 
    46   typedef boost::unordered_map<int, std::vector<double> > TransformationWeightMap; 
    47   typedef boost::unordered_map<int, std::vector<int> > TransformationPositionMap; 
     45  typedef std::unordered_map<int, std::vector<int> > TransformationIndexMap; 
     46  typedef std::unordered_map<int, std::vector<double> > TransformationWeightMap; 
     47  typedef std::unordered_map<int, std::vector<int> > TransformationPositionMap; 
    4848 
    4949public: 
     
    108108  void computeGlobalGridIndexMapping(int elementPositionInGrid, 
    109109                                     const std::vector<int>& srcRank, 
    110                                      boost::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 
     110                                     std::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 
    111111                                     CGrid* gridDst, 
    112112                                     CGrid* gridSrc, 
    113                                      std::vector<boost::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 
     113                                     std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 
    114114                                     SourceDestinationIndexMap& globaIndexWeightFromSrcToDst); 
    115115 
     
    117117                                  CDomain* domainSrc, 
    118118                                  CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    119                                   boost::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc); 
     119                                  std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc); 
    120120 
    121121  void computeExchangeAxisIndex(CAxis* axisDst, 
    122122                                CAxis* axisSrc, 
    123123                                CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    124                                 boost::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc); 
     124                                std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc); 
    125125 
    126126  void computeExchangeScalarIndex(CScalar* scalarDst, 
    127127                                  CScalar* scalarSrc, 
    128128                                  CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    129                                   boost::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc); 
     129                                  std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc); 
    130130 
    131131  void computePositionElements(CGrid* dst, CGrid* src); 
     
    151151  std::set<StdSize> indexElementSrc_; 
    152152 
    153   std::vector<boost::unordered_map<int,std::vector<size_t> > > globalElementIndexOnProc_; 
     153  std::vector<std::unordered_map<int,std::vector<size_t> > > globalElementIndexOnProc_; 
    154154 
    155155  std::vector<int> procContainSrcElementIdx_;  // List of processes containing source index of transformed elements 
  • XIOS/dev/branch_openmp/src/transformation/grid_transformation.cpp

    r1460 r1545  
    1515#include "mpi_tag.hpp" 
    1616#include "grid.hpp" 
    17 #include <boost/unordered_map.hpp> 
     17#include <unordered_map> 
    1818#include "timer.hpp" 
    1919 
     
    479479  SourceDestinationIndexMap::const_iterator itbIndex = globaIndexWeightFromSrcToDst.begin(), 
    480480                                            iteIndex = globaIndexWeightFromSrcToDst.end(), itIndex; 
    481   typedef boost::unordered_map<size_t, std::vector<std::pair<size_t,double> > > SendIndexMap; 
     481  typedef std::unordered_map<size_t, std::vector<std::pair<size_t,double> > > SendIndexMap; 
    482482  std::map<int,int> sendRankSizeMap,recvRankSizeMap; 
    483483  int connectedClient = globaIndexWeightFromSrcToDst.size(); 
     
    522522  std::vector<ep_lib::MPI_Request> requests(recvRankSizeMap.size()*2 + globaIndexWeightFromSrcToDst.size()*2); 
    523523  std::vector<ep_lib::MPI_Status> status; 
    524   boost::unordered_map<int, unsigned char* > recvMaskDst; 
    525   boost::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 
     524  std::unordered_map<int, unsigned char* > recvMaskDst; 
     525  std::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 
    526526  int requests_position = 0; 
    527527  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv) 
     
    536536  } 
    537537 
    538   boost::unordered_map<int, CArray<size_t,1> > globalIndexDst; 
    539   boost::unordered_map<int, CArray<double,1> > weightDst; 
    540   boost::unordered_map<int, unsigned char* > sendMaskDst; 
    541   boost::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
     538  std::unordered_map<int, CArray<size_t,1> > globalIndexDst; 
     539  std::unordered_map<int, CArray<double,1> > weightDst; 
     540  std::unordered_map<int, unsigned char* > sendMaskDst; 
     541  std::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
    542542  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 
    543543  { 
     
    666666  delete [] recvSizeBuff; 
    667667 
    668   boost::unordered_map<int, unsigned char* >::const_iterator itChar; 
     668  std::unordered_map<int, unsigned char* >::const_iterator itChar; 
    669669  for (itChar = sendMaskDst.begin(); itChar != sendMaskDst.end(); ++itChar) 
    670670    delete [] itChar->second; 
    671671  for (itChar = recvMaskDst.begin(); itChar != recvMaskDst.end(); ++itChar) 
    672672    delete [] itChar->second; 
    673   boost::unordered_map<int, unsigned long* >::const_iterator itLong; 
     673  std::unordered_map<int, unsigned long* >::const_iterator itLong; 
    674674  for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong) 
    675675    delete [] itLong->second; 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_extract_axis.cpp

    r1460 r1545  
    1414#include "grid_transformation_factory_impl.hpp" 
    1515 
    16 //#include "reduction.hpp" 
     16 
    1717 
    1818namespace xios { 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_axis.cpp

    r1460 r1545  
    1313#include "grid.hpp" 
    1414#include "grid_transformation_factory_impl.hpp" 
    15 //#include "reduction.hpp" 
     15 
    1616 
    1717 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_domain.cpp

    r1460 r1545  
    1414#include "grid_transformation_factory_impl.hpp" 
    1515 
    16 //#include "reduction.hpp" 
    1716 
    1817namespace xios { 
     
    7574    CReductionAlgorithm::initReductionOperation(); 
    7675  } 
    77  
    78   //if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 
    7976  if (CReductionAlgorithm::ReductionOperations_ptr->end() == CReductionAlgorithm::ReductionOperations_ptr->find(op)) 
    8077    ERROR("CScalarAlgorithmReduceDomain::CScalarAlgorithmReduceDomain(CDomain* domainDestination, CDomain* domainSource, CReduceDomainToScalar* algo)", 
     
    8380       << "Scalar destination " << scalarDestination->getId()); 
    8481 
    85   //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
    8682  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
    8783  local = algo->local ; 
  • XIOS/dev/branch_openmp/src/transformation/scalar_algorithm_reduce_scalar.cpp

    r1460 r1545  
    99#include "grid.hpp" 
    1010#include "grid_transformation_factory_impl.hpp" 
    11 //#include "reduction.hpp" 
     11 
    1212 
    1313 
     
    7676  } 
    7777   
    78   //if (CReductionAlgorithm::ReductionOperations.end() == CReductionAlgorithm::ReductionOperations.find(op)) 
    7978  if (CReductionAlgorithm::ReductionOperations_ptr->end() == CReductionAlgorithm::ReductionOperations_ptr->find(op)) 
    8079    ERROR("CScalarAlgorithmReduceScalar::CScalarAlgorithmReduceScalar(CScalar* scalarDestination, CScalar* scalarSource, CReduceScalarToScalar* algo)", 
     
    8281       << "Scalar source " <<scalarSource->getId() << std::endl 
    8382       << "Scalar destination " << scalarDestination->getId()); 
    84    
    85   //reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations[op]); 
     83 
    8684  reduction_ = CReductionAlgorithm::createOperation(CReductionAlgorithm::ReductionOperations_ptr->at(op)); 
    8785} 
Note: See TracChangeset for help on using the changeset viewer.