1 | /*! |
---|
2 | \file client_server_mapping.hpp |
---|
3 | \author Ha NGUYEN |
---|
4 | \since 27 Feb 2015 |
---|
5 | \date 09 Mars 2015 |
---|
6 | |
---|
7 | \brief Mapping between index client and server. |
---|
8 | Clients pre-calculate all information of server distribution. |
---|
9 | */ |
---|
10 | |
---|
11 | #ifndef __XIOS_CLIENT_SERVER_MAPPING_DISTRIBUTED_HPP__ |
---|
12 | #define __XIOS_CLIENT_SERVER_MAPPING_DISTRIBUTED_HPP__ |
---|
13 | |
---|
14 | #include <client_server_mapping.hpp> |
---|
15 | #include "xios_spl.hpp" |
---|
16 | #include "array_new.hpp" |
---|
17 | #include "mpi.hpp" |
---|
18 | #include <unordered_map> |
---|
19 | #include "client_client_dht_template.hpp" |
---|
20 | |
---|
21 | namespace xios |
---|
22 | { |
---|
23 | /*! |
---|
24 | \class CClientServerMappingDistributed |
---|
25 | This class computes index of data which are sent to server as well as index of data |
---|
26 | on server side with a distributed alogrithm. Each client has a piece of information about the distribution |
---|
27 | of servers. To find out all these info, first of all, all client join a discovering process in which each client |
---|
28 | announces the others about the info they have as well as demand others info they are lacked of. After this process, |
---|
29 | each client has enough info to decide to which client it need to send a demand for corresponding server of a global index. |
---|
30 | The alogrithm depends on hashed index. |
---|
31 | */ |
---|
32 | class CClientServerMappingDistributed : public CClientServerMapping |
---|
33 | { |
---|
34 | public: |
---|
35 | /** Default constructor */ |
---|
36 | CClientServerMappingDistributed(const std::unordered_map<size_t,int>& globalIndexOfServer, |
---|
37 | const MPI_Comm& clientIntraComm, |
---|
38 | bool isDataDistributed = true); |
---|
39 | |
---|
40 | virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClientSendToServer, int nbServer); |
---|
41 | |
---|
42 | /** Default destructor */ |
---|
43 | virtual ~CClientServerMappingDistributed(); |
---|
44 | |
---|
45 | protected: |
---|
46 | CClientClientDHTInt* ccDHT_; |
---|
47 | }; |
---|
48 | |
---|
49 | } // namespace xios |
---|
50 | #endif // __XIOS_CLIENT_SERVER_MAPPING_DISTRIBUTED_HPP__ |
---|