Ignore:
Timestamp:
06/09/16 11:32:01 (5 years ago)
Author:
mhnguyen
Message:

Improvement of DHT: allow multiple values correspond to one key

+) If there are several returned values corresponding to one key,
all of them are returned by DHT in vector.

Test
+) Testing only very basic. This commit serves as temporary one.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/client_client_dht_template.hpp

    r843 r860  
    3636    typedef typename boost::unordered_map<InfoType, std::vector<size_t> > InfoType2IndexMap; 
    3737    typedef typename boost::unordered_map<size_t,InfoType> Index2InfoTypeMap; 
     38    typedef typename boost::unordered_map<size_t,std::vector<InfoType> > Index2VectorInfoTypeMap; 
    3839 
    3940  public: 
     
    4142                             const MPI_Comm& clientIntraComm); 
    4243 
     44    CClientClientDHTTemplate(const Index2VectorInfoTypeMap& indexInfoInitMap, 
     45                             const MPI_Comm& clientIntraComm); 
     46 
    4347    void computeIndexInfoMapping(const CArray<size_t,1>& indices); 
    4448 
    45     const Index2InfoTypeMap& getInfoIndexMap() const {return indexToInfoMappingLevel_; } 
     49//    const Index2InfoTypeMap& getInfoIndexMap() const {return indexToInfoMappingLevel_; } 
     50    const Index2VectorInfoTypeMap& getInfoIndexMap() const {return indexToInfoMappingLevel_; } 
    4651 
    4752    int getNbClient() { return nbClient_; } 
     
    5560                                 const MPI_Comm& intraCommLevel, 
    5661                                 int level); 
     62 
     63    void computeDistributedIndex(const Index2VectorInfoTypeMap& indexInfoInitMap, 
     64                                 const MPI_Comm& intraCommLevel, 
     65                                 int level); 
     66 
    5767 
    5868    void computeHashIndex(std::vector<size_t>& indexClientHash, int nbClient); 
     
    92102  protected: 
    93103    //! Mapping of global index to the corresponding client 
    94     Index2InfoTypeMap index2InfoMapping_; 
     104//    Index2InfoTypeMap index2InfoMapping_; 
     105    Index2VectorInfoTypeMap index2InfoMapping_; 
    95106 
    96107    //! A mapping of index to the corresponding information in each level of hierarchy 
    97     Index2InfoTypeMap indexToInfoMappingLevel_; 
     108//    Index2InfoTypeMap indexToInfoMappingLevel_; 
     109    Index2VectorInfoTypeMap indexToInfoMappingLevel_; 
    98110 
    99111    std::vector<std::vector<int> > sendRank_; 
Note: See TracChangeset for help on using the changeset viewer.