Changeset 890


Ignore:
Timestamp:
07/05/16 15:59:18 (5 years ago)
Author:
mhnguyen
Message:

Removing some redundant codes and make some minor improvements

+) Make a check to not do grid generation twice

Test
+) On Curie
+) On test compilation

Location:
XIOS/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/inputs/Version2/iodef.xml

    r886 r890  
    1515     <field id="field_Domain_transformed_Interpolated"  operation="average" freq_op="3600s" field_ref="field_A" grid_ref="grid_Domain_tranformed_Interpolated" /> 
    1616     <field id="field_Scalar" operation="average" freq_op="3600s" grid_ref="ScalarGrid" /> 
     17     <field id="field_ReduceScalar" operation="average" field_ref="field_A" freq_op="3600s" grid_ref="ScalarReduceGrid" /> 
    1718     <field id="field_Value"  operation="average" freq_op="3600s" grid_ref="grid_A" /> 
    1819   </field_definition> 
     
    4344        <field field_ref="field_Scalar" /> 
    4445     </file> 
     46     <file id="output_ReduceScalar" name="output_ReduceScalar" type="one_file"> 
     47        <field field_ref="field_ReduceScalar" /> 
     48     </file> 
    4549   </file_definition> 
    4650 
     
    6165   </axis_definition> 
    6266 
     67   <scalar_definition> 
     68     <scalar id="scalar" value="10.0"> 
     69       <reduce_axis operation="max"/> 
     70     </scalar> 
     71   </scalar_definition> 
     72 
    6373   <domain_definition> 
    6474     <domain id="domain_A" /> 
     
    7282       <grid id="grid_A"> 
    7383         <domain domain_ref="domain_A" /> 
    74          <axis axis_ref="axis_C" /> 
     84         <axis axis_ref="axis_C" positive="up"/> 
    7585       </grid> 
    7686       <grid id="grid_Axis"> 
     
    97107         <axis axis_ref="axis_E" /> 
    98108       </grid> 
     109       <grid id="ScalarReduceGrid"> 
     110        <domain domain_ref="domain_A" /> 
     111        <scalar scalar_ref="scalar"/> 
     112       </grid> 
    99113       <grid id="ScalarGrid"> 
     114        <scalar scalar_ref="scalar"/> 
    100115       </grid> 
    101116     </grid_group> 
  • XIOS/trunk/src/distribution_client.cpp

    r888 r890  
    188188      nZoomEnd_.at((indexMap_[idx]+1))   = domList[domIndex]->global_zoom_jbegin + domList[domIndex]->global_zoom_nj-1; 
    189189 
    190       dataBegin_.at(indexMap_[idx]+1) = domList[domIndex]->data_jbegin.getValue(); //(2 == domList[domIndex]->data_dim) ? domList[domIndex]->data_jbegin.getValue() : -1; 
    191 //      dataIndex_.at(indexMap_[idx]+1) = &(domList[domIndex]->data_j_index); 
    192 //      infoIndex_.at(indexMap_[idx]+1) = &(domList[domIndex]->j_index); 
     190      dataBegin_.at(indexMap_[idx]+1) = domList[domIndex]->data_jbegin.getValue(); 
    193191      dataIndex_.at(indexMap_[idx]+1).reference(domList[domIndex]->data_j_index); 
    194192      infoIndex_.at(indexMap_[idx]+1).reference(domList[domIndex]->j_index); 
     
    203201 
    204202      dataBegin_.at(indexMap_[idx]) = domList[domIndex]->data_ibegin.getValue(); 
    205 //      dataIndex_.at(indexMap_[idx]) = &(domList[domIndex]->data_i_index); 
    206 //      infoIndex_.at(indexMap_[idx]) = &(domList[domIndex]->i_index); 
    207203      dataIndex_.at(indexMap_[idx]).reference(domList[domIndex]->data_i_index); 
    208204      infoIndex_.at(indexMap_[idx]).reference(domList[domIndex]->i_index); 
     
    227223 
    228224      dataBegin_.at(indexMap_[idx]) = axisList[axisIndex]->data_begin.getValue(); 
    229 //      dataIndex_.at(indexMap_[idx]) = &(axisList[axisIndex]->data_index); 
    230 //      infoIndex_.at(indexMap_[idx]) = &(axisList[axisIndex]->index); 
    231225      dataIndex_.at(indexMap_[idx]).reference(axisList[axisIndex]->data_index); 
    232226      infoIndex_.at(indexMap_[idx]).reference(axisList[axisIndex]->index); 
  • XIOS/trunk/src/node/grid.cpp

    r887 r890  
    3434      , transformations_(0), isTransformed_(false) 
    3535      , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 
    36       , gridSrc_(), hasTransform_(false), order_(), globalIndexOnServer_() 
     36      , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 
    3737   { 
    3838     setVirtualDomainGroup(); 
     
    5252      , transformations_(0), isTransformed_(false) 
    5353      , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 
    54       , gridSrc_(), hasTransform_(false), order_(), globalIndexOnServer_() 
     54      , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 
    5555   { 
    5656     setVirtualDomainGroup(); 
     
    707707   } 
    708708 
    709 //   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    710 //                            const CArray<int,1>& axisDomainOrder) 
    711 //   { 
    712 //      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size())) 
    713 //        ERROR("CGrid* CGrid::createGrid(...)", 
    714 //              << "The size of axisDomainOrder (" << axisDomainOrder.numElements() 
    715 //              << ") is not coherent with the number of elements (" << domains.size() + axis.size() <<")."); 
    716 // 
    717 //      CGrid* grid = CGridGroup::get("grid_definition")->createChild(id); 
    718 //      grid->setDomainList(domains); 
    719 //      grid->setAxisList(axis); 
    720 // 
    721 //      // By default, domains are always the first elements of a grid 
    722 //      if (0 == axisDomainOrder.numElements()) 
    723 //      { 
    724 //        int size = domains.size() + axis.size(); 
    725 //        grid->axis_domain_order.resize(size); 
    726 //        for (int i = 0; i < size; ++i) 
    727 //        { 
    728 //          if (i < domains.size()) grid->axis_domain_order(i) = 2; 
    729 //          else grid->axis_domain_order(i) = 1; 
    730 //        } 
    731 //      } 
    732 //      else 
    733 //      { 
    734 //        grid->axis_domain_order.resize(axisDomainOrder.numElements()); 
    735 //        grid->axis_domain_order = axisDomainOrder; 
    736 //      } 
    737 // 
    738 //      grid->solveDomainAxisRefInheritance(true); 
    739 // 
    740 //      return grid; 
    741 //   } 
    742  
    743709   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    744710                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     
    10401006    list<CMessage> listMsg; 
    10411007    list<CArray<size_t,1> > listOutIndex; 
    1042 //    const CClientServerMapping::GlobalIndexMap& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
    1043 //    const CClientServerMapping::GlobalIndexMap& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
    10441008    const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer(); 
    10451009    CDistributionClient::GlobalLocalDataMap::const_iterator itIndex = globalLocalIndexSendToServer.begin(), 
     
    17351699    } 
    17361700 
     1701    if (isGenerated()) return; 
     1702    setGenerated(); 
     1703 
    17371704    CGridGenerate gridGenerate(this, transformGridSrc); 
    17381705    gridGenerate.completeGrid(); 
     1706  } 
     1707 
     1708  bool CGrid::isGenerated() 
     1709  { 
     1710    return isGenerated_; 
     1711  } 
     1712 
     1713  void CGrid::setGenerated() 
     1714  { 
     1715    isGenerated_ = true; 
    17391716  } 
    17401717 
  • XIOS/trunk/src/node/grid.hpp

    r887 r890  
    120120         static CGrid* createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    121121                                  const CArray<int,1>& axisDomainOrder = CArray<int,1>()); 
    122 //         static CGrid* createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    123 //                                  const CArray<int,1>& axisDomainOrder = CArray<int,1>()); 
    124122         static CGrid* createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    125123                                  const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder = CArray<int,1>()); 
    126124         static CGrid* createGrid(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    127125                                  const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder); 
    128 //         static StdString generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    129 //                                     const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder = CArray<int,1>()); 
    130126         static StdString generateId(const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    131127                                     const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder = CArray<int,1>()); 
     
    206202         bool isTransformed(); 
    207203         void setTransformed(); 
     204         bool isGenerated(); 
     205         void setGenerated(); 
    208206         void addTransGridSource(CGrid* gridSrc); 
    209207         std::map<CGrid*, std::pair<bool,StdString> >& getTransGridSource(); 
     
    283281 
    284282        bool isTransformed_; 
     283        bool isGenerated_; 
    285284        std::vector<int> axisPositionInGrid_; 
    286285        CGridTransformation* transformations_; 
  • XIOS/trunk/src/transformation/scalar_algorithm_reduce_axis.cpp

    r888 r890  
    88 */ 
    99#include "scalar_algorithm_reduce_axis.hpp" 
    10 //#include "context.hpp" 
    11 //#include "context_client.hpp" 
    12 //#include "client_client_dht_template.hpp" 
    1310#include "axis.hpp" 
    1411#include "scalar.hpp" 
Note: See TracChangeset for help on using the changeset viewer.