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/client_server_mapping_distributed.hpp

    r759 r829  
    4242    virtual ~CClientServerMappingDistributed(); 
    4343 
    44  
    45  
    4644  protected: 
    47     // Redistribute global index and server index among clients 
    48     void computeDistributedServerIndex(const boost::unordered_map<size_t,int>& globalIndexOfServer, 
    49                                        const MPI_Comm& clientIntraComm); 
    50  
    51     // Send server index to clients 
    52     void sendIndexServerToClients(int clientDestRank, std::vector<int>& indexServer, 
    53                                   const MPI_Comm& clientIntraComm, std::list<MPI_Request>& requestSendIndexServer); 
    54  
    55     // Send global index to clients 
    56     void sendIndexGlobalToClients(int clientDestRank, std::vector<size_t>& indexGlobal, 
    57                                   const MPI_Comm& clientIntraComm, std::list<MPI_Request>& requestSendIndexGlobal); 
    58  
    59     // Verify sending request 
    60     void testSendRequest(std::list<MPI_Request>& sendRequest); 
    61  
    62     // Process request 
    63     void processReceivedRequest(unsigned long* buffIndexGlobal, int* buffIndexServer, int count); 
    64  
    65     // Probe and receive message of global index 
    66     void probeIndexGlobalMessageFromClients(unsigned long* recvIndexGlobalBuff, int recvNbIndexCount); 
    67  
    68     // Probe and receive message of server index 
    69     void probeIndexServerMessageFromClients(int* recvIndexServerBuff, int recvNbIndexCount); 
    70  
    71     // Compute range of hashing 
    72     void computeHashIndex(); 
    73  
    74     // Compute size of receiving buffer for global index 
    75     int computeBuffCountIndexGlobal(MPI_Request& requestRecv); 
    76  
    77     // Compute size of receiving buffer for server index 
    78     int computeBuffCountIndexServer(MPI_Request& requestRecv); 
    79  
    80     // Reset request map 
    81     void resetReceivingRequestAndCount(); 
    82  
    83   protected: 
    84     //! Mapping of global index to the corresponding server 
    85     boost::unordered_map<size_t,int> globalIndexToServerMapping_; 
    86  
    87     //! Bounds of hash index 
    88     std::vector<size_t> indexClientHash_; 
    89  
    90     //! Number of client 
    91     int nbClient_; 
    92  
    93     //! Rank of client 
    94     int clientRank_; 
    95  
    96     //! Counting of buffer for receiving global index 
    97     int countIndexGlobal_; 
    98  
    99     //! Counting of buffer for receiving server index 
    100     int countIndexServer_; 
    101  
    102     //! intracommuntion of clients 
    103     MPI_Comm clientIntraComm_; 
    104  
    105     //! Request returned by MPI_IRecv function about global index 
    106     std::map<int, MPI_Request> requestRecvIndexGlobal_; 
    107  
    108     //! Request returned by MPI_IRecv function about index of server 
    109     std::map<int, MPI_Request> requestRecvIndexServer_; 
    110  
    111     //! Mapping client rank and the beginning position of receiving buffer for message of global index from this client 
    112     std::map<int, unsigned long*> indexGlobalBuffBegin_; 
    113  
    114     //! Mapping client rank and the begining position of receiving buffer for message of server index from this client 
    115     std::map<int, int*> indexServerBuffBegin_; 
    116  
    117     //! Flag to specify whether data is distributed or not 
    118     bool isDataDistributed_; 
    119  
    120 //    CClientClientDHTTemplate<int>* ccDHT_; 
    12145    CClientClientDHTInt* ccDHT_; 
    12246}; 
Note: See TracChangeset for help on using the changeset viewer.