Changeset 1680


Ignore:
Timestamp:
07/08/19 16:58:12 (2 years ago)
Author:
yushan
Message:

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1676. Arithmetic filter unified

Location:
XIOS/dev/dev_trunk_omp
Files:
58 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/context_atm.xml

    r1679 r1680  
    363363  <file_definition  type="one_file" > 
    364364     
    365     <file id="atm_output" output_freq="1ts" type="one_file" enabled="true"> 
     365    <file id="atm_output" output_freq="4ts" type="one_file" enabled="true"> 
    366366<!--      <field field_ref="field3D" /> 
    367367      <field field_ref="field2D" />  
  • XIOS/dev/dev_trunk_omp/inputs/iodef.xml

    r1679 r1680  
    1717 
    1818 
    19    <file_definition type="one_file" par_access="collective" output_freq="4h" output_level="10" > 
     19   <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" > 
    2020      <file id="output" name="output" enabled=".TRUE."> 
    2121        <!-- <field field_ref="field_Domain" name="field_A" /> --> 
    22         <field field_ref="field_A" name="field_A_name"  build_workflow_graph=".FALSE." />  
    23         <field field_ref="field_B" name="field_B_name"  build_workflow_graph=".FALSE."/>  
     22        <field field_ref="field_A" name="field_A_name"  build_workflow_graph=".TRUE." />  
     23        <field field_ref="field_B" name="field_B_name"  build_workflow_graph=".TRUE."/>  
    2424        <!-- <field field_ref="field_C" name="field_C_name" enabled=".TRUE." />  --> 
    25         <field id="field_D" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_D_name" build_workflow_graph_start="1h"  > field_A + field_B</field> 
    26         <!-- <field id="field_E" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_E_name" build_workflow_graph_start="1h" > field_D*2 </field> --> 
     25        <field id="field_D" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_D_name" build_workflow_graph_start="1h" > sqrt(field_A) + sqrt(field_B) + sqrt(field_C) </field> 
     26        <field id="field_E" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_E_name" build_workflow_graph_start="1h" > sqrt(field_A) + sqrt(field_B) + sqrt(field_C)</field> 
    2727        <!-- <field field_ref="field_A_zoom" name="field_B" build_workflow_graph=".TRUE."/> --> 
    2828     </file> 
    29      <file id="output1" name="output1" output_freq="8h" enabled=".FALSE."> 
     29     <file id="output1" name="output1" output_freq="8h" enabled=".TRUE."> 
    3030        <!-- <field field_ref="field_Domain" name="field_A" /> --> 
    3131        <field id="field_F" field_ref="field_A" name="field_A_zoom" grid_ref="grid_A_zoom" build_workflow_graph=".TRUE."   />         
  • XIOS/dev/dev_trunk_omp/src/attribute.hpp

    r1646 r1680  
    4242            virtual void fromString(const StdString & str) = 0; 
    4343            virtual StdString dump(void) const = 0; 
     44            virtual StdString dump2(void) const = 0; 
    4445            virtual bool isEqual(const CAttribute& ) = 0; 
    4546 
  • XIOS/dev/dev_trunk_omp/src/attribute_array.hpp

    r1646 r1680  
    5656            virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 
    5757            virtual string dump(void) const { return _dump();} 
     58            virtual string dump2(void) const { return _dump2();} 
    5859 
    5960            virtual void generateCInterface(ostream& oss,const string& className) ; 
     
    7172          StdString _toString(void) const; 
    7273          StdString _dump(void) const; 
     74          StdString _dump2(void) const; 
    7375          void _fromString(const StdString & str); 
    7476          bool _toBuffer  (CBufferOut& buffer) const; 
  • XIOS/dev/dev_trunk_omp/src/attribute_array_impl.hpp

    r1646 r1680  
    138138    } 
    139139 
     140    template <typename T_numtype, int N_rank> 
     141    StdString CAttributeArray<T_numtype,N_rank>::_dump2(void) const 
     142    { 
     143      StdOStringStream oss; 
     144      if (! isEmpty() && this->hasId() && (this->numElements()!=0)) 
     145        oss << this->getName() << "=" << CArray<T_numtype, N_rank>::dump() << ""; 
     146      return (oss.str()); 
     147    } 
     148 
    140149 
    141150      template <typename T_numtype, int N_rank> 
  • XIOS/dev/dev_trunk_omp/src/attribute_enum.hpp

    r1661 r1680  
    6363            virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;}  else _fromString(str);} 
    6464            virtual StdString dump(void) const { return _toString();} 
     65            virtual StdString dump2(void) const { return _dump2();} 
    6566 
    6667            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);}  
     
    7980          bool isEqual_(const CAttributeEnum& attr ); 
    8081          StdString _toString(void) const; 
     82          StdString _dump2(void) const; 
    8183          void _fromString(const StdString & str); 
    8284          bool _toBuffer  (CBufferOut& buffer) const; 
  • XIOS/dev/dev_trunk_omp/src/attribute_enum_impl.hpp

    r1219 r1680  
    149149  } 
    150150 
     151 
     152  template <class T> 
     153  StdString CAttributeEnum<T>::_dump2(void) const 
     154  { 
     155     StdOStringStream oss; 
     156     if (!CEnum<T>::isEmpty() && this->hasId()) 
     157        oss << this->getName() << "=" << CEnum<T>::toString() << "</br>"; 
     158     return (oss.str()); 
     159  } 
     160 
     161 
    151162  template <class T> 
    152163  void CAttributeEnum<T>::_fromString(const StdString & str) 
  • XIOS/dev/dev_trunk_omp/src/attribute_map.cpp

    r1646 r1680  
    4848            { 
    4949              str.append(att.second->dump()); 
     50              str.append(" "); 
     51            } 
     52            else if (str.length() == maxNbChar) 
     53            { 
     54              str.append("..."); 
     55            } 
     56          } 
     57        } 
     58        return str; 
     59      } 
     60 
     61 
     62 
     63      StdString CAttributeMap::recordXiosAttributes(void) const 
     64      { 
     65        int maxNbChar = 250; 
     66        StdString str; 
     67        typedef std::pair<StdString, CAttribute*> StdStrAttPair; 
     68        auto it = SuperClassMap::begin(), end = SuperClassMap::end(); 
     69        for (; it != end; it++) 
     70        { 
     71          const StdStrAttPair& att = *it; 
     72          if (!att.second->isEmpty()) 
     73          { 
     74            if (str.length() < maxNbChar) 
     75            { 
     76              str.append(att.second->dump2()); 
    5077              str.append(" "); 
    5178            } 
  • XIOS/dev/dev_trunk_omp/src/attribute_map.hpp

    r1646 r1680  
    3939            void clearAllAttributes(void); 
    4040            StdString dumpXiosAttributes(void) const; 
     41            StdString recordXiosAttributes(void) const; 
    4142 
    4243            void clearAttribute(const StdString& key); 
  • XIOS/dev/dev_trunk_omp/src/attribute_template.hpp

    r1646 r1680  
    7474//            virtual void fromBinary(StdIStream & is); 
    7575            virtual StdString dump(void) const { return _dump();} 
     76            virtual StdString dump2(void) const { return _dump2();} 
    7677 
    7778            virtual bool toBuffer  (CBufferOut& buffer) const { return _toBuffer(buffer);} 
     
    99100          StdString _toString(void) const; 
    100101          StdString _dump(void) const; 
     102          StdString _dump2(void) const; 
    101103          void _fromString(const StdString & str); 
    102104          bool _toBuffer  (CBufferOut& buffer) const; 
  • XIOS/dev/dev_trunk_omp/src/attribute_template_impl.hpp

    r1646 r1680  
    208208         if (!CType<T>::isEmpty() && this->hasId()) 
    209209            oss << this->getName() << "=\"" << CType<T>::dump() << "\""; 
     210         return (oss.str()); 
     211      } 
     212 
     213      template <class T> 
     214         StdString CAttributeTemplate<T>::_dump2(void) const 
     215      { 
     216         StdOStringStream oss; 
     217         if (!CType<T>::isEmpty() && this->hasId()) 
     218            oss << this->getName() << "=" << CType<T>::dump() << "</br>"; 
    210219         return (oss.str()); 
    211220      } 
  • XIOS/dev/dev_trunk_omp/src/cxios.cpp

    r1679 r1680  
    174174        
    175175       // CGraphviz::showStaticWorkflowGraph(); 
    176        CGraphviz::buildWorkflowGraphDot(); 
     176       // CGraphviz::buildWorkflowGraphDot(); 
    177177       CGraphviz::buildWorkflowGraphVisjs_with_info(); 
    178178 
    179       StdString commande_string="dot -Tpdf graph.dot -o graph.pdf";   
    180       const char* command=commande_string.c_str(); 
    181       system(command); 
     179      // StdString commande_string="dot -Tpdf graph.dot -o graph.pdf";   
     180      // const char* command=commande_string.c_str(); 
     181      // system(command); 
    182182 
    183183   
  • XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.cpp

    r1679 r1680  
    11#include "binary_arithmetic_filter.hpp" 
    22#include "workflow_graph.hpp" 
     3#include "yacc_var.hpp" 
     4#include "file.hpp" 
    35 
    46 
     
    1012    , value(value) 
    1113  {  
    12     StdString input_op_expression=op; 
    13     if(input_op_expression == "add") 
    14       op_expression = "+"; 
    15     else if(input_op_expression == "minus") 
    16       op_expression = "-"; 
    17     else if(input_op_expression == "mult") 
    18       op_expression = "x"; 
    19     else if(input_op_expression == "div") 
    20       op_expression = "/"; 
    21     else if(input_op_expression == "eq") 
    22       op_expression = "="; 
    23     else if(input_op_expression == "lt") 
    24       op_expression = "<"; 
    25     else if(input_op_expression == "gt") 
    26       op_expression = ">"; 
    27     else if(input_op_expression == "le") 
    28       op_expression = "<="; 
    29     else if(input_op_expression == "ge") 
    30       op_expression = ">="; 
    31     else if(input_op_expression == "ne") 
    32       op_expression = "!="; 
    33     else 
    34       op_expression = " "; 
     14    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
    3515  }; 
    3616 
     
    3818  { 
    3919    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 
     20    // bool building_graph = true; 
     21    int unique_filter_id; 
    4022 
    4123    if(building_graph) 
    4224    { 
    43       this->filterID = InvalidableObject::filterIdGenerator++;    
    44       int edgeID = InvalidableObject::edgeIdGenerator++;  
    45  
    46       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    47       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
    48  
    49       std::cout<<"CScalarFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 
    50  
    51       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "S "+op_expression +" F Filter" ; 
    52       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2 ; 
    53       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1 ; 
    54       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1 ; 
    55       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date ; 
    56       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp ; 
    57  
    58       if(CWorkflowGraph::build_begin) 
    59       { 
    60         CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
    61  
    62         (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
     25      CWorkflowGraph::allocNodeEdge(); 
     26 
     27      size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 
     28 
     29      // first round 
     30      if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 
     31      { 
     32        this->filterID = InvalidableObject::filterIdGenerator++; 
     33        int edgeID = InvalidableObject::edgeIdGenerator++; 
     34 
     35        CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 
     36        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 
     37 
     38        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     39        if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
     40       
     41 
     42        if(CWorkflowGraph::build_begin) 
     43        { 
     44          CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
     45          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 
     46 
     47          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
     48        } 
     49        else CWorkflowGraph::build_begin = true; 
     50 
     51        (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID;  
     52        unique_filter_id = this->filterID; 
    6353      } 
    64       else CWorkflowGraph::build_begin = true; 
     54      // not first round 
     55      else  
     56      { 
     57        unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 
     58        if(data[0]->src_filterID != unique_filter_id) 
     59        { 
     60          int edgeID = InvalidableObject::edgeIdGenerator++; 
     61          CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]);   
     62          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;  
     63          (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 
     64        } 
     65       
     66         
     67      }   
    6568    } 
    6669 
     
    6972    packet->timestamp = data[0]->timestamp; 
    7073    packet->status = data[0]->status; 
    71     if(building_graph) packet->src_filterID = this->filterID; 
     74    if(building_graph) packet->src_filterID = unique_filter_id; 
    7275    packet->field = this->field; 
    7376 
     
    8386    , value(value) 
    8487  {  
    85     StdString input_op_expression=op; 
    86     if(input_op_expression == "add") 
    87       op_expression = "+"; 
    88     else if(input_op_expression == "minus") 
    89       op_expression = "-"; 
    90     else if(input_op_expression == "mult") 
    91       op_expression = "x"; 
    92     else if(input_op_expression == "div") 
    93       op_expression = "/"; 
    94     else if(input_op_expression == "pow") 
    95       op_expression = "^"; 
    96     else if(input_op_expression == "eq") 
    97       op_expression = "="; 
    98     else if(input_op_expression == "lt") 
    99       op_expression = "<"; 
    100     else if(input_op_expression == "gt") 
    101       op_expression = ">"; 
    102     else if(input_op_expression == "le") 
    103       op_expression = "<="; 
    104     else if(input_op_expression == "ge") 
    105       op_expression = ">="; 
    106     else if(input_op_expression == "ne") 
    107       op_expression = "!="; 
    108     else 
    109       op_expression = " "; 
     88    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
    11089  }; 
    11190 
     
    11392  { 
    11493    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 
     94    // bool building_graph = true; 
     95    int unique_filter_id; 
    11596 
    11697    if(building_graph) 
    11798    { 
    118       this->filterID = InvalidableObject::filterIdGenerator++; 
    119       int edgeID = InvalidableObject::edgeIdGenerator++; 
    120   
    121       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    122       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
    123  
    124       std::cout<<"CFieldScalarArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 
    125  
    126       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "F "+op_expression +" S Filter" ; 
    127       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2 ; 
    128       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1 ; 
    129       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1 ; 
    130       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date ; 
    131       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp ; 
    132  
    133       if(CWorkflowGraph::build_begin) 
    134       { 
    135         CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
    136  
    137         (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
     99      CWorkflowGraph::allocNodeEdge(); 
     100 
     101      size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 
     102 
     103      // first round 
     104      if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 
     105      { 
     106        this->filterID = InvalidableObject::filterIdGenerator++; 
     107        int edgeID = InvalidableObject::edgeIdGenerator++; 
     108 
     109        CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 
     110        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 
     111 
     112        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     113        if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
     114       
     115 
     116        if(CWorkflowGraph::build_begin) 
     117        { 
     118          CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
     119          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 
     120 
     121          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
     122        } 
     123        else CWorkflowGraph::build_begin = true; 
     124 
     125        (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID;  
     126        unique_filter_id = this->filterID; 
    138127      } 
    139       else CWorkflowGraph::build_begin = true; 
     128      // not first round 
     129      else  
     130      { 
     131        unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 
     132        if(data[0]->src_filterID != unique_filter_id) 
     133        { 
     134          int edgeID = InvalidableObject::edgeIdGenerator++; 
     135          CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]);   
     136          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;  
     137          (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 
     138        } 
     139       
     140         
     141      }   
    140142    } 
    141143 
     
    144146    packet->timestamp = data[0]->timestamp; 
    145147    packet->status = data[0]->status; 
    146     if(building_graph) packet->src_filterID = this->filterID; 
     148    if(building_graph) packet->src_filterID = unique_filter_id; 
    147149    packet->field = this->field; 
    148150     
     
    158160    , op(operatorExpr.getOpFieldField(op)) 
    159161  {  
    160     StdString input_op_expression=op; 
    161     if(input_op_expression == "add") 
    162       op_expression = "+"; 
    163     else if(input_op_expression == "minus") 
    164       op_expression = "-"; 
    165     else if(input_op_expression == "mult") 
    166       op_expression = "x"; 
    167     else if(input_op_expression == "div") 
    168       op_expression = "/"; 
    169     else if(input_op_expression == "pow") 
    170       op_expression = "^"; 
    171     else if(input_op_expression == "eq") 
    172       op_expression = "="; 
    173     else if(input_op_expression == "lt") 
    174       op_expression = "<"; 
    175     else if(input_op_expression == "gt") 
    176       op_expression = ">"; 
    177     else if(input_op_expression == "le") 
    178       op_expression = "<="; 
    179     else if(input_op_expression == "ge") 
    180       op_expression = ">="; 
    181     else if(input_op_expression == "ne") 
    182       op_expression = "!="; 
    183     else 
    184       op_expression = " "; 
     162    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
    185163  }; 
    186164 
     
    188166  { 
    189167    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 
     168    // bool building_graph = true; 
     169    int unique_filter_id; 
    190170 
    191171    if(building_graph) 
    192     { 
    193  
    194       this->filterID = InvalidableObject::filterIdGenerator++; 
    195       int edgeID = InvalidableObject::edgeIdGenerator++; 
    196     
    197       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    198       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     172    {   
     173      CWorkflowGraph::allocNodeEdge(); 
    199174 
    200175      std::cout<<"CFieldFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 
    201176 
    202       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "F "+op_expression +" F Filter" ; 
    203       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2 ; 
    204       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1 ; 
    205       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2 ; 
    206       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date ; 
    207       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp ; 
    208  
    209       if(CWorkflowGraph::build_begin) 
    210       { 
    211  
    212         CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
    213  
    214         edgeID = InvalidableObject::edgeIdGenerator++; 
    215  
    216         CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 
    217  
    218         (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
    219         (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 
     177      size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 
     178 
     179      // first round 
     180      if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 
     181      { 
     182        this->filterID = InvalidableObject::filterIdGenerator++; 
     183        int edgeID = InvalidableObject::edgeIdGenerator++; 
     184     
     185        CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 
     186        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     187        if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
     188     
     189        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 
     190        if(CWorkflowGraph::build_begin) 
     191        { 
     192 
     193          CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
     194          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 
     195 
     196          edgeID = InvalidableObject::edgeIdGenerator++; 
     197 
     198          CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 
     199          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 
     200 
     201          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
     202          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 
     203        } 
     204        CWorkflowGraph::build_begin = true; 
     205 
     206        (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID;  
     207        unique_filter_id = this->filterID; 
     208  
    220209      } 
    221       CWorkflowGraph::build_begin = true; 
     210      // not first round 
     211      else  
     212      { 
     213        unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 
     214        if(data[0]->src_filterID != unique_filter_id) 
     215        { 
     216          int edgeID = InvalidableObject::edgeIdGenerator++; 
     217          CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]);  
     218          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;  
     219          (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 
     220        } 
     221        if(data[1]->src_filterID != unique_filter_id) 
     222        {  
     223          int edgeID = InvalidableObject::edgeIdGenerator++; 
     224          CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]);   
     225          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 
     226          (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 
     227        } 
     228         
     229      }   
    222230    } 
    223231 
     
    226234    packet->date = data[0]->date; 
    227235    packet->timestamp = data[0]->timestamp; 
    228     if(building_graph) packet->src_filterID = this->filterID; 
     236    if(building_graph) packet->src_filterID = unique_filter_id; 
    229237    packet->field = this->field; 
    230238     
  • XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.hpp

    r1677 r1680  
    2424      CScalarFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value); 
    2525      StdString virtual GetName(void); 
     26 
    2627 
    2728    protected: 
     
    5455      StdString virtual GetName(void); 
    5556 
     57 
    5658    protected: 
    5759      COperatorExpr::functionFieldScalar op; //!< The binary field-scalar operator attached to the binary arithmeric filter 
     
    8284      StdString virtual GetName(void); 
    8385 
     86 
    8487    protected: 
    8588      COperatorExpr::functionFieldField op; //!< The binary field-field operator attached to the binary arithmeric filter 
  • XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp

    r1679 r1680  
    2222  { 
    2323    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph: false; 
     24     
    2425    if(building_graph) 
    2526    { 
     
    2728      int edgeID = InvalidableObject::edgeIdGenerator++; 
    2829 
    29       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    30       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     30      CWorkflowGraph::allocNodeEdge(); 
    3131 
    32       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "File Writer Filter"; 
    33       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 4; 
    34       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 0; 
    35       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    36       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    37       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     32      CWorkflowGraph::addNode(this->filterID, "File Writer Filter \\n("+this->field->file->getId()+".nc)", 6, 0, 1, data[0]); 
    3833 
    39       if(CXios::isClient) std::cout<<"CFileWriterFilter::apply filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
     34      // (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->file->recordXiosAttributes(); 
     35      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     36      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
     37 
     38      // if(CXios::isClient) std::cout<<"CFileWriterFilter::apply filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    4039 
    4140      if(CXios::isClient && CWorkflowGraph::build_begin)  
  • XIOS/dev/dev_trunk_omp/src/filter/filter.hpp

    r1679 r1680  
    6868 
    6969      int filterID; 
    70       StdString op_expression; 
     70      StdString expression; 
    7171 
    7272    protected: 
  • XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.cpp

    r1679 r1680  
    88  int InvalidableObject::edgeIdGenerator = 0; 
    99  #pragma omp threadprivate(InvalidableObject::edgeIdGenerator) 
     10 
     11  int InvalidableObject::clusterIdGenerator = 0; 
     12  #pragma omp threadprivate(InvalidableObject::clusterIdGenerator) 
    1013   
    1114  void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp) 
  • XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.hpp

    r1679 r1680  
    2828    static int edgeIdGenerator; 
    2929    #pragma omp threadprivate(edgeIdGenerator) 
     30 
     31    static int clusterIdGenerator; 
     32    #pragma omp threadprivate(clusterIdGenerator) 
    3033 
    3134     
  • XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp

    r1679 r1680  
    116116    { 
    117117 
    118       if(parent_filters[i]->start_graph==0) parent_filters[i]->start_graph = start_graph; 
    119       else if(parent_filters[i]->start_graph<0) parent_filters[i]->start_graph = start_graph; 
     118      if(parent_filters[i]->start_graph<0) parent_filters[i]->start_graph = start_graph; 
    120119      else parent_filters[i]->start_graph = min(parent_filters[i]->start_graph, start_graph); 
    121120 
    122121 
    123       if(parent_filters[i]->end_graph==9223372036854775807) parent_filters[i]->end_graph = end_graph;   
    124       else if(parent_filters[i]->end_graph<0) parent_filters[i]->end_graph = end_graph;   
     122      if(parent_filters[i]->end_graph<0) parent_filters[i]->end_graph = end_graph;   
    125123      else parent_filters[i]->end_graph = max(parent_filters[i]->end_graph, end_graph); 
    126124       
  • XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp

    r1679 r1680  
    22#include "workflow_graph.hpp" 
    33#include "field.hpp" 
     4#include "file.hpp" 
    45 
    56namespace xios 
     
    1617    if(building_graph) 
    1718    { 
    18       std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
     19      // std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    1920      this->filterID = InvalidableObject::filterIdGenerator++; 
    2021      int edgeID = InvalidableObject::edgeIdGenerator++; 
    21       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
    2222 
    23       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Pass Through Filter"; 
    24       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 5; 
    25       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    26       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    27       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    28       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     23      CWorkflowGraph::allocNodeEdge(); 
    2924 
    30       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
     25      CWorkflowGraph::addNode(this->filterID, "Pass Through Filter", 2, 1, 1, data[0]); 
     26 
     27      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     28      if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
     29 
    3130       
    3231      if(CWorkflowGraph::build_begin) 
  • XIOS/dev/dev_trunk_omp/src/filter/source_filter.cpp

    r1679 r1680  
    7171      packet->field = this->field; 
    7272       
    73        
    7473      if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    7574     
    76       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
    77  
    78       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Source Filter "+ this->field->getId(); 
    79       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 1; 
    80       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    81       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 0; 
    82       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = date; 
    83       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = packet->timestamp; 
    84  
    85       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge>; 
     75      CWorkflowGraph::allocNodeEdge(); 
     76 
     77      CWorkflowGraph::addNode(this->filterID, "Source Filter ", 1, 1, 0, packet); 
     78      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     79      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].field_id = this->field->getId(); 
    8680 
    8781      CWorkflowGraph::build_begin = true; 
  • XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp

    r1679 r1680  
    99#endif 
    1010#include "workflow_graph.hpp" 
     11#include "file.hpp" 
    1112namespace xios 
    1213{ 
     
    184185    { 
    185186      this->filterID = InvalidableObject::filterIdGenerator++; 
    186       int edgeID = InvalidableObject::edgeIdGenerator++; 
    187      
    188       std::cout<<"CSpatialTransformFilter::apply filter tag = "<<tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    189      
    190  
    191       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
    192  
    193  
    194       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Spatial Transform Filter"; 
    195       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 6; 
    196       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    197       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    198       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    199       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
    200  
    201  
    202       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
     187      int edgeID = InvalidableObject::edgeIdGenerator++;     
     188 
     189      CWorkflowGraph::allocNodeEdge(); 
     190 
     191      CWorkflowGraph::addNode(this->filterID, "Spatial Transform Filter", 4, 1, 1, data[0]); 
     192      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = field->recordXiosAttributes(); 
     193      if(field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +field->file->recordXiosAttributes(); 
     194 
    203195 
    204196      if(CWorkflowGraph::build_begin) 
     
    229221      if (0 != packet->data.numElements()) 
    230222        (packet->data)(0) = defaultValue; 
    231       apply(data[0]->data, packet->data, this->filterID); 
     223      if(building_graph) apply(data[0]->data, packet->data, this->filterID); 
     224      else apply(data[0]->data, packet->data); 
    232225    } 
    233226 
     
    354347        int srcRank = itRecv->first; 
    355348 
    356         if(filterID >=0) (*CWorkflowGraph::mapFilters_ptr_with_info)[filterID].transform_type = (*itAlgo)->getName(); 
     349        if(filterID >=0) 
     350        { 
     351           (*CWorkflowGraph::mapFilters_ptr_with_info)[filterID].filter_name = (*itAlgo)->getName(); 
     352        }  
    357353        if (srcRank != rank) 
    358354        { 
  • XIOS/dev/dev_trunk_omp/src/filter/store_filter.cpp

    r1679 r1680  
    33#include "grid.hpp" 
    44#include "timer.hpp" 
     5#include "file.hpp" 
    56 
    67namespace xios 
     
    9899      int edgeID = InvalidableObject::edgeIdGenerator++; 
    99100 
    100       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    101       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     101      CWorkflowGraph::allocNodeEdge(); 
     102  
     103      CWorkflowGraph::addNode(this->filterID, "Store Filter", 4, 1, 1, data[0]); 
     104      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     105      if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
    102106 
    103  
    104       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Store Filter"; 
    105       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 4; 
    106       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    107       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    108       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    109       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
    110  
    111       if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl; 
     107      // if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl; 
    112108 
    113109      if(CXios::isClient && CWorkflowGraph::build_begin)  
  • XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp

    r1679 r1680  
    33#include "calendar_util.hpp" 
    44#include "workflow_graph.hpp" 
     5#include "file.hpp" 
    56 
    67namespace xios 
     
    2829//    , nextOperationDate(initDate + opFreq + this->samplingOffset) 
    2930    , isFirstOperation(true) 
     31    , temp_op(opId) 
    3032  { 
    3133  } 
     
    3436  { 
    3537    bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 
    36     
     38 
    3739    if(building_graph) 
    3840    { 
    39       if(this->filterIDoutputs.size()==0) this->filterID = InvalidableObject::filterIdGenerator++; 
    4041      int edgeID = InvalidableObject::edgeIdGenerator++; 
    41        
    42  
    43       std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<<" start = "<<this->start_graph<<" end = "<<this->end_graph<<std::endl; 
    44  
    45       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
     42 
     43      CWorkflowGraph::allocNodeEdge(); 
    4644 
    4745      if(CWorkflowGraph::build_begin) 
    4846      { 
    49  
    50         CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
    51  
    52         (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
    53       } 
    54        
    55       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
    56  
    57       if(this->filterIDoutputs.size()==0) 
    58       { 
    59         (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Temporal Filter";    
    60         (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 3;    
    61         (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1;    
    62         // (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = (initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth) / data[0]->date +1 ;    
    63         (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb =-1;    
    64         (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date;    
    65         (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp;    
    66       } 
    67  
    68  
    69       this->filterIDoutputs.push_back(data[0]->src_filterID);  
     47        CWorkflowGraph::addEdge(edgeID, -1, data[0]);         
     48      } 
     49      this->filterIDoutputs_pair.push_back(make_pair(edgeID, data[0]->src_filterID));  
    7050    } 
    7151     
     
    10181      if (outputResult) 
    10282      { 
     83        if(building_graph) 
     84        { 
     85          this->filterID = InvalidableObject::filterIdGenerator++; 
     86          CWorkflowGraph::addNode(this->filterID, "Temporal Filter\\n("+this->temp_op+")", 5, 1, 0, data[0]);    
     87          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].transform_type = this->temp_op;    
     88          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = true ; 
     89 
     90          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     91          if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
     92 
     93 
     94          for(int i=0; i<this->filterIDoutputs_pair.size(); i++) 
     95          { 
     96            (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterIDoutputs_pair[i].second].filter_filled = 0 ;   
     97            (*CWorkflowGraph::mapFieldToFilters_ptr_with_info)[this->filterIDoutputs_pair[i].first].to = this->filterID ;   
     98          } 
     99 
     100          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = this->filterIDoutputs_pair.size() ; 
     101        } 
     102 
     103 
     104 
    103105        nbOperationDates ++; 
    104106        if (!copyLess) 
     
    117119 
    118120        isFirstOperation = false; 
     121         
     122        packet->field = this->field; 
    119123        if(building_graph) packet->src_filterID=this->filterID; 
     124        if(building_graph) this->filterIDoutputs_pair.clear(); 
     125        if(building_graph) CWorkflowGraph::build_begin=true; 
     126      } 
     127    } 
     128 
     129    return packet; 
     130  } 
     131 
     132 
     133 
     134  CDataPacketPtr CTemporalFilter::apply_old(std::vector<CDataPacketPtr> data) 
     135  { 
     136    bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 
     137    
     138    if(building_graph) 
     139    { 
     140      if(this->filterIDoutputs.size()==0) this->filterID = InvalidableObject::filterIdGenerator++; 
     141      int edgeID = InvalidableObject::edgeIdGenerator++; 
     142       
     143      // std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<<" start = "<<this->start_graph<<" end = "<<this->end_graph<<std::endl; 
     144 
     145      CWorkflowGraph::allocNodeEdge(); 
     146 
     147      if(this->filterIDoutputs.size()==0) 
     148      { 
     149        CWorkflowGraph::addNode(this->filterID, "Temporal Filter\\n("+this->temp_op+")", 5, 1, 0, data[0]);    
     150        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].transform_type = this->temp_op;    
     151        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = false ; 
     152      } 
     153 
     154      if(CWorkflowGraph::build_begin) 
     155      { 
     156 
     157        CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
     158 
     159        (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 
     160        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb += 1 ; 
     161      } 
     162 
     163 
     164      this->filterIDoutputs.push_back(data[0]->src_filterID);  
     165    } 
     166     
     167     
     168    CDataPacketPtr packet; 
     169 
     170    if (data[0]->status != CDataPacket::END_OF_STREAM) 
     171    { 
     172      bool usePacket, outputResult, copyLess; 
     173      if (isOnceOperation) 
     174        usePacket = outputResult = copyLess = isFirstOperation; 
     175      else 
     176      { 
     177        usePacket = (data[0]->date >= nextSamplingDate); 
     178        outputResult = (data[0]->date  > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 
     179        copyLess = (isInstantOperation && usePacket && outputResult); 
     180      } 
     181 
     182      if (usePacket) 
     183      { 
     184        nbSamplingDates ++; 
     185        if (!copyLess) 
     186        { 
     187          if (!tmpData.numElements()) 
     188            tmpData.resize(data[0]->data.numElements()); 
     189 
     190          (*functor)(data[0]->data); 
     191        } 
     192 
     193        nextSamplingDate = ((initDate + offsetMonth) + nbSamplingDates * samplingFreq) + offsetAllButMonth + initDate.getRelCalendar().getTimeStep(); 
     194      } 
     195 
     196      if (outputResult) 
     197      { 
     198        nbOperationDates ++; 
     199        if (!copyLess) 
     200        { 
     201          functor->final(); 
     202 
     203          packet = CDataPacketPtr(new CDataPacket); 
     204          packet->date = data[0]->date; 
     205          packet->timestamp = data[0]->timestamp; 
     206          packet->status = data[0]->status; 
     207          packet->data.resize(tmpData.numElements()); 
     208          packet->data = tmpData; 
     209        } 
     210        else 
     211          packet = data[0]; 
     212 
     213        isFirstOperation = false; 
     214         
    120215        packet->field = this->field; 
     216        if(building_graph) packet->src_filterID=this->filterID; 
    121217        if(building_graph) this->filterIDoutputs.clear(); 
    122218        if(building_graph) CWorkflowGraph::build_begin=true; 
     219        if(building_graph) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = true ; 
    123220      } 
    124221    } 
  • XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.hpp

    r1679 r1680  
    4040       */ 
    4141      CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 
     42      CDataPacketPtr virtual apply_old(std::vector<CDataPacketPtr> data); 
    4243 
    4344      /*! 
     
    5455       */ 
    5556      bool virtual isDataExpected(const CDate& date) const; 
    56       std::vector<int> filterIDoutputs; 
     57      std::vector<int > filterIDoutputs; 
     58      std::vector<std::pair<int, int> > filterIDoutputs_pair; 
     59 
     60      StdString temp_op; 
    5761 
    5862    private: 
  • XIOS/dev/dev_trunk_omp/src/filter/ternary_arithmetic_filter.cpp

    r1679 r1680  
    11#include "ternary_arithmetic_filter.hpp" 
    22#include "workflow_graph.hpp" 
     3#include "yacc_var.hpp" 
    34 
    45namespace xios 
     
    910    , value1(value1) 
    1011    , value2(value2) 
    11   { /* Nothing to do */ }; 
     12  {  
     13    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
     14    /* Nothing to do */  
     15  }; 
    1216 
    1317  CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
     
    2024       int edgeID = InvalidableObject::edgeIdGenerator++; 
    2125     
    22       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    23       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     26      CWorkflowGraph::allocNodeEdge(); 
    2427 
    2528      std::cout<<"CScalarScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 
    2629 
    27       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "SSF Filter"; 
    28       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    29       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    30       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    31       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    32       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     30 
     31 
     32      CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 
    3333 
    3434 
     
    6161    , value1(value1) 
    6262    , value2(value2) 
    63   { /* Nothing to do */ }; 
     63  {  
     64    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
     65    /* Nothing to do */  
     66  }; 
    6467 
    6568  CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
     
    7376     
    7477 
    75       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    76       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     78      CWorkflowGraph::allocNodeEdge(); 
    7779 
    7880      std::cout<<"CScalarFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 
    7981 
    80       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "SFS Filter"; 
    81       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    82       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    83       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    84       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    85       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     82 
     83 
     84      CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 
    8685 
    8786      if(CWorkflowGraph::build_begin) 
     
    111110    , op(operatorExpr.getOpScalarFieldField(op)) 
    112111    , value(value) 
    113   { /* Nothing to do */ }; 
     112  {  
     113    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
     114    /* Nothing to do */  
     115  }; 
    114116 
    115117  CDataPacketPtr CScalarFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
     
    123125     
    124126 
    125       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    126       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     127      CWorkflowGraph::allocNodeEdge(); 
    127128 
    128129      std::cout<<"CScalarFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 
    129130 
    130       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "SFF Filter"; 
    131       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    132       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    133       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2; 
    134       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    135       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     131 
     132      CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]); 
    136133 
    137134      if(CWorkflowGraph::build_begin) 
     
    177174    , value1(value1) 
    178175    , value2(value2) 
    179   { /* Nothing to do */ }; 
     176  {  
     177    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
     178    /* Nothing to do */  
     179  }; 
    180180 
    181181  CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
     
    189189     
    190190 
    191       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    192       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     191      CWorkflowGraph::allocNodeEdge(); 
    193192 
    194193      std::cout<<"CFieldScalarScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 
    195194 
    196       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FSS Filter"; 
    197       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    198       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    199       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    200       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    201       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     195      CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 
    202196 
    203197      if(CWorkflowGraph::build_begin) 
     
    229223    , op(operatorExpr.getOpFieldScalarField(op)) 
    230224    , value(value) 
    231   { /* Nothing to do */ }; 
     225  {  
     226    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
     227    /* Nothing to do */  
     228  }; 
    232229 
    233230  CDataPacketPtr CFieldScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
     
    241238     
    242239 
    243       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    244       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     240      CWorkflowGraph::allocNodeEdge(); 
    245241 
    246242      std::cout<<"CFieldScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 
    247243 
    248       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FSF Filter"; 
    249       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    250       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    251       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2; 
    252       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    253       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     244      CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]); 
    254245 
    255246      if(CWorkflowGraph::build_begin) 
     
    291282    , op(operatorExpr.getOpFieldFieldScalar(op)) 
    292283    , value(value) 
    293   { /* Nothing to do */ }; 
     284  {  
     285    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
     286    std::cout<<"expression = "<<expression; 
     287    /* Nothing to do */  
     288  }; 
    294289 
    295290  CDataPacketPtr CFieldFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
     
    302297      int edgeID = InvalidableObject::edgeIdGenerator++; 
    303298     
    304       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    305       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     299      CWorkflowGraph::allocNodeEdge(); 
    306300 
    307301      std::cout<<"CFieldFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 
    308302 
    309       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FFS Filter"; 
    310       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    311       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    312       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2; 
    313       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    314       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     303 
     304      CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]); 
    315305 
    316306      if(CWorkflowGraph::build_begin) 
     
    352342    : CFilter(gc, 3, this) 
    353343    , op(operatorExpr.getOpFieldFieldField(op)) 
    354   { /* Nothing to do */ }; 
     344  {  
     345    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
     346    /* Nothing to do */  
     347  }; 
    355348 
    356349  CDataPacketPtr CFieldFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 
     
    364357     
    365358 
    366       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    367       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     359      CWorkflowGraph::allocNodeEdge(); 
    368360 
    369361      std::cout<<"CFieldFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 
    370362 
    371       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FFF Filter"; 
    372       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    373       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    374       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 3; 
    375       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    376       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     363 
     364      CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 3, data[0]); 
    377365 
    378366      if(CWorkflowGraph::build_begin) 
  • XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.cpp

    r1679 r1680  
    11#include "unary_arithmetic_filter.hpp" 
    22#include "workflow_graph.hpp" 
     3#include "yacc_var.hpp" 
     4#include "file.hpp" 
     5 
    36namespace xios 
    47{ 
     
    710    , op(operatorExpr.getOpField(op)) 
    811  {  
    9     StdString input_op_expression=op; 
    10     if(input_op_expression == "neg") 
    11       op_expression = "-"; 
    12     else if(input_op_expression == "sin") 
    13       op_expression = "sin"; 
    14     else if(input_op_expression == "cos") 
    15       op_expression = "cos"; 
    16     else if(input_op_expression == "tan") 
    17       op_expression = "tan"; 
    18     else if(input_op_expression == "exp") 
    19       op_expression = "exp"; 
    20     else if(input_op_expression == "log") 
    21       op_expression = "log"; 
    22     else if(input_op_expression == "log10") 
    23       op_expression = "log10"; 
    24     else if(input_op_expression == "sqrt") 
    25       op_expression = "sqrt"; 
    26     else 
    27       op_expression = " "; 
     12    expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 
    2813  }; 
    2914 
     
    3116  { 
    3217    bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 
    33  
     18    int unique_filter_id; 
     19     
    3420    if(building_graph) 
    3521    { 
    36       this->filterID = InvalidableObject::filterIdGenerator++; 
    37       int edgeID = InvalidableObject::edgeIdGenerator++; 
     22      CWorkflowGraph::allocNodeEdge(); 
     23      size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 
     24 
     25      // first round 
     26      if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 
     27      { 
     28        this->filterID = InvalidableObject::filterIdGenerator++; 
     29        int edgeID = InvalidableObject::edgeIdGenerator++; 
     30 
     31        CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 
     32        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 
     33 
     34        (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 
     35        if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 
    3836       
    39       if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
    40       if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     37        if(CWorkflowGraph::build_begin) 
     38        { 
    4139 
    42       std::cout<<"CunaryArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 
     40          CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
     41          (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 
    4342 
    44       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "F Filter"; 
    45       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 
    46       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 
    47       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 
    48       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 
    49       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 
     43          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;  
     44        } 
     45        else CWorkflowGraph::build_begin = true; 
    5046 
    51       if(CWorkflowGraph::build_begin) 
     47        (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID;  
     48        unique_filter_id = this->filterID; 
     49      } 
     50      else  
    5251      { 
    53  
    54         CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 
    55  
    56         (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;  
    57       } 
    58       else CWorkflowGraph::build_begin = true; 
     52        unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 
     53        if(data[0]->src_filterID != unique_filter_id) 
     54        { 
     55          int edgeID = InvalidableObject::edgeIdGenerator++; 
     56          CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]);  
     57          (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;  
     58          (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 
     59        } 
     60       
     61         
     62      }  
    5963   
    6064    } 
     
    6973      packet->data.reference(op(data[0]->data)); 
    7074 
    71     if(building_graph) packet->src_filterID = this->filterID; 
     75    if(building_graph) packet->src_filterID = unique_filter_id; 
    7276 
    7377    return packet; 
    7478  } 
    7579} // namespace xios 
     80 
  • XIOS/dev/dev_trunk_omp/src/graphviz.cpp

    r1679 r1680  
    7272    { 
    7373      CWorkflowGraph::buildStaticWorkflow_with_info(); 
     74 
     75      StdString color_table[7] = {"black", "red", "blue", "green", "purple", "yellow", "gray"}; 
    7476     
    7577      std::ofstream fs_json; 
    7678      fs_json.open ("graph_data.json", std::fstream::out); 
    7779 
    78       fs_json << "{ \"node\" : ["<<std::endl; 
     80      fs_json << "{\"nodes\":["<<std::endl<<"      "; 
     81      static bool firstnode=true; 
     82      static bool firstedge=true; 
    7983     
    8084      for (auto it=CWorkflowGraph::mapFilters_ptr_with_info->begin(); it != CWorkflowGraph::mapFilters_ptr_with_info->end(); it++) 
    8185      { 
    82         fs_json << "        {\"id\": "<<it->first +1<<"}, "<<std::endl; 
    83         fs_json << "            {\"label\": \""<<it->second.filter_name<<"\"}, "<<std::endl  ; 
    84         fs_json << "            {\"class\": "<<it->second.filter_class<<"}, "<<std::endl  ; 
    85         fs_json << "            {\"filled\": "<<it->second.filter_filled<<"}, "<<std::endl  ; 
    86         fs_json << "            {\"entry\": "<<it->second.expected_entry_nb<<"}, "<<std::endl  ; 
    87         // fs_json << "            {\"date\": \""<<it->second.date<<"\"}, "<<std::endl  ; 
    88         fs_json << "            {\"type\": \""<<it->second.transform_type<<"\"}, "<<std::endl  ; 
     86        if(firstnode)  
     87        { 
     88          fs_json << "{\"id\": "<<it->first +1<<", "<<std::endl; 
     89          firstnode = false; 
     90        } 
     91        else 
     92        { 
     93          fs_json << ",{\"id\": "<<it->first +1<<", "<<std::endl; 
     94        } 
     95        if(it->second.filter_class == 1) // source filter 
     96          fs_json << "       \"label\": \""<<it->second.filter_name<<"\\n("<<it->second.field_id<<")\", "<<std::endl; 
     97        else 
     98          fs_json << "       \"label\": \""<<it->second.filter_name<<"\", "<<std::endl; 
     99        fs_json << "       \"class\": \""<<it->second.filter_class<<"\", "<<std::endl; 
     100        fs_json << "       \"filled\": \""<<it->second.filter_filled<<"\", "<<std::endl; 
     101        fs_json << "       \"type\": \""<<it->second.transform_type<<"\", "<<std::endl; 
     102        fs_json << "       \"entry\": \""<<it->second.expected_entry_nb<<"\", "<<std::endl; 
     103        fs_json << "       \"inputs\": \""<<it->second.inputs_complete<<"\", "<<std::endl; 
     104        fs_json << "       \"tag\": \""<<it->second.filter_tag<<"\", "<<std::endl; 
     105        if(it->second.clusterID != -1) fs_json << "       \"cid\": \""<<it->second.clusterID<<"\", "<<std::endl; 
     106        fs_json << "       \"attributes\": \""<<it->second.attributes<<"\"}"<<std::endl<<"      "; 
    89107      } 
    90       fs_json << "    ]}"<<std::endl<<std::endl; 
    91  
    92       fs_json << "{ \"edge\" : ["<<std::endl; 
     108      fs_json << "    ],"<<std::endl; 
     109 
     110 
     111      fs_json << " \"edges\" : ["<<std::endl<<"      "; 
    93112 
    94113      for (auto it=CWorkflowGraph::mapFieldToFilters_ptr_with_info->begin(); it != CWorkflowGraph::mapFieldToFilters_ptr_with_info->end(); it++) 
    95114      { 
    96         fs_json << "        {\"id\": "<<it->first +1<<"}, "<<std::endl; 
    97         fs_json << "            {\"from\": "<<it->second.from +1<<"}, "<<std::endl; 
    98         fs_json << "            {\"to\": "<<it->second.to+1<<"}, "<<std::endl  ; 
    99         fs_json << "            {\"fid\": \""<<it->second.field_id<<"\"}, "<<std::endl  ; 
    100         fs_json << "            {\"fname\": \""<<it->second.field_name<<"\"}, "<<std::endl  ; 
    101         fs_json << "            {\"gid\": \""<<it->second.grid_id<<"\"}, "<<std::endl  ; 
    102         fs_json << "            {\"date\": \""<<it->second.date<<"\"}, "<<std::endl  ; 
     115        if(firstedge) 
     116        { 
     117          fs_json << "{\"id\": "<<it->first +1<<", "<<std::endl; 
     118          firstedge = false; 
     119        } 
     120        else 
     121        { 
     122          fs_json << ",{\"id\": "<<it->first +1<<", "<<std::endl; 
     123        } 
     124        fs_json << "       \"from\": "<<it->second.from+1<<", "<<std::endl; 
     125        fs_json << "       \"to\": "<<it->second.to+1<<", "<<std::endl; 
     126        fs_json << "       \"label\": \""<<it->second.field_id<<"\\n"<<it->second.date<<"\", "<<std::endl; 
     127        // fs_json << "       \"title\": \""<<"Show more information about this field"<<"\", "<<std::endl; 
     128        // fs_json << "       \"fid\": \""<<it->second.field_id<<"\", "<<std::endl; 
     129        // fs_json << "       \"fname\": \""<<it->second.field_name<<"\", "<<std::endl; 
     130        // fs_json << "       \"gid\": \""<<it->second.grid_id<<"\", "<<std::endl; 
     131        fs_json << "       \"date\": \""<<it->second.date<<"\", "<<std::endl; 
     132        fs_json << "       \"attributes\": \"id = "<<it->second.field_id<<"</br>"<<it->second.attributes<<"\"}"<<std::endl<<"      "; 
     133 
    103134      } 
    104       fs_json << "    ]}"<<std::endl<<std::endl; 
     135      fs_json << "    ]}"<<std::endl; 
    105136 
    106137 
     
    114145 
    115146 
    116       std::ofstream fs; 
    117       fs.open ("graph_with_info.html", std::fstream::out); 
    118  
    119       fs << "<html>" <<std::endl; 
    120       fs << "<head>" <<std::endl; 
    121       fs << "    <script type=\"text/javascript\" src=\"../../../vis-4.21.0/dist/vis.js\"></script>" <<std::endl; 
    122       fs << "    <link href=\"../../../vis-4.21.0/dist/vis.css\" rel=\"stylesheet\" type=\"text/css\" />" <<std::endl <<std::endl; 
    123       fs << "    <style type=\"text/css\">"<<std::endl; 
    124       fs << "        #mynetwork {"<<std::endl; 
    125       fs << "            width: 1000px;"<<std::endl; 
    126       fs << "            height: 800px;"<<std::endl; 
    127       fs << "            border: 1px solid lightgray"<<std::endl; 
    128       fs << "        }"<<std::endl; 
    129       fs << "    </style>"<<std::endl; 
    130       fs << "</head>"<<std::endl; 
    131       fs << "<body>"<<std::endl; 
    132       fs << "<div id=\"mynetwork\"></div>"<<std::endl<<std::endl; 
    133       fs << "<script type=\"text/javascript\">"<<std::endl; 
    134  
    135       fs << "    var nodes = new vis.DataSet(["<<std::endl; 
    136       for(int i=0; i<CWorkflowGraph::filters.size(); i++) 
    137       { 
    138         fs << "        {id: "<<i+1<<", label: \'"<<CWorkflowGraph::filters[i]<<"\'},"<<std::endl  ; 
    139       } 
    140       fs << "    ]);"<<std::endl<<std::endl; 
    141  
    142  
    143       fs << "    var edges = new vis.DataSet(["<<std::endl; 
    144       for(int i=0; i<CWorkflowGraph::fieldsToFilters.size(); i++) 
    145       { 
    146         fs <<"        {from: "<<CWorkflowGraph::fieldsToFilters[i].first+1<<", to: "<<CWorkflowGraph::fieldsToFilters[i].second+1<<", label: \'"<<CWorkflowGraph::fields[i]<<"\'},"<<std::endl; 
    147       } 
    148       fs << "    ]);"<<std::endl<<std::endl; 
     147      // std::ofstream fs; 
     148      // fs.open ("graph_with_info.html", std::fstream::out); 
     149 
     150      // fs << "<html>" <<std::endl; 
     151      // fs << "<head>" <<std::endl; 
     152      // fs << "    <script type=\"text/javascript\" src=\"../../../vis-4.21.0/dist/vis.js\"></script>" <<std::endl; 
     153      // fs << "    <link href=\"../../../vis-4.21.0/dist/vis.css\" rel=\"stylesheet\" type=\"text/css\" />" <<std::endl <<std::endl; 
     154      // fs << "    <style type=\"text/css\">"<<std::endl; 
     155      // fs << "        #mynetwork {"<<std::endl; 
     156      // fs << "            width: 1000px;"<<std::endl; 
     157      // fs << "            height: 800px;"<<std::endl; 
     158      // fs << "            border: 1px solid lightgray"<<std::endl; 
     159      // fs << "        }"<<std::endl; 
     160      // fs << "    </style>"<<std::endl; 
     161      // fs << "</head>"<<std::endl; 
     162      // fs << "<body>"<<std::endl; 
     163      // fs << "<div id=\"mynetwork\"></div>"<<std::endl<<std::endl; 
     164      // fs << "<script type=\"text/javascript\">"<<std::endl; 
     165 
     166      // fs << "    var nodes = new vis.DataSet(["<<std::endl; 
     167      // for(int i=0; i<CWorkflowGraph::filters.size(); i++) 
     168      // { 
     169      //   StdString color_table[7] = {"black", "red", "blue", "green", "purple", "yellow", "gray"}; 
     170 
     171      //   fs << "        {id: "<<i+1<<", label: \'"<<CWorkflowGraph::filters[i]<<"\', title: \'"<<"Show more information about this filter"<<"\'"; 
     172      //   fs <<", color: \'"<<color_table[(*CWorkflowGraph::mapFilters_ptr_with_info)[i].filter_class]<<"\'},"<<std::endl  ; 
     173      // } 
     174      // fs << "    ]);"<<std::endl<<std::endl; 
     175 
     176 
     177      // fs << "    var edges = new vis.DataSet(["<<std::endl; 
     178      // for(int i=0; i<CWorkflowGraph::fieldsToFilters.size(); i++) 
     179      // { 
     180      //   fs <<"        {from: "<<CWorkflowGraph::fieldsToFilters[i].first+1<<", to: "<<CWorkflowGraph::fieldsToFilters[i].second+1<<", label: \'"<<CWorkflowGraph::fields[i]<<"\', title: \'"<<"Show more information about this field"<<"\'},"<<std::endl  ; 
     181      // } 
     182      // fs << "    ]);"<<std::endl<<std::endl; 
    149183 
    150184   
    151       fs << "    var container = document.getElementById(\'mynetwork\');" <<std::endl<<std::endl; 
    152       fs << "    var data = {" <<std::endl; 
    153       fs << "        nodes: nodes," <<std::endl; 
    154       fs << "        edges: edges" <<std::endl; 
    155       fs << "    };" <<std::endl; 
    156       fs << "    var options = {"<<std::endl; 
    157       fs << "        edges:{"<<std::endl; 
    158       fs << "            smooth: false,"<<std::endl; 
    159       fs << "            arrows: \'to\',"<<std::endl; 
    160       fs << "            color: 'red',"<<std::endl; 
    161       fs << "            font:{align: \'middle\'},"<<std::endl; 
    162       fs << "        },"<<std::endl; 
    163       fs << "        physics:{"<<std::endl; 
    164       fs << "            enabled: false,"<<std::endl; 
    165       fs << "        },"<<std::endl; 
    166       fs << "};" <<std::endl<<std::endl; 
    167  
    168       fs << "    var network = new vis.Network(container, data, options);" <<std::endl<<std::endl; 
    169  
    170       fs << "</script>"<<std::endl; 
    171       fs << "</body>"<<std::endl; 
    172       fs << "</html>"<<std::endl; 
     185      // fs << "    var container = document.getElementById(\'mynetwork\');" <<std::endl<<std::endl; 
     186      // fs << "    var data = {" <<std::endl; 
     187      // fs << "        nodes: nodes," <<std::endl; 
     188      // fs << "        edges: edges" <<std::endl; 
     189      // fs << "    };" <<std::endl; 
     190      // fs << "    var options = {"<<std::endl; 
     191      // fs << "        edges:{"<<std::endl; 
     192      // fs << "            smooth: false,"<<std::endl; 
     193      // fs << "            arrows: \'to\',"<<std::endl; 
     194      // fs << "            color: 'red',"<<std::endl; 
     195      // fs << "            font:{align: \'middle\'},"<<std::endl; 
     196      // fs << "        },"<<std::endl; 
     197      // fs << "        physics:{"<<std::endl; 
     198      // fs << "            enabled: false,"<<std::endl; 
     199      // fs << "        },"<<std::endl; 
     200      // fs << "};" <<std::endl<<std::endl; 
     201 
     202      // fs << "    var network = new vis.Network(container, data, options);" <<std::endl<<std::endl; 
     203 
     204      // fs << "</script>"<<std::endl; 
     205      // fs << "</body>"<<std::endl; 
     206      // fs << "</html>"<<std::endl; 
    173207 
    174208       
    175209 
    176       fs.close(); 
     210      // fs.close(); 
    177211          
    178212    } 
  • XIOS/dev/dev_trunk_omp/src/node/field.cpp

    r1679 r1680  
    922922   TRY 
    923923   { 
     924 
    924925     CContext* context = CContext::getCurrent(); 
    925926     bool hasClient = context->hasClient; 
     
    12001201           { 
    12011202             CField* fieldRef = CField::get(field_ref); 
    1202              fieldRef->build_workflow_graph.setValue(buildWorkflowGraph); 
    12031203             CGrid* gridRef = fieldRef->grid; 
    12041204 
     
    12361236         else if (!field_ref.isEmpty()) 
    12371237         { 
    1238            CField::get(field_ref)->build_workflow_graph.setValue(buildWorkflowGraph); 
    12391238           instantDataFilter = getFieldReference(gc); 
    12401239           instantDataFilter->tag = buildWorkflowGraph; 
     
    12971296           fileWriterFilter->end_graph = filter_end; 
    12981297 
    1299            std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<std::endl; 
     1298           // std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<" field = "<<this->getId()<<std::endl; 
    13001299 
    13011300         } 
     
    13681367       filters.second->parent_filters[0]= fieldRef->getInstantDataFilter(); 
    13691368 
    1370        filters.second->tag = buildWorkflowGraph || filters.second->parent_filters[0]->tag; 
     1369       filters.second->tag = (buildWorkflowGraph || filters.second->parent_filters[0]->tag); 
    13711370 
    13721371       filters.second->start_graph = filter_start; 
     
    15281527 
    15291528       const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true); 
    1530        bool buildWorkflowGraph = buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 
     1529       bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 
    15311530       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
    15321531                                                                           CContext::getCurrent()->getCalendar()->getInitDate(), 
  • XIOS/dev/dev_trunk_omp/src/parse_expr/filter_expr_node.cpp

    r1677 r1680  
    106106  std::shared_ptr<COutputPin> CFilterUnaryOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    107107  { 
     108    std::shared_ptr<COutputPin> ch = child->reduce(gc, thisField); 
     109 
    108110    std::shared_ptr<CUnaryArithmeticFilter> filter(new CUnaryArithmeticFilter(gc, opId)); 
    109     child->reduce(gc, thisField)->connectOutput(filter, 0); 
    110  
    111     (filter->parent_filters).resize(1); 
    112     (filter->parent_filters)[0] = child->reduce(gc, thisField); 
     111    ch->connectOutput(filter, 0); 
     112 
     113    (filter->parent_filters).resize(1); 
     114    (filter->parent_filters)[0] = ch; 
     115 
     116    filter->tag = ch->tag; 
     117    filter->start_graph = ch->start_graph; 
     118    filter->end_graph = ch->end_graph; 
     119    filter->field = &thisField; 
     120 
    113121 
    114122    return filter; 
     
    127135  std::shared_ptr<COutputPin> CFilterScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    128136  { 
     137    std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 
    129138    std::shared_ptr<CScalarFieldArithmeticFilter> filter(new CScalarFieldArithmeticFilter(gc, opId, child1->reduce())); 
    130     child2->reduce(gc, thisField)->connectOutput(filter, 0); 
     139    ch2->connectOutput(filter, 0); 
    131140     
    132141    (filter->parent_filters).resize(1); 
    133     (filter->parent_filters)[0] = child2->reduce(gc, thisField); 
     142    (filter->parent_filters)[0] = ch2; 
     143 
     144    filter->tag = ch2->tag; 
     145    filter->start_graph = ch2->start_graph; 
     146    filter->end_graph = ch2->end_graph; 
     147    filter->field = &thisField; 
    134148 
    135149    return filter; 
     
    148162  std::shared_ptr<COutputPin> CFilterFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    149163  { 
     164    std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 
     165 
    150166    std::shared_ptr<CFieldScalarArithmeticFilter> filter(new CFieldScalarArithmeticFilter(gc, opId, child2->reduce())); 
    151     child1->reduce(gc, thisField)->connectOutput(filter, 0); 
    152  
    153     (filter->parent_filters).resize(1); 
    154     (filter->parent_filters)[0] = child1->reduce(gc, thisField); 
     167    ch1->connectOutput(filter, 0); 
     168 
     169    (filter->parent_filters).resize(1); 
     170    (filter->parent_filters)[0] = ch1; 
     171 
     172    filter->tag = ch1->tag; 
     173    filter->start_graph = ch1->start_graph; 
     174    filter->end_graph = ch1->end_graph; 
     175    filter->field = &thisField; 
     176 
    155177    return filter; 
    156178  } 
     
    168190  std::shared_ptr<COutputPin> CFilterFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    169191  { 
     192    std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 
     193    std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 
     194 
    170195    std::shared_ptr<CFieldFieldArithmeticFilter> filter(new CFieldFieldArithmeticFilter(gc, opId)); 
    171     child1->reduce(gc, thisField)->connectOutput(filter, 0); 
    172     child2->reduce(gc, thisField)->connectOutput(filter, 1);  
     196    ch1->connectOutput(filter, 0); 
     197    ch2->connectOutput(filter, 1);  
    173198 
    174199    (filter->parent_filters).resize(2); 
    175     (filter->parent_filters)[0] = child1->reduce(gc, thisField); 
    176     (filter->parent_filters)[1] = child2->reduce(gc, thisField); 
     200    (filter->parent_filters)[0] = ch1; 
     201    (filter->parent_filters)[1] = ch2; 
     202 
     203    filter->tag = (ch1->tag || ch2->tag); 
     204    filter->start_graph = ch1->tag? ch1->start_graph : (ch2->tag? ch2->start_graph: -1); 
     205    filter->end_graph = ch1->tag? ch1->end_graph : (ch2->tag? ch2->end_graph: -1); 
     206    filter->field = &thisField; 
     207 
     208 
    177209    return filter; 
    178210  } 
     
    194226  std::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    195227  { 
     228    std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 
     229 
    196230    std::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); 
    197     child3->reduce(gc, thisField)->connectOutput(filter, 0); 
     231    ch3->connectOutput(filter, 0); 
    198232     
    199233    (filter->parent_filters).resize(1); 
    200     (filter->parent_filters)[0] = child3->reduce(gc, thisField); 
     234    (filter->parent_filters)[0] = ch3; 
     235 
     236    filter->tag = ch3->tag; 
     237    filter->start_graph = ch3->start_graph; 
     238    filter->end_graph = ch3->end_graph; 
     239    filter->field = &thisField; 
    201240 
    202241    return filter; 
     
    217256  std::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    218257  { 
     258    std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 
     259 
    219260    std::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); 
    220     child2->reduce(gc, thisField)->connectOutput(filter, 0); 
    221  
    222     (filter->parent_filters).resize(1); 
    223     (filter->parent_filters)[0] = child2->reduce(gc, thisField); 
     261    ch2->connectOutput(filter, 0); 
     262 
     263    (filter->parent_filters).resize(1); 
     264    (filter->parent_filters)[0] = ch2; 
     265 
     266    filter->tag = ch2->tag; 
     267    filter->start_graph = ch2->start_graph; 
     268    filter->end_graph = ch2->end_graph; 
     269    filter->field = &thisField; 
     270 
    224271    return filter; 
    225272  } 
     
    239286  std::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    240287  { 
     288    std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 
     289    std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 
     290 
    241291    std::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce())); 
    242     child2->reduce(gc, thisField)->connectOutput(filter, 0); 
    243     child3->reduce(gc, thisField)->connectOutput(filter, 1); 
     292    ch2->connectOutput(filter, 0); 
     293    ch3->connectOutput(filter, 1); 
    244294 
    245295    (filter->parent_filters).resize(2); 
    246     (filter->parent_filters)[0] = child2->reduce(gc, thisField); 
    247     (filter->parent_filters)[1] = child3->reduce(gc, thisField); 
     296    (filter->parent_filters)[0] = ch2; 
     297    (filter->parent_filters)[1] = ch3; 
     298 
     299    filter->tag = (ch3->tag || ch2->tag); 
     300    filter->start_graph = ch3->tag? ch3->start_graph : (ch2->tag? ch2->start_graph: -1); 
     301    filter->end_graph = ch3->tag? ch3->end_graph : (ch2->tag? ch2->end_graph: -1); 
     302    filter->field = &thisField; 
    248303 
    249304    return filter; 
     
    265320  std::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    266321  { 
     322    std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 
     323 
    267324    std::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); 
    268     child1->reduce(gc, thisField)->connectOutput(filter, 0); 
    269  
    270     (filter->parent_filters).resize(1); 
    271     (filter->parent_filters)[0] = child1->reduce(gc, thisField); 
     325    ch1->connectOutput(filter, 0); 
     326 
     327    (filter->parent_filters).resize(1); 
     328    (filter->parent_filters)[0] = ch1; 
     329 
     330    filter->tag = ch1->tag; 
     331    filter->start_graph = ch1->start_graph; 
     332    filter->end_graph = ch1->end_graph; 
     333    filter->field = &thisField; 
     334 
    272335    return filter; 
    273336  } 
     
    288351  std::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    289352  { 
     353    std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 
     354    std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 
     355 
    290356    std::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce())); 
    291     child1->reduce(gc, thisField)->connectOutput(filter, 0); 
    292     child3->reduce(gc, thisField)->connectOutput(filter, 1); 
     357    ch1->connectOutput(filter, 0); 
     358    ch3->connectOutput(filter, 1); 
    293359 
    294360    (filter->parent_filters).resize(2); 
    295     (filter->parent_filters)[0] = child1->reduce(gc, thisField); 
    296     (filter->parent_filters)[1] = child3->reduce(gc, thisField); 
     361    (filter->parent_filters)[0] = ch1; 
     362    (filter->parent_filters)[1] = ch3; 
     363 
     364    filter->tag = (ch3->tag || ch1->tag); 
     365    filter->start_graph = ch3->tag? ch3->start_graph : (ch1->tag? ch1->start_graph: -1); 
     366    filter->end_graph = ch3->tag? ch3->end_graph : (ch1->tag? ch1->end_graph: -1); 
     367    filter->field = &thisField; 
    297368 
    298369    return filter; 
     
    314385  std::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    315386  { 
     387    std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 
     388    std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 
     389 
    316390    std::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce())); 
    317     child1->reduce(gc, thisField)->connectOutput(filter, 0); 
    318     child2->reduce(gc, thisField)->connectOutput(filter, 1); 
     391    ch1->connectOutput(filter, 0); 
     392    ch2->connectOutput(filter, 1); 
    319393 
    320394    (filter->parent_filters).resize(2); 
    321     (filter->parent_filters)[0] = child1->reduce(gc, thisField); 
    322     (filter->parent_filters)[1] = child2->reduce(gc, thisField); 
     395    (filter->parent_filters)[0] = ch1; 
     396    (filter->parent_filters)[1] = ch2; 
     397 
     398    filter->tag = (ch2->tag || ch1->tag); 
     399    filter->start_graph = ch2->tag? ch2->start_graph : (ch1->tag? ch1->start_graph: -1); 
     400    filter->end_graph = ch2->tag? ch2->end_graph : (ch1->tag? ch1->end_graph: -1); 
     401    filter->field = &thisField; 
    323402    return filter; 
    324403  } 
     
    338417  std::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 
    339418  { 
     419    std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 
     420    std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 
     421    std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 
     422 
    340423    std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId)); 
    341     child1->reduce(gc, thisField)->connectOutput(filter, 0); 
    342     child2->reduce(gc, thisField)->connectOutput(filter, 1); 
    343     child3->reduce(gc, thisField)->connectOutput(filter, 2); 
     424    std::cout<<"std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId))" <<std::endl; 
     425    ch1->connectOutput(filter, 0); 
     426    ch2->connectOutput(filter, 1); 
     427    ch3->connectOutput(filter, 2); 
    344428 
    345429    (filter->parent_filters).resize(3); 
    346     (filter->parent_filters)[0] = child1->reduce(gc, thisField); 
    347     (filter->parent_filters)[1] = child2->reduce(gc, thisField); 
    348     (filter->parent_filters)[2] = child3->reduce(gc, thisField); 
     430    (filter->parent_filters)[0] = ch1; 
     431    (filter->parent_filters)[1] = ch2; 
     432    (filter->parent_filters)[2] = ch3; 
     433 
     434 
     435    filter->tag = (ch1->tag || ch1->tag || ch3->tag); 
     436    filter->start_graph = ch1->tag? ch1->start_graph : (ch2->tag? ch2->start_graph: (ch3->tag? ch3->start_graph: -1)); 
     437    filter->end_graph = ch1->tag? ch1->end_graph : (ch2->tag? ch2->end_graph: (ch3->tag? ch3->end_graph: -1)); 
     438    filter->field = &thisField; 
     439 
    349440 
    350441    return filter; 
  • XIOS/dev/dev_trunk_omp/src/parse_expr/yacc_parser.cpp

    r1601 r1680  
    7070#include "exception.hpp" 
    7171 
     72#include "yacc_var.hpp" 
     73 
    7274using namespace std; 
    7375using namespace xios; 
     
    8688  #pragma omp threadprivate(parsed, globalInputText_ptr, globalReadOffset) 
    8789 
     90   
     91  std::string *xios::yacc_globalInputText_ptr = 0; 
     92  // #pragma omp threadprivate(xios::yacc_globalInputText_ptr) 
     93 
    8894  int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead) 
    8995  { 
     96    yacc_globalInputText_ptr = globalInputText_ptr; 
     97 
     98    std::cout<<"========= yacc_globalInputText_ptr = "<<*yacc_globalInputText_ptr<<std::endl; 
    9099    if(globalInputText_ptr == 0) globalInputText_ptr = new std::string; 
    91100    size_t numBytesToRead = maxBytesToRead; 
  • XIOS/dev/dev_trunk_omp/src/parse_expr/yacc_parser.hpp

    r1158 r1680  
    9292int yyparse (void); 
    9393 
     94 
    9495#endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED  */ 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_duplicate_scalar.hpp

    r1314 r1680  
    3333  static bool registerTrans(); 
    3434 
     35  virtual StdString getName() {return "Axis Trans. Filter \\n Duplicate Scalar";} 
     36 
    3537protected: 
    3638  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_extract.hpp

    r1558 r1680  
    2727 
    2828  static bool registerTrans(); 
     29 
     30  virtual StdString getName() {return "Axis Trans. Filter \\n Extract";} 
     31 
    2932protected: 
    3033  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_extract_domain.hpp

    r1601 r1680  
    4040 
    4141  static bool registerTrans(); 
     42 
     43  virtual StdString getName() {return "Axis Trans. Filter \\n Extract Domain";} 
     44 
    4245protected: 
    4346  enum ExtractDirection { 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_interpolate.hpp

    r933 r1680  
    3232 
    3333  static bool registerTrans(); 
     34 
     35  virtual StdString getName() {return "Axis Trans. Filter \\n Interpolation";} 
     36 
    3437protected: 
    3538  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_inverse.hpp

    r933 r1680  
    3131  static bool registerTrans(); 
    3232 
     33  virtual StdString getName() {return "Axis Trans. Filter \\n Inverse";} 
     34 
    3335protected: 
    3436  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_axis.hpp

    r1601 r1680  
    4040 
    4141  static bool registerTrans(); 
     42 
     43  virtual StdString getName() {return "Axis Trans. Filter \\n Reduce Axis";} 
    4244protected: 
    4345   
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_domain.hpp

    r1601 r1680  
    4141 
    4242  static bool registerTrans(); 
     43 
     44  virtual StdString getName() {return "Axis Trans. Filter \\n Reduce Domain";} 
     45 
    4346protected: 
    4447  enum ReduceDirection { 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_temporal_splitting.hpp

    r1275 r1680  
    3434  static bool registerTrans(); 
    3535 
     36  virtual StdString getName() {return "Axis Trans. Filter \\n Temporal Splitting";} 
     37 
    3638protected: 
    3739  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_transformation.hpp

    r1275 r1680  
    3131  virtual ~CAxisAlgorithmTransformation(); 
    3232 
     33  virtual StdString getName() {return "Axis Trans. Filter \\n Transformation";} 
     34 
    3335protected: 
    3436  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_zoom.hpp

    r1559 r1680  
    2727 
    2828  static bool registerTrans(); 
     29 
     30  virtual StdString getName() {return "Axis Trans. Filter \\n Zoom";} 
     31 
    2932protected: 
    3033  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_compute_connectivity.hpp

    r944 r1680  
    2828 
    2929  static bool registerTrans(); 
     30 
     31  virtual StdString getName() {return "Domain Trans. Filter \\n Compute Connectivity";} 
     32 
    3033protected: 
    3134  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_expand.hpp

    r1158 r1680  
    2828 
    2929  static bool registerTrans(); 
     30 
     31  virtual StdString getName() {return "Domain Trans. Filter \\n Expand";} 
    3032 
    3133protected: 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_extract.hpp

    r1549 r1680  
    2323 
    2424  static bool registerTrans(); 
     25 
     26  virtual StdString getName() {return "Domain Trans. Filter \\n Extract";} 
    2527protected: 
    2628  void updateDomainAttributes(); 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_generate_rectilinear.hpp

    r1410 r1680  
    3333  virtual ~CDomainAlgorithmGenerateRectilinear() {} 
    3434 
     35  virtual StdString getName() {return "Domain Trans. Filter \\n Generate Rectilinear";} 
     36 
    3537protected: 
    3638  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.hpp

    r1601 r1680  
    3939 
    4040  static bool registerTrans(); 
     41 
     42  virtual StdString getName() {return "Domain Trans. Filter \\n Interpolation";} 
     43 
    4144protected: 
    4245  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_reorder.hpp

    r1457 r1680  
    2626  static bool registerTrans(); 
    2727 
     28  virtual StdString getName() {return "Domain Trans. Filter \\n Reorder";} 
     29 
    2830protected: 
    2931  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_transformation.hpp

    r888 r1680  
    2727  virtual ~CDomainAlgorithmTransformation(); 
    2828 
     29  virtual StdString getName() {return "Domain Trans. Filter \\n Transformation";} 
     30 
    2931protected: 
    3032  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&); 
  • XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_zoom.hpp

    r1553 r1680  
    2323 
    2424  static bool registerTrans(); 
     25 
     26  virtual StdString getName() {return "Domain Trans. Filter \\n Zoom";} 
    2527protected: 
    2628  void updateDomainAttributes(); 
  • XIOS/dev/dev_trunk_omp/src/transformation/generic_algorithm_transformation.hpp

    r1679 r1680  
    7474                     bool ignoreMissingValue, bool firstPass); 
    7575 
    76   virtual StdString getName() {return "Generic algorithm transformation";} 
     76  virtual StdString getName() {return "Generic Trans. Filter";} 
    7777 
    7878  /*! 
  • XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_extract_axis.hpp

    r1601 r1680  
    4040  static bool registerTrans(); 
    4141 
     42  virtual StdString getName() {return "Scalar Trans. Filter \\n Extract Axis";} 
     43 
    4244protected: 
    4345  int pos_; 
  • XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_axis.hpp

    r1601 r1680  
    4141 
    4242  static bool registerTrans(); 
     43 
     44  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Axis";} 
     45 
    4346protected: 
    4447  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_domain.hpp

    r1601 r1680  
    4141 
    4242  static bool registerTrans(); 
     43 
     44  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Domain";} 
     45 
    4346protected: 
    4447  bool local ; 
  • XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_scalar.hpp

    r1601 r1680  
    3636 
    3737  static bool registerTrans(); 
     38 
     39  virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Scalar";} 
     40 
    3841protected: 
    3942  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_transformation.hpp

    r888 r1680  
    3131  virtual ~CScalarAlgorithmTransformation(); 
    3232 
     33  virtual StdString getName() {return "Scalar Trans. Filter \\n Transformation";} 
     34 
    3335protected: 
    3436  void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); 
  • XIOS/dev/dev_trunk_omp/src/workflow_graph.cpp

    r1679 r1680  
    99  std::unordered_map <int, graph_info_box_edge > *CWorkflowGraph::mapFieldToFilters_ptr_with_info = 0; 
    1010  #pragma omp threadprivate(CWorkflowGraph::mapFieldToFilters_ptr_with_info) 
     11 
     12  std::unordered_map <size_t, int> *CWorkflowGraph::mapHashFilterID_ptr = 0; 
     13  #pragma omp threadprivate(CWorkflowGraph::mapHashFilterID_ptr) 
    1114 
    1215 
     
    121124 
    122125 
     126  void CWorkflowGraph::addNode(int nodeID, StdString filterName, int filterClass, bool filterFilled, int entry_nb, CDataPacketPtr packet) 
     127  TRY 
     128  { 
     129    (*mapFilters_ptr_with_info)[nodeID].filter_name = filterName; 
     130    (*mapFilters_ptr_with_info)[nodeID].filter_class = filterClass; 
     131    (*mapFilters_ptr_with_info)[nodeID].filter_filled = filterFilled; 
     132    (*mapFilters_ptr_with_info)[nodeID].expected_entry_nb = entry_nb; 
     133    (*mapFilters_ptr_with_info)[nodeID].date = packet->date; 
     134    (*mapFilters_ptr_with_info)[nodeID].timestamp = packet->timestamp; 
     135  } 
     136  CATCH 
     137 
     138 
     139 
    123140  void CWorkflowGraph::addEdge(int edgeID, int toID, CDataPacketPtr packet) 
    124141  TRY 
     
    131148    (*mapFieldToFilters_ptr_with_info)[edgeID].date = packet->date; 
    132149    (*mapFieldToFilters_ptr_with_info)[edgeID].timestamp = packet->timestamp; 
     150    (*mapFieldToFilters_ptr_with_info)[edgeID].field = packet->field; 
     151    (*mapFieldToFilters_ptr_with_info)[edgeID].attributes = packet->field->recordXiosAttributes(); 
     152  } 
     153  CATCH 
     154 
     155 
     156  void CWorkflowGraph::allocNodeEdge() 
     157  TRY 
     158  { 
     159    if(mapFilters_ptr_with_info==0) mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 
     160    if(mapFieldToFilters_ptr_with_info==0) mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 
     161    if(mapHashFilterID_ptr==0) mapHashFilterID_ptr = new std::unordered_map <size_t, int >; 
    133162  } 
    134163  CATCH 
  • XIOS/dev/dev_trunk_omp/src/workflow_graph.hpp

    r1679 r1680  
    1212namespace xios 
    1313{ 
     14  class CField; 
    1415 
    1516  struct graph_info_box_node 
     
    2324    Time timestamp; 
    2425    StdString transform_type; 
     26    StdString attributes; 
     27    StdString field_id; 
     28    bool inputs_complete; 
     29    int filter_tag; 
     30    int clusterID; 
    2531  }; 
    2632 
     
    3440    CDate date; 
    3541    Time timestamp; 
     42    CField *field; 
     43    StdString attributes; 
    3644     
    3745  }; 
     
    6068      #pragma omp threadprivate(mapFieldToFilters_ptr_with_info) 
    6169 
     70      static std::unordered_map <size_t, int> *mapHashFilterID_ptr; 
     71      #pragma omp threadprivate(mapHashFilterID_ptr) 
     72 
    6273 
    6374      static bool build_begin; 
    6475      #pragma omp threadprivate(build_begin) 
    6576 
     77      static void addNode(int nodeID, StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet); 
    6678      static void addEdge(int edgeID, int toID, CDataPacketPtr packet); 
     79      static void allocNodeEdge(); 
    6780 
    6881    private: 
Note: See TracChangeset for help on using the changeset viewer.