Ignore:
Timestamp:
10/06/15 17:17:10 (6 years ago)
Author:
mhnguyen
Message:

First implementation of hierarchical distributed hashed table

+) Implement dht for int with index of type size_t

Test
+) Local
+) Work correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/grid.cpp

    r718 r720  
    1818#include "grid_transformation.hpp" 
    1919#include "grid_generate.hpp" 
     20#include "client_client_dht.hpp" 
    2021 
    2122namespace xios { 
     
    158159   /*! 
    159160    * Test whether the data defined on the grid can be outputted in a compressed way. 
    160     *  
     161    * 
    161162    * \return true if and only if a mask was defined for this grid 
    162163    */ 
     
    395396                                                            clientDistribution_->isDataDistributed()); 
    396397 
     398     CClientClientDHT clientDht(serverDistributionDescription.getGlobalIndexRange(), 
     399                                client->intraComm, 
     400                                clientDistribution_->isDataDistributed()); 
     401     clientDht.computeServerIndexMapping(clientDistribution_->getGlobalIndex()); 
     402     const std::map<int, std::vector<size_t> >& globalIndexOnServer0 = clientDht.getGlobalIndexOnServer(); 
     403 
     404     std::map<int, std::vector<size_t> >::const_iterator itbTmp, itTmp, iteTmp; 
     405     itbTmp = globalIndexOnServer0.begin(); iteTmp = globalIndexOnServer0.end(); 
     406     for (itTmp = itbTmp; itTmp != iteTmp; ++itTmp) 
     407     { 
     408       const std::vector<size_t>& tmpVec = itTmp->second; info << "tmpVec0. Rank " << itTmp->first << ". Size = " << tmpVec.size() << ". "  ; 
     409       for (int i = 0; i < tmpVec.size(); ++i) info << tmpVec[i] << " "; 
     410       info << std::endl; 
     411     } 
     412// 
    397413     clientServerMap_->computeServerIndexMapping(clientDistribution_->getGlobalIndex()); 
    398414     const std::map<int, std::vector<size_t> >& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
     415 
     416     itbTmp = globalIndexOnServer.begin(); iteTmp = globalIndexOnServer.end(); 
     417     for (itTmp = itbTmp; itTmp != iteTmp; ++itTmp) 
     418     { 
     419       const std::vector<size_t>& tmpVec = itTmp->second; info << "tmpVec1. Rank " << itTmp->first << ". Size = " << tmpVec.size() << ". "  ; 
     420       for (int i = 0; i < tmpVec.size(); ++i) info << tmpVec[i] << " "; 
     421       info << std::endl; 
     422     } 
     423 
    399424     const std::vector<size_t>& globalIndexSendToServer = clientDistribution_->getGlobalDataIndexSendToServer(); 
    400425     std::map<int, std::vector<size_t> >::const_iterator iteGlobalMap, itbGlobalMap, itGlobalMap; 
Note: See TracChangeset for help on using the changeset viewer.