source: XIOS/trunk/src/client_server_mapping.hpp @ 1620

Last change on this file since 1620 was 1542, checked in by oabramkina, 6 years ago

Replacing Boost's unordered_map and shared_pointer by its STL counterparts.

Two notes for Curie:

  • one can see the content of unordered_map with ddt only if XIOS has been compiled with gnu
  • XIOS will not compile any more with pgi (all available versions use old STL which are not up to the c++11 norms)
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"
[1542]15#include <unordered_map>
[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:
[1542]27  typedef std::unordered_map<int, std::vector<size_t> > GlobalIndexMap;
[553]28  public:
29    /** Default constructor */
30    CClientServerMapping();
31
32    /** Default destructor */
33    virtual ~CClientServerMapping();
34
[569]35    // Only need global index on client to calculate mapping (supposed client has info of distribution)
[1336]36    virtual void computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, int nbServer) = 0;
[569]37
[598]38    static std::map<int,int> computeConnectedClients(int nbServer, int nbClient,
39                                                     MPI_Comm& clientIntraComm,
40                                                     const std::vector<int>& connectedServerRank);
[553]41
[829]42    const GlobalIndexMap& getGlobalIndexOnServer() const;
[554]43
[1025]44    GlobalIndexMap& getGlobalIndexOnServer();
45
[553]46  protected:
47    //! Global index of data on SERVER, which are calculated by client(s)
[829]48    GlobalIndexMap indexGlobalOnServer_;
[553]49};
50
51} // namespace xios
52#endif // __XIOS_CLIENT_SERVER_MAPPING_HPP__
Note: See TracBrowser for help on using the repository browser.