Changeset 1876 for XIOS/trunk/src/filter
- Timestamp:
- 05/12/20 16:36:29 (4 years ago)
- Location:
- XIOS/trunk/src/filter
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/filter/binary_arithmetic_filter.cpp
r1768 r1876 11 11 , op(operatorExpr.getOpScalarField(op)) 12 12 , value(value) 13 { 14 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 15 }; 13 { }; 16 14 17 15 std::tuple<int, int, int> CScalarFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) … … 25 23 CWorkflowGraph::allocNodeEdge(); 26 24 27 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());25 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 28 26 29 27 // first round … … 34 32 int edgeID = InvalidableObject::edgeIdGenerator++; 35 33 36 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);34 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 37 35 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 38 36 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 99 97 , op(operatorExpr.getOpFieldScalar(op)) 100 98 , value(value) 101 { 102 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 103 }; 99 { }; 104 100 105 101 std::tuple<int, int, int> CFieldScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 106 102 { 107 103 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 108 // bool building_graph = true;109 104 int unique_filter_id; 110 105 bool firstround; … … 114 109 CWorkflowGraph::allocNodeEdge(); 115 110 116 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());111 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 117 112 118 113 // first round … … 123 118 int edgeID = InvalidableObject::edgeIdGenerator++; 124 119 125 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);120 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 126 121 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 127 122 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 171 166 std::tuple<int, int, int> graph = buildGraph(data); 172 167 173 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 174 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 175 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 176 168 if(std::get<0>(graph)) 169 { 170 packet->src_filterID = std::get<2>(graph); 171 if(std::get<1>(graph)) packet->distance = data[0]->distance+1; 172 else packet->distance = data[0]->distance+1; 173 } 174 177 175 packet->field = this->field; 178 176 … … 186 184 : CFilter(gc, 2, this) 187 185 , op(operatorExpr.getOpFieldField(op)) 188 { 189 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 190 }; 186 { }; 191 187 192 188 std::tuple<int, int, int> CFieldFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) … … 202 198 CWorkflowGraph::allocNodeEdge(); 203 199 204 // std::cout<<"CFieldFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 205 206 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 200 201 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 207 202 208 203 // first round … … 213 208 int edgeID = InvalidableObject::edgeIdGenerator++; 214 209 215 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);210 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 216 211 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 217 212 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 251 246 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 252 247 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 248 data[0]->distance=max(data[0]->distance, (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].distance); 253 249 } 254 250 if(data[1]->src_filterID != unique_filter_id) … … 258 254 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 259 255 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 256 data[1]->distance=max(data[1]->distance, (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].distance); 260 257 } 261 258 … … 275 272 276 273 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 277 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1;278 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance;274 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = max(data[0]->distance+1, data[1]->distance+1); 275 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = max(data[0]->distance, data[1]->distance); 279 276 280 277 packet->field = this->field; -
XIOS/trunk/src/filter/data_packet.hpp
r1704 r1876 27 27 Time timestamp; //!< Timestamp of the data 28 28 StatusCode status; //!< Status of the packet 29 int src_filterID ;29 int src_filterID=0; 30 30 std::vector<int> filterIDoutputs; 31 CField *field ;32 int distance ;31 CField *field=nullptr; 32 int distance=-1; 33 33 34 34 /*! -
XIOS/trunk/src/filter/source_filter.cpp
r1704 r1876 27 27 void CSourceFilter::buildGraph(CDataPacketPtr packet) 28 28 { 29 bool building_graph = this->tag ? packet->timestamp >= this->field->field_graph_start && packet->timestamp <= this->field->field_graph_end : false; 29 bool filter_interval=false; 30 if (this->field) 31 { 32 if(this->field->field_graph_start == -1 && this->field->field_graph_end == -1) filter_interval = true; 33 else filter_interval = packet->timestamp >= this->field->field_graph_start && packet->timestamp <= this->field->field_graph_end; 34 } 35 bool building_graph = this->tag ? filter_interval : false; 30 36 if(building_graph) 31 37 { -
XIOS/trunk/src/filter/temporal_filter.cpp
r1704 r1876 85 85 bool BG = buildGraph(data); 86 86 87 CDataPacketPtr packet ;87 CDataPacketPtr packet=0; 88 88 89 89 if (data[0]->status != CDataPacket::END_OF_STREAM) -
XIOS/trunk/src/filter/ternary_arithmetic_filter.cpp
r1768 r1876 12 12 , value2(value2) 13 13 { 14 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1);15 14 /* Nothing to do */ 16 15 }; … … 26 25 CWorkflowGraph::allocNodeEdge(); 27 26 28 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());27 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 29 28 30 29 // first round … … 35 34 int edgeID = InvalidableObject::edgeIdGenerator++; 36 35 37 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);36 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 38 37 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 39 38 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 101 100 , value2(value2) 102 101 { 103 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1);104 102 /* Nothing to do */ 105 103 }; … … 115 113 CWorkflowGraph::allocNodeEdge(); 116 114 117 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());115 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 118 116 119 117 // first round … … 124 122 int edgeID = InvalidableObject::edgeIdGenerator++; 125 123 126 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);124 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 127 125 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 128 126 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 189 187 , value(value) 190 188 { 191 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1);192 189 /* Nothing to do */ 193 190 }; … … 204 201 CWorkflowGraph::allocNodeEdge(); 205 202 206 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());203 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 207 204 208 205 // first round … … 213 210 int edgeID = InvalidableObject::edgeIdGenerator++; 214 211 215 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);212 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 216 213 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 217 214 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 301 298 , value2(value2) 302 299 { 303 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1);304 300 /* Nothing to do */ 305 301 }; … … 315 311 CWorkflowGraph::allocNodeEdge(); 316 312 317 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());313 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 318 314 319 315 // first round … … 324 320 int edgeID = InvalidableObject::edgeIdGenerator++; 325 321 326 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);322 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 327 323 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 328 324 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 390 386 , value(value) 391 387 { 392 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1);393 388 /* Nothing to do */ 394 389 }; … … 405 400 CWorkflowGraph::allocNodeEdge(); 406 401 407 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());402 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 408 403 409 404 // first round … … 414 409 int edgeID = InvalidableObject::edgeIdGenerator++; 415 410 416 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);411 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 417 412 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 418 413 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 499 494 , value(value) 500 495 { 501 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1);502 496 /* Nothing to do */ 503 497 }; … … 514 508 CWorkflowGraph::allocNodeEdge(); 515 509 516 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());510 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 517 511 518 512 // first round … … 523 517 int edgeID = InvalidableObject::edgeIdGenerator++; 524 518 525 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);519 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 526 520 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 527 521 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; … … 608 602 , op(operatorExpr.getOpFieldFieldField(op)) 609 603 { 610 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1);611 604 /* Nothing to do */ 612 605 }; … … 623 616 CWorkflowGraph::allocNodeEdge(); 624 617 625 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());618 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 626 619 627 620 // first round … … 632 625 int edgeID = InvalidableObject::edgeIdGenerator++; 633 626 634 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+ expression+")", 3, 1, 0, data[0]);627 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 635 628 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 636 629 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; -
XIOS/trunk/src/filter/unary_arithmetic_filter.cpp
r1704 r1876 9 9 : CFilter(gc, 1, this) 10 10 , op(operatorExpr.getOpField(op)) 11 { 12 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 13 }; 11 { }; 14 12 15 13 std::tuple<int, int, int> CUnaryArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) … … 22 20 { 23 21 CWorkflowGraph::allocNodeEdge(); 24 size_t filterhash = std::hash<StdString>{}( expression+to_string(data[0]->timestamp)+this->field->getId());22 size_t filterhash = std::hash<StdString>{}(this->field->content+to_string(data[0]->timestamp)+this->field->getId()); 25 23 26 24 // first round … … 30 28 this->filterID = InvalidableObject::filterIdGenerator++; 31 29 int edgeID = InvalidableObject::edgeIdGenerator++; 32 33 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 30 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+this->field->content+")", 3, 1, 0, data[0]); 34 31 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 35 32 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1;
Note: See TracChangeset
for help on using the changeset viewer.