1 | #ifndef __XIOS_TRANSFORMATION_MAPPING_HPP__ |
---|
2 | #define __XIOS_TRANSFORMATION_MAPPING_HPP__ |
---|
3 | |
---|
4 | #include <map> |
---|
5 | #include <set> |
---|
6 | #include "grid.hpp" |
---|
7 | #include "array_new.hpp" |
---|
8 | #include "client_server_mapping_distributed.hpp" |
---|
9 | |
---|
10 | namespace xios { |
---|
11 | |
---|
12 | /*! |
---|
13 | \class CTransformationMapping |
---|
14 | This class is in charge of transfer the global index form grid from grid source to grid destination in a rather generic way. |
---|
15 | In order to make a transformation, the grid destination will make a request to grid source about the global indexes which it needs. |
---|
16 | The same discovering algorithm as the case of client-server is applied to find the corresponding client which contains the demanding global index. |
---|
17 | */ |
---|
18 | class CTransformationMapping |
---|
19 | { |
---|
20 | public: |
---|
21 | /** Default constructor */ |
---|
22 | CTransformationMapping(CGrid* destination, CGrid* source); |
---|
23 | ~CTransformationMapping(); |
---|
24 | |
---|
25 | void computeTransformationMapping(const std::map<size_t, std::set<size_t> >& globaIndexMapFromDestToSource); |
---|
26 | const std::map<int,std::vector<std::vector<size_t> > >& getGlobalIndexReceivedOnGridDestMapping() const; |
---|
27 | const std::map<int,std::vector<size_t> >& getGlobalIndexSendToGridDestMapping() const; |
---|
28 | |
---|
29 | protected: |
---|
30 | CGrid* gridSource_; // Grid source |
---|
31 | CGrid* gridDestination_; // Grid destination demande the necessary global index from grid source |
---|
32 | |
---|
33 | //! Global index mapping of grid source and grid destination between two clients |
---|
34 | CClientServerMappingDistributed* gridIndexClientClientMapping_; |
---|
35 | |
---|
36 | //! Mapping of client rank of grid source and global index received in grid destination |
---|
37 | std::map<int,std::vector<std::vector<size_t> > > globalIndexReceivedOnGridDestMapping_; |
---|
38 | |
---|
39 | //! Mapping of client rank of grid destination and global index to send from grid source |
---|
40 | std::map<int,std::vector<size_t> > globalIndexSendToGridDestMapping_; |
---|
41 | |
---|
42 | }; |
---|
43 | |
---|
44 | } |
---|
45 | #endif // __XIOS_TRANSFORMATION_MAPPING_HPP__ |
---|