Ignore:
Timestamp:
03/23/16 16:11:01 (8 years ago)
Author:
mhnguyen
Message:

Refactoring transformation code

+) On exchanging information during transformation, not only global index are sent but also local index
+) Correct a bug in distributed hash table (dht)
+) Add new type for dht
+) Clean up some redundant codes

Test
+) On Curie
+) Every test passes
+) Code runs faster in some cases (up to 30%)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/transformation_mapping.hpp

    r630 r829  
    2828{ 
    2929public: 
     30  typedef boost::unordered_map<size_t, std::vector<std::pair<int, std::pair<size_t,double> > > > DestinationIndexMap; 
     31  typedef boost::unordered_map<int,std::vector<std::vector<std::pair<int, std::pair<size_t,double> > > > > ReceivedIndexMap; 
     32  typedef boost::unordered_map<int,std::vector<std::pair<int, size_t> > > SentIndexMap; 
     33 
     34public: 
    3035  /** Default constructor */ 
    3136  CTransformationMapping(CGrid* destination, CGrid* source); 
     
    3439  ~CTransformationMapping(); 
    3540 
    36   void computeTransformationMapping(const std::map<size_t, std::vector<std::pair<size_t,double> > >& globaIndexMapFromDestToSource); 
    37   const std::map<int,std::vector<std::vector<std::pair<size_t,double> > > >& getGlobalIndexReceivedOnGridDestMapping() const; 
    38   const std::map<int,std::vector<size_t> >& getGlobalIndexSendToGridDestMapping() const; 
     41  void computeTransformationMapping(const DestinationIndexMap& globaIndexMapFromDestToSource); 
     42  const ReceivedIndexMap& getGlobalIndexReceivedOnGridDestMapping() const; 
     43  const SentIndexMap& getGlobalIndexSendToGridDestMapping() const; 
    3944 
    4045protected: 
     
    4348 
    4449  //! Global index mapping of grid source and grid destination between two clients 
    45   CClientServerMappingDistributed* gridIndexClientClientMapping_; 
     50  CClientClientDHTPairIntInt* gridIndexClientClientMapping_; 
    4651 
    4752  //! Mapping of client rank of grid source and global index received in grid destination 
    48   std::map<int,std::vector<std::vector<std::pair<size_t,double> > > > globalIndexReceivedOnGridDestMapping_; 
     53  ReceivedIndexMap globalIndexReceivedOnGridDestMapping_; 
    4954 
    5055  //! Mapping of client rank of grid destination and global index to send from grid source 
    51   std::map<int,std::vector<size_t> > globalIndexSendToGridDestMapping_; 
     56  SentIndexMap globalIndexSendToGridDestMapping_; 
    5257}; 
    5358 
Note: See TracChangeset for help on using the changeset viewer.