Ignore:
Timestamp:
03/23/16 16:11:01 (8 years ago)
Author:
mhnguyen
Message:

Refactoring transformation code

+) On exchanging information during transformation, not only global index are sent but also local index
+) Correct a bug in distributed hash table (dht)
+) Add new type for dht
+) Clean up some redundant codes

Test
+) On Curie
+) Every test passes
+) Code runs faster in some cases (up to 30%)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/generic_algorithm_transformation.hpp

    r827 r829  
    2222{ 
    2323public: 
     24  // Stupid global index map, it must be replaced by tuple 
     25  // Mapping between global index map of DESTINATION and its local index with pair of global index of SOURCE and weights 
     26  typedef boost::unordered_map<size_t, std::vector<std::pair<int, std::pair<size_t,double> > > > DestinationIndexMap; 
     27protected: 
     28  typedef boost::unordered_map<size_t,int> GlobalLocalMap; 
     29 
     30public: 
    2431  CGenericAlgorithmTransformation(); 
    2532 
     
    3037                                const std::vector<int>& gridSrcGlobalDim, 
    3138                                const std::vector<size_t>& globalIndexGridDestSendToServer, 
    32                                 std::map<size_t, std::vector<std::pair<size_t,double> > >& globaIndexWeightFromDestToSource); 
     39                                const std::vector<int>& localIndexGridSendToServer, 
     40                                DestinationIndexMap& globaIndexWeightFromDestToSource); 
    3341 
    3442  std::vector<StdString> getIdAuxInputs(); 
     
    4654    \param[in] elementPositionInGrid position of the element in the grid (for example: a grid with one domain and one axis, position of domain is 1, position of axis is 2) 
    4755    \param[in] gridDestGlobalDim dimension size of destination grid (it should share the same size for all dimension, maybe except the element on which transformation is performed) 
    48     \param[in] globalIndexGridDestSendToServer global index of destination grid which are to be sent to server(s), this array is already acsending sorted 
    49     \param[in/out] globalIndexDestGrid array of global index (for 2d grid, this array maybe a line, for 3d, this array may represent a plan). It should be preallocated 
     56    \param[in] globalLocalIndexDestSendToServerMap pair of global index and local index of destination grid which are to be sent to server(s), this array is already acsending sorted 
     57    \param[in/out] globalLocalIndexDestMap array of global index (for 2d grid, this array maybe a line, for 3d, this array may represent a plan). It should be preallocated 
    5058    \param[in/out] globalIndexSrcGrid array of global index of source grid (for 2d grid, this array is a line, for 3d, this array represents a plan). It should be preallocated 
    5159  */ 
     
    5664                                                        const std::vector<int>& gridDestGlobalDim, 
    5765                                                        const std::vector<int>& gridSrcGlobalDim, 
    58                                                         const std::vector<size_t>& globalIndexGridDestSendToServer, 
    59                                                         CArray<size_t,1>& globalIndexDestGrid, 
     66                                                        const GlobalLocalMap& globalLocalIndexDestSendToServerMap, 
     67                                                        std::vector<std::pair<size_t,int> >& globalLocalIndexDestMap, 
    6068                                                        std::vector<std::vector<size_t> >& globalIndexSrcGrid) = 0; 
    6169 
Note: See TracChangeset for help on using the changeset viewer.