source: XIOS/trunk/src/client_server_mapping_distributed.hpp @ 829

Last change on this file since 829 was 829, checked in by mhnguyen, 8 years ago

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 size: 1.7 KB
Line 
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 <boost/unordered_map.hpp>
19#include "client_client_dht_template.hpp"
20
21namespace xios
22{
23/*!
24  \class CClientServerMappingDistributed
25  This class computes index of data which are sent to server as well as index of data
26on server side with a distributed alogrithm. Each client has a piece of information about the distribution
27of servers. To find out all these info, first of all, all client join a discovering process in which each client
28announces the others about the info they have as well as demand others info they are lacked of. After this process,
29each client has enough info to decide to which client it need to send a demand for corresponding server of a global index.
30The alogrithm depends on hashed index.
31*/
32class CClientServerMappingDistributed : public CClientServerMapping
33{
34  public:
35    /** Default constructor */
36    CClientServerMappingDistributed(const boost::unordered_map<size_t,int>& globalIndexOfServer,
37                                    const MPI_Comm& clientIntraComm, bool isDataDistributed = true);
38
39    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClientSendToServer);
40
41    /** Default destructor */
42    virtual ~CClientServerMappingDistributed();
43
44  protected:
45    CClientClientDHTInt* ccDHT_;
46};
47
48} // namespace xios
49#endif // __XIOS_CLIENT_SERVER_MAPPING_DISTRIBUTED_HPP__
Note: See TracBrowser for help on using the repository browser.