source: XIOS/dev/dev_olga/src/client_server_mapping.hpp @ 1150

Last change on this file since 1150 was 1030, checked in by oabramkina, 7 years ago

dev: intermediate commit.

File size: 1.5 KB
RevLine 
[553]1/*!
2   \file client_server_mapping.hpp
3   \author Ha NGUYEN
4   \since 04 Feb 2015
[569]5   \date 09 Mars 2015
[553]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
[591]12#include "xios_spl.hpp"
[553]13#include "array_new.hpp"
14#include "mpi.hpp"
[829]15#include <boost/unordered_map.hpp>
[553]16
17namespace xios {
18
19/*!
20  \class CClientServerMapping
21  This class computes index of data which are sent to server as well as index of data
22on server side.
23*/
24class CClientServerMapping
25{
[829]26public:
27  typedef boost::unordered_map<int, std::vector<size_t> > GlobalIndexMap;
[1030]28//  typedef boost::map<int, std::vector<size_t> > GlobalIndexMap;
[553]29  public:
30    /** Default constructor */
31    CClientServerMapping();
32
33    /** Default destructor */
34    virtual ~CClientServerMapping();
35
[569]36    // Only need global index on client to calculate mapping (supposed client has info of distribution)
37    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient) = 0;
38
[598]39    static std::map<int,int> computeConnectedClients(int nbServer, int nbClient,
40                                                     MPI_Comm& clientIntraComm,
41                                                     const std::vector<int>& connectedServerRank);
[553]42
[829]43    const GlobalIndexMap& getGlobalIndexOnServer() const;
[554]44
[1025]45    GlobalIndexMap& getGlobalIndexOnServer();
46
[553]47  protected:
48    //! Global index of data on SERVER, which are calculated by client(s)
[829]49    GlobalIndexMap indexGlobalOnServer_;
[553]50};
51
52} // namespace xios
53#endif // __XIOS_CLIENT_SERVER_MAPPING_HPP__
Note: See TracBrowser for help on using the repository browser.