Ignore:
Timestamp:
06/13/18 16:48:53 (6 years ago)
Author:
oabramkina
Message:

Replacing Boost's unordered_map and shared_pointer by its STL counterparts.

Two notes for Curie:

  • one can see the content of unordered_map with ddt only if XIOS has been compiled with gnu
  • XIOS will not compile any more with pgi (all available versions use old STL which are not up to the c++11 norms)
Location:
XIOS/trunk/src/transformation
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/axis_algorithm_inverse.cpp

    r936 r1542  
    108108  } 
    109109 
    110   typedef boost::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest; 
     110  typedef std::unordered_map<size_t, std::vector<double> > GlobalIndexMapFromSrcToDest; 
    111111  GlobalIndexMapFromSrcToDest globalIndexMapFromSrcToDest; 
    112112  TransformationIndexMap& transMap = this->transformationMapping_[0]; 
     
    126126  dhtIndexProcRank.computeIndexInfoMapping(globalSrcIndex); 
    127127  CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 
    128   boost::unordered_map<int, std::vector<size_t> > globalSrcIndexSendToProc; 
     128  std::unordered_map<int, std::vector<size_t> > globalSrcIndexSendToProc; 
    129129  for (int idx = 0; idx < localIndex; ++idx) 
    130130  { 
     
    137137  } 
    138138 
    139   boost::unordered_map<int, std::vector<size_t> >::const_iterator itbIndex = globalSrcIndexSendToProc.begin(), itIndex, 
     139  std::unordered_map<int, std::vector<size_t> >::const_iterator itbIndex = globalSrcIndexSendToProc.begin(), itIndex, 
    140140                                                                  iteIndex = globalSrcIndexSendToProc.end(); 
    141141  std::map<int,int> sendRankSizeMap,recvRankSizeMap; 
     
    175175  std::vector<MPI_Request> requests; 
    176176  std::vector<MPI_Status> status; 
    177   boost::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 
    178   boost::unordered_map<int, double* > sendValueToDest; 
     177  std::unordered_map<int, unsigned long* > recvGlobalIndexSrc; 
     178  std::unordered_map<int, double* > sendValueToDest; 
    179179  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv) 
    180180  { 
     
    188188  } 
    189189 
    190   boost::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
    191   boost::unordered_map<int, double* > recvValueFromSrc; 
     190  std::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
     191  std::unordered_map<int, double* > recvValueFromSrc; 
    192192  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 
    193193  { 
     
    271271  delete [] recvSizeBuff; 
    272272 
    273   boost::unordered_map<int, double* >::const_iterator itChar; 
     273  std::unordered_map<int, double* >::const_iterator itChar; 
    274274  for (itChar = sendValueToDest.begin(); itChar != sendValueToDest.end(); ++itChar) 
    275275    delete [] itChar->second; 
    276276  for (itChar = recvValueFromSrc.begin(); itChar != recvValueFromSrc.end(); ++itChar) 
    277277    delete [] itChar->second; 
    278   boost::unordered_map<int, unsigned long* >::const_iterator itLong; 
     278  std::unordered_map<int, unsigned long* >::const_iterator itLong; 
    279279  for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong) 
    280280    delete [] itLong->second; 
  • XIOS/trunk/src/transformation/domain_algorithm_interpolate.cpp

    r1480 r1542  
    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" 
     
    536536  TransformationWeightMap& transWeight = this->transformationWeight_[0]; 
    537537 
    538   boost::unordered_map<size_t,int> globalIndexOfDomainDest; 
     538  std::unordered_map<size_t,int> globalIndexOfDomainDest; 
    539539  int ni = domainDest_->ni.getValue(); 
    540540  int nj = domainDest_->nj.getValue(); 
  • XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp

    r1480 r1542  
    165165  int nbClient = client->clientSize; 
    166166 
    167   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; 
    168168  int idx; 
    169169 
     
    287287        if (idx != elementPositionInGrid) 
    288288        { 
    289           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, 
    290290                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    291291          for (it = itb; it != ite; ++it) it->second.resize(1); 
     
    301301        if (idx != elementPositionInGrid) 
    302302        { 
    303           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, 
    304304                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    305305          for (it = itb; it != ite; ++it) procOfNonTransformedElements_.insert(it->first); 
     
    359359          set<int> tmpSet ;  
    360360          procList.swap(tmpSet) ; 
    361           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, 
    362362                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    363363          for (it = itb; it != ite; ++it) 
     
    395395 
    396396    // Build mapping between global source element index and global destination element index. 
    397     boost::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]); 
     397    std::unordered_map<int,std::vector<size_t> >().swap(globalElementIndexOnProc_[elementPositionInGrid]); 
    398398    std::set<int> tmpCounter; 
    399399    itTransWeight = itbTransWeight; 
     
    426426        if (idx != elementPositionInGrid) 
    427427        { 
    428           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, 
    429429                                                                   ite = globalElementIndexOnProc_[idx].end(); 
    430430          for (it = itb; it != ite; ++it) it->second[0] = transPos(idxTrans); 
     
    456456void CGenericAlgorithmTransformation::computeGlobalGridIndexMapping(int elementPositionInGrid, 
    457457                                                                   const std::vector<int>& srcRank, 
    458                                                                    boost::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 
     458                                                                   std::unordered_map<int, std::vector<std::pair<int,double> > >& src2DstMap, 
    459459                                                                   CGrid* gridSrc, 
    460460                                                                   CGrid* gridDst, 
    461                                                                    std::vector<boost::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 
     461                                                                   std::vector<std::unordered_map<int,std::vector<size_t> > >& globalElementIndexOnProc, 
    462462                                                                   SourceDestinationIndexMap& globaIndexWeightFromSrcToDst) 
    463463{ 
     
    615615  
    616616      SourceDestinationIndexMap::iterator rankIt,rankIte ; 
    617       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 ; 
    618618      std::vector<std::pair<size_t,double> >::iterator vectIt,vectIte ; 
    619619    
     
    653653                                                                 CScalar* scalarSrc, 
    654654                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    655                                                                  boost::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc) 
     655                                                                 std::unordered_map<int,std::vector<size_t> >& globalScalarIndexOnProc) 
    656656{ 
    657657  CContext* context = CContext::getCurrent(); 
     
    677677                                                               CAxis* axisSrc, 
    678678                                                               CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    679                                                                boost::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc) 
     679                                                               std::unordered_map<int,std::vector<size_t> >& globalAxisIndexOnProc) 
    680680{ 
    681681  CContext* context = CContext::getCurrent(); 
     
    746746                                                                 CDomain* domainSrc, 
    747747                                                                 CArray<size_t,1>& destGlobalIndexPositionInGrid, 
    748                                                                  boost::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc) 
     748                                                                 std::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc) 
    749749{ 
    750750  CContext* context = CContext::getCurrent(); 
  • XIOS/trunk/src/transformation/generic_algorithm_transformation.hpp

    r1420 r1542  
    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/trunk/src/transformation/grid_transformation.cpp

    r1412 r1542  
    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<MPI_Request> requests; 
    523523  std::vector<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  for (std::map<int,int>::const_iterator itRecv = recvRankSizeMap.begin(); itRecv != recvRankSizeMap.end(); ++itRecv) 
    527527  { 
     
    537537  } 
    538538 
    539   boost::unordered_map<int, CArray<size_t,1> > globalIndexDst; 
    540   boost::unordered_map<int, CArray<double,1> > weightDst; 
    541   boost::unordered_map<int, unsigned char* > sendMaskDst; 
    542   boost::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
     539  std::unordered_map<int, CArray<size_t,1> > globalIndexDst; 
     540  std::unordered_map<int, CArray<double,1> > weightDst; 
     541  std::unordered_map<int, unsigned char* > sendMaskDst; 
     542  std::unordered_map<int, unsigned long* > sendGlobalIndexSrc; 
    543543  for (itIndex = itbIndex; itIndex != iteIndex; ++itIndex) 
    544544  { 
     
    670670  delete [] recvSizeBuff; 
    671671 
    672   boost::unordered_map<int, unsigned char* >::const_iterator itChar; 
     672  std::unordered_map<int, unsigned char* >::const_iterator itChar; 
    673673  for (itChar = sendMaskDst.begin(); itChar != sendMaskDst.end(); ++itChar) 
    674674    delete [] itChar->second; 
    675675  for (itChar = recvMaskDst.begin(); itChar != recvMaskDst.end(); ++itChar) 
    676676    delete [] itChar->second; 
    677   boost::unordered_map<int, unsigned long* >::const_iterator itLong; 
     677  std::unordered_map<int, unsigned long* >::const_iterator itLong; 
    678678  for (itLong = sendGlobalIndexSrc.begin(); itLong != sendGlobalIndexSrc.end(); ++itLong) 
    679679    delete [] itLong->second; 
Note: See TracChangeset for help on using the changeset viewer.