Last change
on this file since 1381 was
843,
checked in by mhnguyen, 8 years ago
|
Several improvements
+) Replace some time-consuming operations by simpler ones
Test
+) On Curie
+) All tests pass
|
File size:
1.4 KB
|
Line | |
---|
1 | /*! |
---|
2 | \file client_server_mapping.hpp |
---|
3 | \author Ha NGUYEN |
---|
4 | \since 04 Feb 2015 |
---|
5 | \date 09 Mars 2015 |
---|
6 | |
---|
7 | \brief Mapping between index client and server. |
---|
8 | */ |
---|
9 | #ifndef __XIOS_CLIENT_SERVER_MAPPING_HPP__ |
---|
10 | #define __XIOS_CLIENT_SERVER_MAPPING_HPP__ |
---|
11 | |
---|
12 | #include "xios_spl.hpp" |
---|
13 | #include "array_new.hpp" |
---|
14 | #include "mpi.hpp" |
---|
15 | #include <boost/unordered_map.hpp> |
---|
16 | |
---|
17 | namespace xios { |
---|
18 | |
---|
19 | /*! |
---|
20 | \class CClientServerMapping |
---|
21 | This class computes index of data which are sent to server as well as index of data |
---|
22 | on server side. |
---|
23 | */ |
---|
24 | class CClientServerMapping |
---|
25 | { |
---|
26 | public: |
---|
27 | typedef boost::unordered_map<int, std::vector<size_t> > GlobalIndexMap; |
---|
28 | public: |
---|
29 | /** Default constructor */ |
---|
30 | CClientServerMapping(); |
---|
31 | |
---|
32 | /** Default destructor */ |
---|
33 | virtual ~CClientServerMapping(); |
---|
34 | |
---|
35 | // Only need global index on client to calculate mapping (supposed client has info of distribution) |
---|
36 | virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) = 0; |
---|
37 | |
---|
38 | static std::map<int,int> computeConnectedClients(int nbServer, int nbClient, |
---|
39 | MPI_Comm& clientIntraComm, |
---|
40 | const std::vector<int>& connectedServerRank); |
---|
41 | |
---|
42 | const GlobalIndexMap& getGlobalIndexOnServer() const; |
---|
43 | |
---|
44 | protected: |
---|
45 | //! Global index of data on SERVER, which are calculated by client(s) |
---|
46 | GlobalIndexMap indexGlobalOnServer_; |
---|
47 | }; |
---|
48 | |
---|
49 | } // namespace xios |
---|
50 | #endif // __XIOS_CLIENT_SERVER_MAPPING_HPP__ |
---|
Note: See
TracBrowser
for help on using the repository browser.