Ignore:
Timestamp:
07/08/19 16:58:12 (5 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/src/parse_expr
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • 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  */ 
Note: See TracChangeset for help on using the changeset viewer.