Changeset 829 for XIOS/trunk/src/client_client_dht_template.hpp
- Timestamp:
- 03/23/16 16:11:01 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/client_client_dht_template.hpp
r727 r829 16 16 #include "policy.hpp" 17 17 #include <boost/unordered_map.hpp> 18 //#include "utils.hpp" 19 #include "dht_data_types.hpp" 18 20 19 21 namespace xios … … 33 35 typedef T InfoType; 34 36 static const int infoTypeSize = sizeof(InfoType); 37 typedef typename boost::unordered_map<InfoType, std::vector<size_t> > InfoType2IndexMap; 38 typedef typename boost::unordered_map<size_t,InfoType> Index2InfoTypeMap; 35 39 36 40 public: 37 41 /** Default constructor */ 38 CClientClientDHTTemplate(const boost::unordered_map<size_t,T>& indexInfoInitMap,42 CClientClientDHTTemplate(const Index2InfoTypeMap& indexInfoInitMap, 39 43 const MPI_Comm& clientIntraComm, 40 44 int hierarLvl = 2); … … 42 46 void computeIndexInfoMapping(const CArray<size_t,1>& indices); 43 47 44 const std::map<T, std::vector<size_t> >& getInfoIndexMap() const {return indexGlobalOnServer_; }48 const Index2InfoTypeMap& getInfoIndexMap() const {return infoIndexMapping_; } 45 49 46 50 /** Default destructor */ … … 49 53 protected: 50 54 // Redistribute index and info among clients 51 void computeDistributedIndex(const boost::unordered_map<size_t,T>& indexInfoInitMap,55 void computeDistributedIndex(const Index2InfoTypeMap& indexInfoInitMap, 52 56 const MPI_Comm& intraCommLevel, 53 57 int level); … … 67 71 const MPI_Comm& intraComm); 68 72 69 void probeInfoMessageFromClients( InfoType* recvIndexServerBuff,73 void probeInfoMessageFromClients(unsigned char* recvIndexServerBuff, 70 74 const int recvNbIndexCount, 71 75 int& countIndexServer, 72 std::map<int, InfoType*>& indexServerBuffBegin,76 std::map<int, unsigned char*>& indexServerBuffBegin, 73 77 std::map<int, MPI_Request>& requestRecvIndexServer, 74 78 const MPI_Comm& intraComm); … … 93 97 protected: 94 98 //! Mapping of global index to the corresponding client 95 boost::unordered_map<size_t,InfoType>index2InfoMapping_;99 Index2InfoTypeMap index2InfoMapping_; 96 100 97 101 //! A temporary mapping of index to the corresponding information in each level of hierarchy 98 boost::unordered_map<size_t,InfoType>indexToInfoMappingLevel_;102 Index2InfoTypeMap indexToInfoMappingLevel_; 99 103 100 //! Global index of data on SERVER, which are calculated by client(s)101 std::map<int, std::vector<size_t> > indexGlobalOnServer_;104 //! Data (information) corresponding to global index 105 Index2InfoTypeMap infoIndexMapping_; 102 106 103 107 //! intracommuntion of clients … … 109 113 110 114 typedef CClientClientDHTTemplate<int> CClientClientDHTInt; 115 typedef CClientClientDHTTemplate<PairIntInt> CClientClientDHTPairIntInt; 111 116 112 117 } // namespace xios
Note: See TracChangeset
for help on using the changeset viewer.