Ignore:
Timestamp:
04/26/16 16:04:04 (8 years ago)
Author:
mhnguyen
Message:

Several improvements

+) Replace some time-consuming operations by simpler ones

Test
+) On Curie
+) All tests pass

Location:
XIOS/trunk/src/transformation
Files:
3 edited

Legend:

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

    r841 r843  
    8383      { 
    8484        size_t srcGridSize = globalIndexSrcGrid[idx].size(); 
    85 //        globaIndexWeightFromDestToSource[(it->first)].reserve(srcGridSize); 
    86         globaIndexWeightFromDestToSource[(it->first)].resize(srcGridSize); 
     85//        globaIndexWeightFromDestToSource[(it->first)].resize(srcGridSize); 
     86        DestinationGlobalIndex& tmp = globaIndexWeightFromDestToSource[(it->first)]; 
     87        tmp.resize(srcGridSize); 
    8788        for (int i = 0; i < srcGridSize; ++i) 
    8889        { 
    89           globaIndexWeightFromDestToSource[(it->first)][i] = (make_pair(it->second, make_pair(globalIndexSrcGrid[idx][i], currentVecWeight[i]))); 
     90          tmp[i].first = it->second; 
     91          tmp[i].second = make_pair(globalIndexSrcGrid[idx][i], currentVecWeight[i]); 
     92//          globaIndexWeightFromDestToSource[(it->first)][i] = (make_pair(it->second, make_pair(globalIndexSrcGrid[idx][i], currentVecWeight[i]))); 
    9093        } 
    9194      } 
  • XIOS/trunk/src/transformation/generic_algorithm_transformation.hpp

    r833 r843  
    2121class CGenericAlgorithmTransformation 
    2222{ 
     23protected: 
     24  typedef std::vector<std::pair<int, std::pair<size_t,double> > > DestinationGlobalIndex; 
    2325public: 
    2426  // Stupid global index map, it must be replaced by tuple 
    2527  // 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; 
     28  typedef boost::unordered_map<size_t, DestinationGlobalIndex> DestinationIndexMap; 
     29 
    2730protected: 
    2831  typedef boost::unordered_map<size_t,int> GlobalLocalMap; 
  • XIOS/trunk/src/transformation/transformation_mapping.cpp

    r842 r843  
    3131 
    3232  // Mapping of global index and pair containing rank and local index 
    33   CClientClientDHTPairIntInt::Index2InfoTypeMap globalIndexOfServer; 
     33  CClientClientDHTPairIntInt::Index2InfoTypeMap globalIndexOfClientSrc; 
     34  globalIndexOfClientSrc.rehash(std::ceil(globalLocalIndexGridSrc.size()/globalIndexOfClientSrc.max_load_factor())); 
     35 
    3436  PairIntInt pairIntInt; 
    3537  for (; itIndex != iteIndex; ++itIndex) 
     
    3739    pairIntInt.first  = clientRank; 
    3840    pairIntInt.second = itIndex->second; 
    39     globalIndexOfServer[itIndex->first] = pairIntInt; 
    40   } 
    41  
    42   gridIndexClientClientMapping_ = new CClientClientDHTPairIntInt(globalIndexOfServer, 
     41    globalIndexOfClientSrc[itIndex->first] = pairIntInt; 
     42  } 
     43 
     44  gridIndexClientClientMapping_ = new CClientClientDHTPairIntInt(globalIndexOfClientSrc, 
    4345                                                                 client->intraComm); 
    4446} 
Note: See TracChangeset for help on using the changeset viewer.