Changeset 832


Ignore:
Timestamp:
03/23/16 16:11:13 (5 years ago)
Author:
mhnguyen
Message:

Weight computation of dynamic transformation is done only one for each time stamp

+) Each weight computation of dynamic transformation attached to timestamp
+) Remove some redundant codes

Test
+) On Curie
+) All tests pass

Location:
XIOS/trunk/src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/client_client_dht_decl.cpp

    r829 r832  
    33   \author Ha NGUYEN 
    44   \since 05 Oct 2015 
    5    \date 05 Oct 2015 
     5   \date 23 Mars 2016 
    66 
    77   \brief Distributed hashed table implementation. 
  • XIOS/trunk/src/client_client_dht_template_impl.hpp

    r830 r832  
    33   \author Ha NGUYEN 
    44   \since 05 Oct 2015 
    5    \date 05 Oct 2015 
     5   \date 23 Mars 2016 
    66 
    77   \brief Distributed hashed table implementation. 
  • XIOS/trunk/src/client_server_mapping.cpp

    r829 r832  
    1919{ 
    2020} 
    21  
    22 ///*! 
    23 //  Compute mapping global index of server which client sends to. 
    24 //  \param [in] globalIndexOnClient global index on client 
    25 //  \param [in] globalIndexServer global index of servers 
    26 //*/ 
    27 //void CClientServerMapping::computeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
    28 //                                                     const std::vector<CArray<size_t,1>* >& globalIndexServer) 
    29 //{ 
    30 //  defaultComputeServerIndexMapping(globalIndexOnClient, globalIndexServer); 
    31 //} 
    32  
    33 ///*! 
    34 //   Compute index of data which are sent to server and index global on server side 
    35 //   \param [in] globalIndexOnClient global index of data on client 
    36 //   \param [in] globalIndexServer global index of server(s) 
    37 //   \param [in] localIndexOnClient local index of data on client which are sent to server 
    38 //*/ 
    39 //void CClientServerMapping::defaultComputeServerIndexMapping(const CArray<size_t,1>& globalIndexOnClient, 
    40 //                                                            const std::vector<CArray<size_t,1>* >& globalIndexServer, 
    41 //                                                            const CArray<int,1>* localIndexOnClient) 
    42 //{ 
    43 //  int nServer = globalIndexServer.size(); 
    44 //  std::vector<CArray<size_t,1>::const_iterator> itBegin(nServer), itEnd(nServer), it(nServer); 
    45 //  for (int i = 0; i < nServer; ++i) 
    46 //  { 
    47 //    itBegin[i] = it[i] = globalIndexServer[i]->begin(); 
    48 //    itEnd[i]   = globalIndexServer[i]->end(); 
    49 //  } 
    50 // 
    51 //  size_t ssize = globalIndexOnClient.numElements(); 
    52 //  for (int i = 0; i < ssize; ++i) 
    53 //  { 
    54 //    for (int j = 0; j < nServer; ++j) 
    55 //    { 
    56 //      // Just temporarily, it's bad. 
    57 //      if (std::binary_search(itBegin[j], itEnd[j], globalIndexOnClient(i))) 
    58 //      { 
    59 //        // Just try to calculate local index server on client side 
    60 //        (indexGlobalOnServer_[j]).push_back((globalIndexOnClient)(i)); 
    61 //        if (0 != localIndexOnClient) (localIndexSend2Server_[j]).push_back((*localIndexOnClient)(i)); 
    62 //        else 
    63 //          (localIndexSend2Server_[j]).push_back(i); 
    64 //        continue; 
    65 //      } 
    66 //    } 
    67 //  } 
    68 //} 
    6921 
    7022/*! 
     
    13486} 
    13587 
    136 ///*! 
    137 //  Return local index of data that is send to server 
    138 //  \return mapping of server rank and local index of sending data on the client 
    139 //*/ 
    140 //const CClientServerMapping::LocalIndexMap& CClientServerMapping::getLocalIndexSendToServer() const 
    141 //{ 
    142 //  return localIndexSend2Server_; 
    143 //} 
    144  
    14588/*! 
    14689  Return global index of data on each connected server. 
  • XIOS/trunk/src/filter/spatial_transform_filter.cpp

    r827 r832  
    8787        std::vector<CArray<double,1>* > dataAuxInputs(data.size()-1); 
    8888        for (size_t idx = 0; idx < dataAuxInputs.size(); ++idx) dataAuxInputs[idx] = &(data[idx+1]->data); 
    89         gridTransformation->computeAll(dataAuxInputs); 
     89        gridTransformation->computeAll(dataAuxInputs, packet->timestamp); 
    9090      } 
    9191      packet->data.resize(gridTransformation->getGridDestination()->storeIndex_client.numElements()); 
  • XIOS/trunk/src/transformation/grid_transformation.cpp

    r831 r832  
    2525: gridSource_(source), gridDestination_(destination), originalGridSource_(source), 
    2626  algoTypes_(), nbAlgos_(0), currentGridIndexToOriginalGridIndex_(), tempGrids_(), 
    27   auxInputs_(), dynamicalTransformation_(false) 
     27  auxInputs_(), dynamicalTransformation_(false), timeStamp_() 
    2828 
    2929{ 
     
    356356  -) Make current grid destination become grid source in the next transformation 
    357357*/ 
    358 void CGridTransformation::computeAll(const std::vector<CArray<double,1>* >& dataAuxInputs) 
     358void CGridTransformation::computeAll(const std::vector<CArray<double,1>* >& dataAuxInputs, Time timeStamp) 
    359359{ 
    360360  if (nbAlgos_ < 1) return; 
    361361  if (!auxInputs_.empty() && !dynamicalTransformation_) { dynamicalTransformation_ = true; return; } 
    362   if (dynamicalTransformation_) DestinationIndexMap().swap(currentGridIndexToOriginalGridIndex_);  // Reset map 
     362  if (dynamicalTransformation_) 
     363  { 
     364    if (timeStamp_.insert(timeStamp).second) 
     365      DestinationIndexMap().swap(currentGridIndexToOriginalGridIndex_);  // Reset map 
     366    else 
     367      return; 
     368  } 
    363369 
    364370  CContext* context = CContext::getCurrent(); 
  • XIOS/trunk/src/transformation/grid_transformation.hpp

    r829 r832  
    1515#include "generic_algorithm_transformation.hpp" 
    1616#include "transformation_enum.hpp" 
     17#include "duration.hpp" 
    1718 
    1819namespace xios { 
     
    4243  ~CGridTransformation(); 
    4344 
    44   void computeAll(const std::vector<CArray<double,1>* >& dataAuxInput=std::vector<CArray<double,1>* >()); 
     45  void computeAll(const std::vector<CArray<double,1>* >& dataAuxInput=std::vector<CArray<double,1>* >(), Time timeStamp = 0); 
    4546 
    4647  const std::map<int, CArray<int,1> >& getLocalIndexToSendFromGridSource() const; 
     
    109110  std::vector<StdString> auxInputs_; 
    110111  bool dynamicalTransformation_; 
     112 
     113  std::set<Time> timeStamp_; //! Time stamps for auxillary inputs 
    111114}; 
    112115 
Note: See TracChangeset for help on using the changeset viewer.