XIOS  1.0
Xml I/O Server
 Tout Classes Espaces de nommage Fichiers Fonctions Variables Définitions de type Énumérations Valeurs énumérées Amis Macros
client_server_mapping.hpp
Aller à la documentation de ce fichier.
1 
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 <unordered_map>
16 
17 namespace xios {
18 
25 {
26 public:
27  typedef std::unordered_map<int, std::vector<size_t> > GlobalIndexMap;
28  public:
31 
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, int nbServer) = 0;
37 
38  static std::map<int,int> computeConnectedClients(int nbServer, int nbClient,
39  MPI_Comm& clientIntraComm,
40  const std::vector<int>& connectedServerRank);
41 
43 
45 
46  protected:
49 };
50 
51 } // namespace xios
52 #endif // __XIOS_CLIENT_SERVER_MAPPING_HPP__
#define xios(arg)
const GlobalIndexMap & getGlobalIndexOnServer() const
Return global index of data on each connected server.
This class computes index of data which are sent to server as well as index of data on server side...
virtual void computeServerIndexMapping(const CArray< size_t, 1 > &globalIndexOnClient, int nbServer)=0
std::unordered_map< int, std::vector< size_t > > GlobalIndexMap
GlobalIndexMap indexGlobalOnServer_
Global index of data on SERVER, which are calculated by client(s)
static std::map< int, int > computeConnectedClients(int nbServer, int nbClient, MPI_Comm &clientIntraComm, const std::vector< int > &connectedServerRank)
Compute how many clients each server will receive data from On client can send data to several server...