Changeset 1653


Ignore:
Timestamp:
03/06/19 12:11:10 (3 years ago)
Author:
oabramkina
Message:

Developments for visualization of XIOS workflow.

Branch is spawned from trunk r1649.

Boost library is used for producing Graphviz DOT files. Current results: a DOT file representing a static workflow. For a complete proof of concept, DOT files for each timestamp should be generated. The necessary information has been collected by XIOS, it only requires rearranging the information for graphing (changes in classes CWorkflowGraph and CGraphviz).

Location:
XIOS/dev/dev_olga/src
Files:
4 added
36 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_olga/src/config/field_attribute.conf

    r1524 r1653  
    1919DECLARE_ATTRIBUTE(bool,      indexed_output) 
    2020DECLARE_ATTRIBUTE(bool,      check_if_active) 
     21DECLARE_ATTRIBUTE(bool,      build_workflow_graph) 
    2122 
    2223DECLARE_ATTRIBUTE(StdString, domain_ref, false) 
  • XIOS/dev/dev_olga/src/cxios.cpp

    r1612 r1653  
    1111#include "memtrack.hpp" 
    1212#include "registry.hpp" 
     13#include "graphviz.hpp" 
    1314 
    1415namespace xios 
     
    135136       globalRegistry->toFile("xios_registry.bin") ; 
    136137       delete globalRegistry ; 
     138        
     139       CGraphviz::buildStaticWorkflowGraph(); 
    137140     } 
    138141 
  • XIOS/dev/dev_olga/src/filter/file_server_writer_filter.cpp

    r1358 r1653  
    1212      ERROR("CFileServerWriterFilter::CFileServerWriterFilter(CField* field)", 
    1313            "The field cannot be null."); 
     14    filterId = InvalidableObject::count; 
     15    InvalidableObject::count++; 
    1416  } 
    1517 
     
    2830    return true; 
    2931  } 
     32 
     33  int CFileServerWriterFilter::getFilterId(void) 
     34  { 
     35    return filterId; 
     36  } 
     37 
    3038} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/file_server_writer_filter.hpp

    r1358 r1653  
    3737      bool virtual isDataExpected(const CDate& date) const; 
    3838 
     39      /*! 
     40       * Returns filter's id needed in case of building workflow graph 
     41       */ 
     42      int getFilterId(); 
     43 
    3944    protected: 
    4045      /*! 
     
    4651 
    4752    private: 
    48       CField* field; //<! The associated field 
     53      CField* field;           //<! The associated field 
    4954      std::map<Time, CDataPacketPtr> packets; //<! The stored packets 
     55      int filterId;            //<! Filter's id needed in case of building a workflow 
     56 
    5057  }; // class CFileServerWriterFilter 
    5158} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/file_writer_filter.cpp

    r1594 r1653  
    33#include "field.hpp" 
    44#include "utils.hpp" 
     5#include "workflow_graph.hpp" 
    56 
    67namespace xios 
     
    1314      ERROR("CFileWriterFilter::CFileWriterFilter(CField* field)", 
    1415            "The field cannot be null."); 
     16    filterId = InvalidableObject::count; 
     17    InvalidableObject::count++; 
    1518  } 
    1619 
     
    4649    return true; 
    4750  } 
     51 
     52  int CFileWriterFilter::getFilterId(void) 
     53  { 
     54    return filterId; 
     55  } 
     56 
    4857} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/file_writer_filter.hpp

    r1358 r1653  
    2323      CFileWriterFilter(CGarbageCollector& gc, CField* field); 
    2424 
     25      inline StdString GetName(void) {return StdString("File writer filter");}; 
     26 
    2527      /*! 
    2628       * Tests if the filter must auto-trigger. 
     
    3739      bool virtual isDataExpected(const CDate& date) const; 
    3840 
     41      /*! 
     42       * Returns filter's id needed in case of building workflow graph 
     43       */ 
     44      int getFilterId(); 
     45 
    3946    protected: 
    4047      /*! 
     
    4653 
    4754    private: 
    48       CField* field; //<! The associated field 
     55      CField* field;                          //<! The associated field 
    4956      std::map<Time, CDataPacketPtr> packets; //<! The stored packets 
     57      int filterId;                           //<! Filter's id needed in case of building a workflow 
     58 
    5059  }; // class CFileWriterFilter 
    5160} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/filter.cpp

    r1358 r1653  
    33namespace xios 
    44{ 
    5   CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine) 
     5  CFilter::CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine, bool buildWorkflowGraph /*= false*/) 
    66    : CInputPin(gc, inputSlotsCount) 
    7     , COutputPin(gc) 
     7    , COutputPin(gc, false, buildWorkflowGraph) 
    88    , engine(engine) 
    99    , inputSlotCount(inputSlotCount) 
    1010  { /* Nothing to do */ } 
     11 
     12  StdString CFilter::GetName(void)    { return StdString("Filter"); } 
    1113 
    1214  void CFilter::onInputReady(std::vector<CDataPacketPtr> data) 
  • XIOS/dev/dev_olga/src/filter/filter.hpp

    r1358 r1653  
    2323       * \param inputSlotsCount the number of input slots 
    2424       * \param engine the filter engine 
     25       * \param buildWorkflowGraph indicates whether data will be visualized 
    2526       */ 
    26       CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine); 
     27      CFilter(CGarbageCollector& gc, size_t inputSlotsCount, IFilterEngine* engine, bool buildWorkflowGraph = false); 
     28 
     29      StdString virtual GetName(void); 
    2730 
    2831      /*! 
  • XIOS/dev/dev_olga/src/filter/garbage_collector.cpp

    r1021 r1653  
    33namespace xios 
    44{ 
     5 
     6  int InvalidableObject::count = 0; 
     7   
    58  void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp) 
    69  { 
  • XIOS/dev/dev_olga/src/filter/garbage_collector.hpp

    r1021 r1653  
    2020     */ 
    2121    void virtual invalidate(Time timestamp) = 0; 
     22   
     23    static int count; //!< Counter used to identify a filter in case building workflow graph 
     24     
    2225  }; // struct InvalidableObject 
    2326 
  • XIOS/dev/dev_olga/src/filter/input_pin.cpp

    r1021 r1653  
    33#include "garbage_collector.hpp" 
    44#include "exception.hpp" 
     5#include "workflow_graph.hpp" 
    56 
    67namespace xios 
     
    1112    , triggers(slotsCount) 
    1213    , hasTriggers(false) 
    13   { /* Nothing to do */ } 
     14  {   } 
     15 
     16  StdString CInputPin::GetName(void) 
     17  { 
     18    return StdString("Input pin"); 
     19  } 
    1420 
    1521  void CInputPin::setInput(size_t inputSlot, CDataPacketPtr packet) 
     
    7783    inputs.erase(inputs.begin(), inputs.lower_bound(timestamp)); 
    7884  } 
     85 
     86  int CInputPin::getFilterId(void) 
     87  { 
     88    return -1; 
     89  } 
     90 
    7991} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/input_pin.hpp

    r1358 r1653  
    2626       */ 
    2727      CInputPin(CGarbageCollector& gc, size_t slotsCount); 
     28       
     29      StdString virtual GetName(void); 
    2830 
    2931      /*! 
     
    7981       */ 
    8082      void virtual invalidate(Time timestamp); 
     83       
     84      /*! 
     85       * Returns filter's id needed in case of building workflow graph 
     86       * This function should never be called from this class, instead functions defined in derived classes or in class COutputPin should be used 
     87       */ 
     88      int virtual getFilterId(); 
    8189 
    8290    protected: 
  • XIOS/dev/dev_olga/src/filter/output_pin.cpp

    r1542 r1653  
    11#include "output_pin.hpp" 
    22#include "exception.hpp" 
     3#include "workflow_graph.hpp" 
    34 
    45namespace xios 
    56{ 
    6   COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/) 
     7  COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/, bool buildWorkflowGraph /* =false */) 
    78    : gc(gc) 
    89    , manualTrigger(manualTrigger) 
    9   { /* Nothing to do */ } 
     10    , buildWorkflowGraph(buildWorkflowGraph) 
     11  { 
     12    filterId = InvalidableObject::count; 
     13    InvalidableObject::count++; 
     14  } 
     15 
     16  StdString COutputPin::GetName(void) 
     17  { 
     18    return StdString("Output pin"); 
     19  } 
    1020 
    1121  void COutputPin::connectOutput(std::shared_ptr<CInputPin> inputPin, size_t inputSlot) 
     
    2636      ERROR("void COutputPin::onOutputReady(CDataPacketPtr packet)", 
    2737            "The packet cannot be null."); 
     38 
     39    if (buildWorkflowGraph) 
     40    { 
     41        CWorkflowGraph::mapFilterTimestamps[this->getFilterId()].push_back(packet->timestamp); 
     42        CWorkflowGraph::timestamps.insert(packet->timestamp); 
     43    } 
    2844 
    2945    if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden 
     
    101117    outputPackets.erase(outputPackets.begin(), outputPackets.lower_bound(timestamp)); 
    102118  } 
     119 
     120  int COutputPin::getFilterId(void) 
     121  { 
     122    return filterId; 
     123  } 
     124 
    103125} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/output_pin.hpp

    r1542 r1653  
    1919       * \param gc the garbage collector associated with this ouput pin 
    2020       * \param slotsCount the number of slots 
     21       * \param buildWorkflowGraph indicates whether data will be visualized 
    2122       */ 
    22       COutputPin(CGarbageCollector& gc, bool manualTrigger = false); 
     23      COutputPin(CGarbageCollector& gc, bool manualTrigger = false, bool buildWorkflowGraph = false); 
    2324 
     25      StdString virtual GetName(void); 
     26       
    2427      /*! 
    2528       * Connects to a specific slot of the input pin of a downstream filter. 
     
    6669      void virtual invalidate(Time timestamp); 
    6770 
     71      /*! 
     72       * Returns filter's id needed in case of building workflow graph 
     73       */ 
     74      int getFilterId(); 
     75 
    6876    protected: 
    6977      /*! 
     
    97105      //! Output buffer, store the packets until the output is triggered 
    98106      std::map<Time, CDataPacketPtr> outputPackets; 
     107 
     108      //! Indicates whether the workflow will be visualized 
     109      bool buildWorkflowGraph; 
     110 
     111      //! Filter's id needed in case of building a workflow graph 
     112      int filterId; 
     113 
     114 
    99115  }; // class COutputPin 
    100116} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/pass_through_filter.cpp

    r641 r1653  
    33namespace xios 
    44{ 
    5   CPassThroughFilter::CPassThroughFilter(CGarbageCollector& gc) 
    6     : CFilter(gc, 1, this) 
     5  CPassThroughFilter::CPassThroughFilter(CGarbageCollector& gc, bool buildWorkflowGraph /*= false*/) 
     6    : CFilter(gc, 1, this, buildWorkflowGraph) 
    77  { /* Nothing to do */ } 
    88 
  • XIOS/dev/dev_olga/src/filter/pass_through_filter.hpp

    r641 r1653  
    1717       * 
    1818       * \param gc the associated garbage collector 
     19       * \param buildWorkflowGraph indicates whether data will be visualized 
    1920       */ 
    20       CPassThroughFilter(CGarbageCollector& gc); 
     21      CPassThroughFilter(CGarbageCollector& gc, bool buildWorkflowGraph = false); 
     22 
     23      inline StdString GetName(void) {return StdString("Pass through filter");}; 
    2124 
    2225    protected: 
  • XIOS/dev/dev_olga/src/filter/source_filter.cpp

    r1568 r1653  
    44#include "calendar_util.hpp" 
    55#include <limits>  
     6#include "workflow_graph.hpp" 
    67 
    78namespace xios 
     
    1112                               const CDuration offset /*= NoneDu*/, bool manualTrigger /*= false*/, 
    1213                               bool hasMissingValue /*= false*/, 
    13                                double defaultValue /*= 0.0*/) 
    14     : COutputPin(gc, manualTrigger) 
     14                               double defaultValue /*= 0.0*/, 
     15                               bool buildWorkflowGraph /*= false*/) 
     16    : COutputPin(gc, manualTrigger, buildWorkflowGraph) 
    1517    , grid(grid) 
    1618    , compression(compression) 
  • XIOS/dev/dev_olga/src/filter/source_filter.hpp

    r1568 r1653  
    2727       * \param hasMissingValue whether data has missing value 
    2828       * \param defaultValue missing value to detect 
     29       * \param[in] buildWorkflowGraph indicates whether the workflow will be visualized 
    2930       */ 
    3031      CSourceFilter(CGarbageCollector& gc, CGrid* grid, 
     
    3334                    const CDuration offset = NoneDu, bool manualTrigger = false, 
    3435                    bool hasMissingValue = false, 
    35                     double defaultValue = 0.0); 
     36                    double defaultValue = 0.0, 
     37                                        bool buildWorkflowGraph = false); 
     38 
     39      inline StdString GetName(void) {return StdString("Source filter");}; 
    3640 
    3741      /*! 
  • XIOS/dev/dev_olga/src/filter/spatial_transform_filter.cpp

    r1589 r1653  
    44#include "context_client.hpp" 
    55#include "timer.hpp" 
     6#include "workflow_graph.hpp" 
    67 
    78namespace xios 
    89{ 
    9   CSpatialTransformFilter::CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, double outputValue, size_t inputSlotsCount) 
    10     : CFilter(gc, inputSlotsCount, engine), outputDefaultValue(outputValue) 
     10  CSpatialTransformFilter::CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, 
     11                                                   double outputValue, size_t inputSlotsCount, bool buildWorkflowGraph /*= false*/) 
     12    : CFilter(gc, inputSlotsCount, engine, buildWorkflowGraph), outputDefaultValue(outputValue) 
    1113  { /* Nothing to do */ } 
    1214 
    1315  std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> > 
    14   CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue) 
     16  CSpatialTransformFilter::buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double missingValue, 
     17                                            bool buildWorkflowGraph) 
    1518  { 
    1619    if (!srcGrid || !destGrid) 
     
    2932      double defaultValue  = (hasMissingValue) ? std::numeric_limits<double>::quiet_NaN() : 0.0; 
    3033 
    31  
    3234      const CGridTransformationSelector::ListAlgoType& algoList = gridTransformation->getAlgoList() ; 
    3335      CGridTransformationSelector::ListAlgoType::const_iterator it  ; 
     
    3739 
    3840      std::shared_ptr<CSpatialTransformFilter> filter ; 
    39       if( isSpatialTemporal) filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount)); 
    40       else filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount)); 
    41  
    42        
     41      if( isSpatialTemporal) 
     42        filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTemporalFilter(gc, engine, gridTransformation, defaultValue, inputCount, buildWorkflowGraph)); 
     43      else 
     44        filter = std::shared_ptr<CSpatialTransformFilter>(new CSpatialTransformFilter(gc, engine, defaultValue, inputCount, buildWorkflowGraph)); 
     45 
    4346      if (!lastFilter) 
    4447        lastFilter = filter; 
    4548      else 
     49      { 
    4650        filter->connectOutput(firstFilter, 0); 
     51        if (buildWorkflowGraph) 
     52        { 
     53          int filterOut = (std::static_pointer_cast<COutputPin>(filter))->getFilterId(); 
     54          int filterIn = (std::static_pointer_cast<COutputPin>(firstFilter))->getFilterId(); 
     55          // PASS field's id here 
     56          CWorkflowGraph::mapFieldToFilters["XXX"].push_back(filterOut); 
     57          CWorkflowGraph::mapFieldToFilters["XXX"].push_back(filterIn); 
     58          CWorkflowGraph::mapFilters[filterOut] = "Spatial transform filter"; 
     59          CWorkflowGraph::mapFilters[filterIn] = "Spatial transform filter"; 
     60        } 
     61      } 
    4762 
    4863      firstFilter = filter; 
     
    6984  } 
    7085 
    71   CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount) 
    72     : CSpatialTransformFilter(gc, engine, outputValue, inputSlotsCount), record(0) 
     86  CSpatialTemporalFilter::CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, 
     87                                                  CGridTransformation* gridTransformation, double outputValue, 
     88                                                  size_t inputSlotsCount, bool buildWorkflowGraph) 
     89    : CSpatialTransformFilter(gc, engine, outputValue, inputSlotsCount, buildWorkflowGraph), record(0) 
    7390  { 
    7491      const CGridTransformationSelector::ListAlgoType& algoList = gridTransformation->getAlgoList() ; 
     
    188205     
    189206    CContextClient* client = CContext::getCurrent()->client; 
     207    int rank; 
     208    MPI_Comm_rank (client->intraComm, &rank); 
    190209 
    191210    // Get default value for output data 
     
    217236      int idxSendBuff = 0; 
    218237      std::vector<double*> sendBuff(localIndexToSend.size()); 
     238      double* sendBuffRank; 
    219239      for (itSend = itbSend; itSend != iteSend; ++itSend, ++idxSendBuff) 
    220240      { 
     241        int destRank = itSend->first; 
    221242        if (0 != itSend->second.numElements()) 
    222           sendBuff[idxSendBuff] = new double[itSend->second.numElements()]; 
     243        { 
     244          if (rank != itSend->first) 
     245            sendBuff[idxSendBuff] = new double[itSend->second.numElements()]; 
     246          else 
     247            sendBuffRank = new double[itSend->second.numElements()]; 
     248        } 
    223249      } 
    224250 
     
    230256        const CArray<int,1>& localIndex_p = itSend->second; 
    231257        int countSize = localIndex_p.numElements(); 
    232         for (int idx = 0; idx < countSize; ++idx) 
    233         { 
    234           sendBuff[idxSendBuff][idx] = dataCurrentSrc(localIndex_p(idx)); 
    235         } 
    236         sendRecvRequest.push_back(MPI_Request()); 
    237         MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, client->intraComm, &sendRecvRequest.back()); 
     258        if (destRank != rank) 
     259        { 
     260          for (int idx = 0; idx < countSize; ++idx) 
     261          { 
     262            sendBuff[idxSendBuff][idx] = dataCurrentSrc(localIndex_p(idx)); 
     263          } 
     264          sendRecvRequest.push_back(MPI_Request()); 
     265          MPI_Isend(sendBuff[idxSendBuff], countSize, MPI_DOUBLE, destRank, 12, client->intraComm, &sendRecvRequest.back()); 
     266        } 
     267        else 
     268        { 
     269          for (int idx = 0; idx < countSize; ++idx) 
     270          { 
     271            sendBuffRank[idx] = dataCurrentSrc(localIndex_p(idx)); 
     272          } 
     273        } 
    238274      } 
    239275 
     
    243279                                                                       iteRecv = localIndexToReceive.end(); 
    244280      int recvBuffSize = 0; 
    245       for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) recvBuffSize += itRecv->second.size(); //(recvBuffSize < itRecv->second.size()) 
    246                                                                        //? itRecv->second.size() : recvBuffSize; 
     281      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) 
     282      { 
     283        if (itRecv->first != rank ) 
     284          recvBuffSize += itRecv->second.size(); 
     285      } 
     286      //(recvBuffSize < itRecv->second.size()) ? itRecv->second.size() : recvBuffSize; 
    247287      double* recvBuff; 
     288 
    248289      if (0 != recvBuffSize) recvBuff = new double[recvBuffSize]; 
    249290      int currentBuff = 0; 
     
    251292      { 
    252293        int srcRank = itRecv->first; 
    253         int countSize = itRecv->second.size(); 
    254         sendRecvRequest.push_back(MPI_Request()); 
    255         MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, client->intraComm, &sendRecvRequest.back()); 
    256         currentBuff += countSize; 
     294        if (srcRank != rank) 
     295        { 
     296          int countSize = itRecv->second.size(); 
     297          sendRecvRequest.push_back(MPI_Request()); 
     298          MPI_Irecv(recvBuff + currentBuff, countSize, MPI_DOUBLE, srcRank, 12, client->intraComm, &sendRecvRequest.back()); 
     299          currentBuff += countSize; 
     300        } 
    257301      } 
    258302      std::vector<MPI_Status> status(sendRecvRequest.size()); 
     
    267311      for (itRecv = itbRecv; itRecv != iteRecv; ++itRecv) 
    268312      { 
    269         int countSize = itRecv->second.size(); 
    270313        const std::vector<std::pair<int,double> >& localIndex_p = itRecv->second; 
    271         (*itAlgo)->apply(localIndex_p, 
    272                          recvBuff+currentBuff, 
    273                          dataCurrentDest, 
    274                          localInitFlag, 
    275                          ignoreMissingValue,firstPass); 
    276  
    277         currentBuff += countSize; 
     314        int srcRank = itRecv->first; 
     315        if (srcRank != rank) 
     316        { 
     317          int countSize = itRecv->second.size(); 
     318          (*itAlgo)->apply(localIndex_p, 
     319                           recvBuff+currentBuff, 
     320                           dataCurrentDest, 
     321                           localInitFlag, 
     322                           ignoreMissingValue,firstPass); 
     323          currentBuff += countSize; 
     324        } 
     325        else 
     326        { 
     327          (*itAlgo)->apply(localIndex_p, 
     328                           sendBuffRank, 
     329                           dataCurrentDest, 
     330                           localInitFlag, 
     331                           ignoreMissingValue,firstPass); 
     332        } 
     333 
    278334        firstPass=false ; 
    279335      } 
     
    285341      { 
    286342        if (0 != itSend->second.numElements()) 
    287           delete [] sendBuff[idxSendBuff]; 
     343        { 
     344          if (rank != itSend->first) 
     345            delete [] sendBuff[idxSendBuff]; 
     346          else 
     347            delete [] sendBuffRank; 
     348        } 
    288349      } 
    289350      if (0 != recvBuffSize) delete [] recvBuff; 
  • XIOS/dev/dev_olga/src/filter/spatial_transform_filter.hpp

    r1542 r1653  
    2323       * \param outputValue default value of output pin 
    2424       * \param [in] inputSlotsCount number of input, by default there is only one for field src 
     25       * \param buildWorkflowGraph indicates whether data will be visualized 
    2526       */ 
    26       CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, double outputValue, size_t inputSlotsCount = 1); 
     27      CSpatialTransformFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, 
     28                              double outputValue, size_t inputSlotsCount = 1, bool buildWorkflowGraph = false); 
     29 
     30      inline StdString GetName(void) {return StdString("Spatial transform filter");}; 
    2731 
    2832      /*! 
     
    3438       * \param hasMissingValue whether field source has missing value 
    3539       * \param defaultValue default value 
     40       * \param buildWorkflowGraph indicates whether data will be visualized 
    3641       * \return the first and the last filters of the filter graph 
    3742       */ 
    3843      static std::pair<std::shared_ptr<CSpatialTransformFilter>, std::shared_ptr<CSpatialTransformFilter> > 
    39       buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue); 
     44      buildFilterGraph(CGarbageCollector& gc, CGrid* srcGrid, CGrid* destGrid, bool hasMissingValue, double defaultValue, bool buildWorkflowGraph = false); 
    4045 
    4146    protected: 
     
    6772       * \param outputValue default value of output pin 
    6873       * \param [in] inputSlotsCount number of input, by default there is only one for field src 
     74       * \param buildWorkflowGraph indicates whether data will be visualized 
     75       * 
    6976       */ 
    70       CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, double outputValue, size_t inputSlotsCount = 1); 
     77      CSpatialTemporalFilter(CGarbageCollector& gc, CSpatialTransformFilterEngine* engine, CGridTransformation* gridTransformation, 
     78                            double outputValue, size_t inputSlotsCount = 1, bool buildWorkflowGraph = false); 
    7179 
    7280 
  • XIOS/dev/dev_olga/src/filter/store_filter.cpp

    r1474 r1653  
    2121      ERROR("CStoreFilter::CStoreFilter(CContext* context, CGrid* grid)", 
    2222            "Impossible to construct a store filter without providing a grid."); 
     23    filterId = InvalidableObject::count; 
     24    InvalidableObject::count++; 
    2325  } 
    2426 
     
    126128    packets.erase(packets.begin(), packets.lower_bound(timestamp)); 
    127129  } 
     130 
     131  int CStoreFilter::getFilterId(void) 
     132  { 
     133    return filterId; 
     134  } 
     135 
    128136} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/store_filter.hpp

    r1358 r1653  
    7373      void virtual invalidate(Time timestamp); 
    7474 
     75      /*! 
     76       * Returns filter's id needed in case of building workflow graph 
     77       */ 
     78      int getFilterId(); 
     79 
    7580    protected: 
    7681      /*! 
     
    8287 
    8388    private: 
    84       CGarbageCollector& gc; //!< The garbage collector associated to the filter 
    85       CContext* context; //!< The context to which the data belongs 
    86       CGrid* grid; //!< The grid attached to the data the filter can accept 
    87       const bool detectMissingValues; //!< Whether missing values should be detected 
    88       const double missingValue; //!< The value to use to replace missing values 
     89      CGarbageCollector& gc;            //!< The garbage collector associated to the filter 
     90      CContext* context;                //!< The context to which the data belongs 
     91      CGrid* grid;                      //!< The grid attached to the data the filter can accept 
     92      const bool detectMissingValues;   //!< Whether missing values should be detected 
     93      const double missingValue;        //!< The value to use to replace missing values 
    8994      std::map<Time, CDataPacketPtr> packets; //<! The stored packets 
     95      int filterId;                     //!< Filter's id needed in case of building a workflow 
     96 
    9097  }; // class CStoreFilter 
    9198} // namespace xios 
  • XIOS/dev/dev_olga/src/filter/temporal_filter.cpp

    r1523 r1653  
    99  CTemporalFilter::CTemporalFilter(CGarbageCollector& gc, const std::string& opId, 
    1010                                   const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq, 
    11                                    bool ignoreMissingValue /*= false*/) 
    12     : CFilter(gc, 1, this) 
     11                                   bool ignoreMissingValue /*= false*/, bool buildWorkflowGraph /*= false*/) 
     12    : CFilter(gc, 1, this, buildWorkflowGraph) 
    1313    , functor(createFunctor(opId, ignoreMissingValue, tmpData)) 
    1414    , isOnceOperation(functor->timeType() == func::CFunctor::once) 
     
    2222                        this->samplingOffset.second, this->samplingOffset.timestep) 
    2323    , initDate(initDate) 
    24 //    , nextSamplingDate(initDate + (this->samplingOffset + initDate.getRelCalendar().getTimeStep())) 
    2524    , nextSamplingDate(initDate + offsetMonth + ( offsetAllButMonth + initDate.getRelCalendar().getTimeStep())) 
    2625    , nbOperationDates(1) 
    2726    , nbSamplingDates(0) 
    28 //    , nextOperationDate(initDate + opFreq + this->samplingOffset) 
    2927    , isFirstOperation(true) 
    3028  { 
     
    4341      { 
    4442        usePacket = (data[0]->date >= nextSamplingDate); 
    45 //        outputResult = (data[0]->date + samplingFreq > nextOperationDate); 
    4643        outputResult = (data[0]->date  > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 
    4744        copyLess = (isInstantOperation && usePacket && outputResult); 
     
    8077 
    8178        isFirstOperation = false; 
    82 //        nextOperationDate = initDate + samplingFreq + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth; 
    8379      } 
    8480    } 
     
    9490  bool CTemporalFilter::isDataExpected(const CDate& date) const 
    9591  { 
    96 //    return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date + samplingFreq > nextOperationDate); 
    9792    return isOnceOperation ? isFirstOperation : (date >= nextSamplingDate || date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 
    9893  } 
  • XIOS/dev/dev_olga/src/filter/temporal_filter.hpp

    r1473 r1653  
    2929      CTemporalFilter(CGarbageCollector& gc, const std::string& opId, 
    3030                      const CDate& initDate, const CDuration samplingFreq, const CDuration samplingOffset, const CDuration opFreq, 
    31                       bool ignoreMissingValue = false); 
     31                      bool ignoreMissingValue = false, bool buildWorkflowGraph = false); 
     32 
     33      inline StdString GetName(void) {return StdString("Temporal filter");}; 
    3234 
    3335      /*! 
  • XIOS/dev/dev_olga/src/io/nc4_data_output.cpp

    r1612 r1653  
    426426                     std::vector<StdSize> start(2) ; 
    427427                     std::vector<StdSize> count(2) ; 
    428 // Comment out for a moment because it is not working for a hole 
     428// Comment out: it is not working for a hole 
    429429//                     if (domain->isEmpty()) 
    430430//                     { 
  • XIOS/dev/dev_olga/src/io/onetcdf4_impl.hpp

    r1633 r1653  
    6060    CTimer::get("CONetCDF4::writeData getWriteDataInfos").suspend(); 
    6161  
    62     int dimArrayLen = 0; 
     62    int dimArrayLen; 
    6363    for (int i=0; i<scount.size(); i++) 
    6464      if (scount[i] == stringArrayLen) 
     
    7373    } 
    7474    char *PtrArrayStr ; 
    75     PtrArrayStr=new char[stringArrayLen] ; 
     75    PtrArrayStr=new char[stringArrayLen*data.numElements()] ; 
     76    memset (PtrArrayStr,' ',stringArrayLen*data.numElements()); 
     77    size_t offset=0 ; 
    7678    Array<StdString,1>::const_iterator it, itb=data.begin(), ite=data.end() ; 
    77     int lineNb = 0; 
    78     for(it=itb;it!=ite;it++) 
     79    for(it=itb;it!=ite;++it, offset+=stringArrayLen) 
    7980    { 
    80       it->copy(PtrArrayStr,it->size()) ; 
    81       PtrArrayStr[it->size()]='\0' ; 
    82       sstart[0] = lineNb; 
    83       sstart[dimArrayLen] = 0; 
    84       scount[0] = 1; 
    85       scount[dimArrayLen] = it->size()+1; 
    86       CTimer::get("CONetCDF4::writeData writeData_").resume(); 
    87       this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 
    88       CTimer::get("CONetCDF4::writeData writeData_").suspend(); 
    89       ++lineNb; 
     81      it->copy(PtrArrayStr+offset,it->size()) ; 
     82      PtrArrayStr[offset+it->size()]='\0' ; 
    9083    } 
     84 
     85     CTimer::get("CONetCDF4::writeData writeData_").resume(); 
     86     this->writeData_(grpid, varid, sstart, scount, PtrArrayStr); 
     87     CTimer::get("CONetCDF4::writeData writeData_").suspend(); 
     88 
    9189    delete []  PtrArrayStr; 
    9290  } 
  • XIOS/dev/dev_olga/src/node/axis.hpp

    r1589 r1653  
    183183   }; // class CAxis 
    184184 
     185   ///-------------------------------------------------------------- 
     186 
    185187   // Declare/Define CAxisGroup and CAxisDefinition 
    186188   DECLARE_GROUP(CAxis); 
  • XIOS/dev/dev_olga/src/node/field.cpp

    r1612 r1653  
    2424#include "spatial_transform_filter.hpp" 
    2525#include "file_server_writer_filter.hpp" 
     26#include "workflow_graph.hpp" 
    2627 
    2728namespace xios{ 
     
    11091110   TRY 
    11101111   {      
    1111     if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 
    1112     if (!isGridChecked) checkGridOfEnabledFields(); 
     1112     if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 
     1113     if (!isGridChecked) checkGridOfEnabledFields(); 
    11131114 
    11141115     const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
     1116     const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 
    11151117     const double defaultValue  = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 
    11161118 
     
    11221124     { 
    11231125        if (!instantDataFilter) 
     1126        { 
    11241127          instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false)); 
    1125  
     1128        } 
    11261129 
    11271130       // If the field data is to be read by the client or/and written to a file 
     
    11381141     { 
    11391142       if (!instantDataFilter) 
     1143       { 
    11401144         instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, false)); 
    1141  
     1145       } 
    11421146             // If the field data is to be read by the client or/and written to a file 
    11431147       if (enableOutput && !storeFilter && !fileWriterFilter) 
     
    11641168           if (!field_ref.isEmpty()) 
    11651169           { 
    1166              CGrid* gridRef = CField::get(field_ref)->grid; 
     1170             CField* fieldRef = CField::get(field_ref); 
     1171             fieldRef->build_workflow_graph.setValue(buildWorkflowGraph); 
     1172             CGrid* gridRef = fieldRef->grid; 
    11671173 
    11681174             if (grid && grid != gridRef && grid->hasTransform()) 
    11691175             { 
    1170                  std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, detectMissingValues, defaultValue);  
     1176               std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid, 
     1177                                                                                         detectMissingValues, defaultValue, buildWorkflowGraph); 
    11711178 
    11721179               filter->connectOutput(filters.first, 0); 
     1180 
     1181               if (buildWorkflowGraph) 
     1182               { 
     1183                 int filterOut = filter->getFilterId(); 
     1184                 int filterIn = (std::static_pointer_cast<COutputPin>(filters.second))->getFilterId(); 
     1185                 CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut); 
     1186                 CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn); 
     1187                 CWorkflowGraph::mapFilters[filterOut] = filter->GetName(); 
     1188                 CWorkflowGraph::mapFilters[filterIn] = filters.second->GetName(); 
     1189               } 
    11731190               filter = filters.second; 
    11741191             } 
     
    11791196         // Check if we have a reference on another field 
    11801197         else if (!field_ref.isEmpty()) 
     1198         { 
     1199           CField::get(field_ref)->build_workflow_graph.setValue(buildWorkflowGraph); 
    11811200           instantDataFilter = getFieldReference(gc); 
     1201         } 
    11821202         // Check if the data is to be read from a file 
    11831203         else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read) 
     
    11851205           checkTimeAttributes(); 
    11861206           instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false, freq_offset, true, 
    1187                                                                                                        detectMissingValues, defaultValue)); 
     1207                                                                                                       detectMissingValues, defaultValue, buildWorkflowGraph)); 
    11881208         } 
    11891209         else // The data might be passed from the model 
     
    11911211            if (check_if_active.isEmpty()) check_if_active = false;  
    11921212            instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, true, NoneDu, false, 
    1193                                                                                                         detectMissingValues, defaultValue)); 
     1213                                                                                                      detectMissingValues, defaultValue, buildWorkflowGraph)); 
    11941214         } 
    11951215       } 
     
    12091229           fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 
    12101230           getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 
     1231           if (buildWorkflowGraph) 
     1232           { 
     1233             int filterOut = getTemporalDataFilter(gc, file->output_freq)->getFilterId(); 
     1234             int filterIn = fileWriterFilter->getFilterId(); 
     1235             CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut); 
     1236             CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn); 
     1237             CWorkflowGraph::mapFilters[filterOut] = "Temporal filter"; 
     1238             CWorkflowGraph::mapFilters[filterIn] = fileWriterFilter->GetName(); 
     1239           } 
    12111240         } 
    12121241       } 
     
    12311260     CField* fieldRef = CField::get(field_ref); 
    12321261     fieldRef->buildFilterGraph(gc, false); 
     1262     bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 
    12331263 
    12341264     std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters; 
     
    12381268       bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 
    12391269       double defaultValue  = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0);                                 
    1240        filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue); 
     1270       filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue, buildWorkflowGraph); 
    12411271     } 
    12421272     else 
    1243        filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc)); 
     1273     { 
     1274       filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc, buildWorkflowGraph)); 
     1275     } 
    12441276 
    12451277     fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 
    12461278 
     1279     if (buildWorkflowGraph) 
     1280     { 
     1281       int filterOut = fieldRef->instantDataFilter->getFilterId(); 
     1282       int filterIn = (std::static_pointer_cast<COutputPin>(filters.first))->getFilterId(); 
     1283       CWorkflowGraph::mapFieldToFilters[fieldRef->getId()].push_back(filterOut); 
     1284       CWorkflowGraph::mapFieldToFilters[fieldRef->getId()].push_back(filterIn); 
     1285       CWorkflowGraph::mapFilters[filterOut] = fieldRef->getInstantDataFilter()->GetName(); 
     1286       CWorkflowGraph::mapFilters[filterIn] = filters.first->GetName(); 
     1287     } 
    12471288     return filters.second; 
    12481289   } 
     
    13171358   { 
    13181359     std::map<CDuration, std::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 
     1360     const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 
    13191361 
    13201362     if (it == temporalDataFilters.end()) 
     
    13271369 
    13281370       const bool detectMissingValues = (!detect_missing_value.isEmpty()  && detect_missing_value == true); 
    1329        std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    1330                                                                              CContext::getCurrent()->getCalendar()->getInitDate(), 
    1331                                                                              freq_op, freq_offset, outFreq, detectMissingValues)); 
     1371       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, CContext::getCurrent()->getCalendar()->getInitDate(), 
     1372                                                                             freq_op, freq_offset, outFreq, 
     1373                                                                             detectMissingValues, buildWorkflowGraph)); 
    13321374 
    13331375       instantDataFilter->connectOutput(temporalFilter, 0); 
    13341376 
     1377       if (buildWorkflowGraph) 
     1378       { 
     1379         int filterOut = instantDataFilter->getFilterId(); 
     1380         int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId(); 
     1381         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut); 
     1382         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn); 
     1383         CWorkflowGraph::mapFilters[filterOut] = getInstantDataFilter()->GetName(); 
     1384         CWorkflowGraph::mapFilters[filterIn] = temporalFilter->GetName(); 
     1385       } 
     1386 
    13351387       it = temporalDataFilters.insert(std::make_pair(outFreq, temporalFilter)).first; 
    13361388     } 
    1337  
    13381389     return it->second; 
    13391390   } 
     
    13671418 
    13681419       const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true); 
     1420       const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 
    13691421       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    1370                                                                              CContext::getCurrent()->getCalendar()->getInitDate(), 
    1371                                                                              freq_op, freq_offset, outFreq, detectMissingValues)); 
     1422                                                                           CContext::getCurrent()->getCalendar()->getInitDate(), 
     1423                                                                           freq_op, freq_offset, outFreq, 
     1424                                                                           detectMissingValues, buildWorkflowGraph)); 
    13721425 
    13731426       selfReferenceFilter->connectOutput(temporalFilter, 0); 
     1427       if (buildWorkflowGraph) 
     1428 
     1429       { 
     1430         int filterOut = selfReferenceFilter->getFilterId(); 
     1431         int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId(); 
     1432         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterOut); 
     1433         CWorkflowGraph::mapFieldToFilters[this->getId()].push_back(filterIn); 
     1434         CWorkflowGraph::mapFilters[filterOut] = selfReferenceFilter->GetName(); 
     1435         CWorkflowGraph::mapFilters[filterIn] = temporalFilter->GetName(); 
     1436       } 
     1437 
    13741438       return temporalFilter ; 
    13751439     } 
  • XIOS/dev/dev_olga/src/node/field.hpp

    r1594 r1653  
    77#include "functor.hpp" 
    88#include "functor_type.hpp" 
     9#include "filter.hpp" 
    910#include "duration.hpp" 
    1011#include "date.hpp" 
     
    243244         bool hasTimeCentered; 
    244245 
    245  
    246246         DECLARE_REF_FUNC(Field,field) 
    247247 
  • XIOS/dev/dev_olga/src/node/field_impl.hpp

    r1201 r1653  
    1717  template <int N> 
    1818  void CField::setData(const CArray<double, N>& _data) 
     19  TRY 
    1920  { 
    2021    if (clientSourceFilter) 
     
    2728            << "Impossible to receive data from the model for a field [ id = " << getId() << " ] with a reference or an arithmetic operation."); 
    2829  } 
     30  CATCH_DUMP_ATTR 
    2931 
    3032  template <int N> 
    3133  void CField::getData(CArray<double, N>& _data) const 
     34  TRY 
    3235  { 
    3336    if (storeFilter) 
     
    4548    } 
    4649  } 
     50  CATCH 
    4751} // namespace xios 
    4852 
  • XIOS/dev/dev_olga/src/node/grid.hpp

    r1594 r1653  
    205205         bool hasTransform(); 
    206206         size_t getGlobalWrittenSize(void) ; 
    207 //         void getLocalMask(CArray<bool,1>& localMask) ; 
    208 //         template<int N> 
    209 //         void getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) ; 
    210207      public: 
    211208         CArray<int, 1> storeIndex_client; 
     
    377374   template <int n> 
    378375   void CGrid::inputField(const CArray<double,n>& field, CArray<double,1>& stored) const 
     376   TRY 
    379377   { 
    380378//#ifdef __XIOS_DEBUG 
     
    388386      this->storeField_arr(field.dataFirst(), stored); 
    389387   } 
     388   CATCH 
    390389 
    391390   template <int n> 
     
    405404   template <int n> 
    406405   void CGrid::outputField(const CArray<double,1>& stored, CArray<double,n>& field) const 
     406   TRY 
    407407   { 
    408408//#ifdef __XIOS_DEBUG 
     
    416416      this->restoreField_arr(stored, field.dataFirst()); 
    417417   } 
     418   CATCH 
    418419 
    419420   /*! 
     
    425426   template <int N> 
    426427   void CGrid::uncompressField(const CArray<double,N>& data, CArray<double,1>& outData) const 
     428   TRY 
    427429   {       
    428430     uncompressField_arr(data.dataFirst(), outData); 
    429431   } 
     432   CATCH 
    430433 
    431434   template<int N> 
     
    435438                             const CArray<int,1>& axisDomainOrder, 
    436439                             bool createMask) 
     440   TRY 
    437441   { 
    438442     int idx = 0; 
     
    530534    } 
    531535   } 
     536   CATCH_DUMP_ATTR 
    532537 
    533538   template<int N> 
     
    535540                                  const std::vector<int>& eachDimSize, 
    536541                                  bool newValue) 
     542   TRY 
    537543   { 
    538544      if (N != eachDimSize.size()) 
     
    549555      gridMask = newValue; 
    550556   } 
     557   CATCH_DUMP_ATTR 
    551558                                  
    552559 
     
    558565   template<int N> 
    559566   void CGrid::modifyGridMask(CArray<bool,N>& gridMask, const CArray<int,1>& indexToModify, bool valueToModify) 
     567   TRY 
    560568   {      
    561569     int num = indexToModify.numElements(); 
     
    565573     } 
    566574   } 
     575   CATCH_DUMP_ATTR 
     576 
    567577   ///-------------------------------------------------------------- 
    568578 
    569579 
    570 /*! 
    571   A grid can have multiple dimension, so can its mask in the form of multi-dimension array. 
    572 It's not a good idea to store all multi-dimension arrays corresponding to each mask. 
    573 One of the ways is to convert this array into 1-dimension one and every process is taken place on it. 
    574   \param [in] multi-dimension array grid mask 
    575 */ 
    576 //template<int N> 
    577 //void CGrid::getLocalMask(const CArray<bool,N>& gridMask, CArray<bool,1>& localMask) 
    578 //{ 
    579 //  if (gridMask.isEmpty()) return ; 
    580 //  int dim = gridMask.dimensions(); 
    581 //  std::vector<int> dimensionSizes(dim); 
    582 //  for (int i = 0; i < dim; ++i) dimensionSizes[i] = gridMask.extent(i); 
    583 // 
    584 //  std::vector<int> idxLoop(dim,0); 
    585 //  int ssize = gridMask.numElements(), idx = 0; 
    586 //  localMask.resize(ssize); 
    587 //  while (idx < ssize) 
    588 //  { 
    589 //    for (int i = 0; i < dim-1; ++i) 
    590 //    { 
    591 //      if (idxLoop[i] == dimensionSizes[i]) 
    592 //      { 
    593 //        idxLoop[i] = 0; 
    594 //        ++idxLoop[i+1]; 
    595 //      } 
    596 //    } 
    597 // 
    598 //    int maskIndex = idxLoop[0]; 
    599 //    int mulDim = 1; 
    600 //    for (int k = 1; k < dim; ++k) 
    601 //    { 
    602 //      mulDim *= dimensionSizes[k-1]; 
    603 //      maskIndex += idxLoop[k]*mulDim; 
    604 //    } 
    605 //    localMask(maskIndex) = *(gridMask.dataFirst()+maskIndex); 
    606 // 
    607 //    ++idxLoop[0]; 
    608 //    ++idx; 
    609 //  } 
    610 //} 
    611580 
    612581   // Declare/Define CGridGroup and CGridDefinition 
  • XIOS/dev/dev_olga/src/node/interpolate_domain.cpp

    r1269 r1653  
    6565    if (this->read_write_convention.isEmpty()) this->read_write_convention.setValue(read_write_convention_attr::fortran); 
    6666 
     67 
    6768  } 
    6869 
  • XIOS/dev/dev_olga/src/transformation/domain_algorithm_zoom.cpp

    r1620 r1653  
    113113  domainDest_->data_ni.setValue(niDest); 
    114114  domainDest_->data_nj.setValue(njDest); 
    115   domainDest_->data_ibegin.setValue(0);  // local position 
    116   domainDest_->data_jbegin.setValue(0);  // local position 
    117   domainDest_->data_i_index.resize(niDest*njDest); // local position 
    118   domainDest_->data_j_index.resize(niDest*njDest); // local position 
     115  domainDest_->data_ibegin.setValue(0); 
     116  domainDest_->data_jbegin.setValue(0); 
     117  domainDest_->data_i_index.resize(niDest*njDest); 
     118  domainDest_->data_j_index.resize(niDest*njDest); 
    119119 
    120120  domainDest_->domainMask.resize(niDest*njDest); 
  • XIOS/dev/dev_olga/src/transformation/generic_algorithm_transformation.hpp

    r1599 r1653  
    8787  */ 
    8888  void computeIndexSourceMapping(const std::vector<CArray<double,1>* >& dataAuxInputs = std::vector<CArray<double,1>* >()); 
    89 //  void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 
    90 //                                                  vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, vector<bool>& localMaskOnGridDest); 
    9189  void computeTransformationMappingNonDistributed(int elementPositionInGrid, CGrid* gridSrc, CGrid* gridDst, 
    9290                                                  vector<int>& localSrc, vector<int>& localDst, vector<double>& weight, int& nbLocalIndexOnGridDest); 
  • XIOS/dev/dev_olga/src/transformation/grid_transformation.cpp

    r1612 r1653  
    413413        int nbLocalIndexOnGridDest; 
    414414        CTimer::get("computeTransformationMappingNonDistributed").resume();   
    415 //        algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_, 
    416 //                                                         localSrc, localDst, weight, localMaskOnGridDest_.back()) ; 
    417415        algo->computeTransformationMappingNonDistributed(elementPosition, gridSource_, tmpGridDestination_,  
    418416                                                         localSrc, localDst, weight, nbLocalIndexOnGridDest) ; 
  • XIOS/dev/dev_olga/src/transformation/grid_transformation_factory_impl.hpp

    r1612 r1653  
    110110} 
    111111 
     112 
    112113} 
    113114#endif // __XIOS_GRID_TRANSFORMATION_FACTORY_HPP__ 
Note: See TracChangeset for help on using the changeset viewer.