- Timestamp:
- 06/09/16 11:33:12 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/domain_algorithm_transformation.cpp
r862 r866 11 11 #include "context.hpp" 12 12 #include "context_client.hpp" 13 #include " client_client_dht_template.hpp"13 #include "domain.hpp" 14 14 15 15 namespace xios { … … 29 29 30 30 void CDomainAlgorithmTransformation::computeExchangeGlobalIndex(const CArray<size_t,1>& globalDomainIndex, 31 boost::unordered_map<int,std::vector<size_t> >& globalDomainIndexOnProc)31 CClientClientDHTInt::Index2VectorInfoTypeMap& globalDomainIndexOnProc) 32 32 { 33 33 CContext* context = CContext::getCurrent(); … … 53 53 CClientClientDHTInt dhtIndexProcRank(globalIndex2ProcRank, client->intraComm); 54 54 dhtIndexProcRank.computeIndexInfoMapping(globalDomainIndex); 55 56 std::vector<int> countIndex(clientSize,0); 57 const CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 58 CClientClientDHTInt::Index2VectorInfoTypeMap::const_iterator itb = computedGlobalIndexOnProc.begin(), it, 59 ite = computedGlobalIndexOnProc.end(); 60 for (it = itb; it != ite; ++it) 61 { 62 const std::vector<int>& procList = it->second; 63 for (int idx = 0; idx < procList.size(); ++idx) ++countIndex[procList[idx]]; 64 } 65 66 globalDomainIndexOnProc.rehash(std::ceil(clientSize/globalDomainIndexOnProc.max_load_factor())); 67 for (int idx = 0; idx < clientSize; ++idx) 68 { 69 if (0 != countIndex[idx]) 70 { 71 globalDomainIndexOnProc[idx].resize(countIndex[idx]); 72 countIndex[idx] = 0; 73 } 74 } 75 76 for (it = itb; it != ite; ++it) 77 { 78 const std::vector<int>& procList = it->second; 79 for (int idx = 0; idx < procList.size(); ++idx) 80 { 81 globalDomainIndexOnProc[procList[idx]][countIndex[procList[idx]]] = it->first; 82 ++countIndex[procList[idx]]; 83 } 84 } 55 globalDomainIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 56 57 58 // std::vector<int> countIndex(clientSize,0); 59 // const CClientClientDHTInt::Index2VectorInfoTypeMap& computedGlobalIndexOnProc = dhtIndexProcRank.getInfoIndexMap(); 60 // CClientClientDHTInt::Index2VectorInfoTypeMap::const_iterator itb = computedGlobalIndexOnProc.begin(), it, 61 // ite = computedGlobalIndexOnProc.end(); 62 // for (it = itb; it != ite; ++it) 63 // { 64 // const std::vector<int>& procList = it->second; 65 // for (int idx = 0; idx < procList.size(); ++idx) ++countIndex[procList[idx]]; 66 // } 67 // 68 // globalDomainIndexOnProc.rehash(std::ceil(clientSize/globalDomainIndexOnProc.max_load_factor())); 69 // for (int idx = 0; idx < clientSize; ++idx) 70 // { 71 // if (0 != countIndex[idx]) 72 // { 73 // globalDomainIndexOnProc[idx].resize(countIndex[idx]); 74 // countIndex[idx] = 0; 75 // } 76 // } 77 // 78 // for (it = itb; it != ite; ++it) 79 // { 80 // const std::vector<int>& procList = it->second; 81 // for (int idx = 0; idx < procList.size(); ++idx) 82 // { 83 // globalDomainIndexOnProc[procList[idx]][countIndex[procList[idx]]] = it->first; 84 // ++countIndex[procList[idx]]; 85 // } 86 // } 85 87 } 86 88
Note: See TracChangeset
for help on using the changeset viewer.