Changeset 1681
- Timestamp:
- 07/19/19 15:28:33 (6 years ago)
- Location:
- XIOS/dev/dev_trunk_omp
- Files:
-
- 1 added
- 42 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/inputs/iodef.xml
r1680 r1681 7 7 8 8 <field_definition level="1" enabled=".TRUE."> 9 <field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A" build_workflow_graph=".FALSE."/>9 <field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A" /> 10 10 <field id="field_B" operation="average" freq_op="3600s" grid_ref="grid_A"/> 11 <field id="field_C" operation="average" freq_op="3600s" grid_ref="grid_A" />11 <field id="field_C" operation="average" freq_op="3600s" grid_ref="grid_A" /> 12 12 <field id="field_Axis" operation="average" freq_op="3600s" axis_ref="axis_A"/> 13 13 <field id="field_Domain" operation="average" freq_op="3600s" domain_ref="domain_A"/> … … 18 18 19 19 <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" > 20 <file id="output" name="output" enabled=".TRUE."> 20 21 <file id="output2" name="output2" output_freq="4h" enabled=".FALSE."> 22 <field id="field_G" field_ref="field_A" name="field_G_zoom" grid_ref="grid_A_zoom" build_workflow_graph=".TRUE." build_workflow_graph_start="1h" build_workflow_graph_end="8h" /> 23 <!-- <field field_ref="field_Scalar" name="field_A_scalar" build_workflow_graph=".TRUE."/> --> 24 </file> 25 26 27 <file id="output1" name="output1" output_freq="24h" enabled=".TRUE."> 21 28 <!-- <field field_ref="field_Domain" name="field_A" /> --> 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."/> 24 <!-- <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" > 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> 29 <field id="field_F" field_ref="field_A" name="field_24h" grid_ref="grid_A" build_workflow_graph=".TRUE." build_workflow_graph_start="4h" build_workflow_graph_end="24h" /> 30 31 </file> 32 33 <file id="output" name="output" enabled=".TRUE."> 34 <!-- <field field_ref="field_Domain" name="field_A" /> --> 35 <!-- <field field_ref="field_A" name="field_A_name" build_workflow_graph=".FALSE." /> --> 36 <!-- <field field_ref="field_B" name="field_B_name" build_workflow_graph=".FALSE."/> --> 37 <!-- <field field_ref="field_C" name="field_C_name" enabled=".TRUE." /> --> 38 <!-- <field id="field_D" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_D_name" build_workflow_graph_start="1h" build_workflow_graph_end="2h" > sqrt(field_A) </field> --> 39 <field id="field_E" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_E_name" build_workflow_graph_start="1h" build_workflow_graph_end="4h" > field_A + field_B + field_C</field> 27 40 <!-- <field field_ref="field_A_zoom" name="field_B" build_workflow_graph=".TRUE."/> --> 28 41 </file> 29 <file id="output1" name="output1" output_freq="8h" enabled=".TRUE."> 30 <!-- <field field_ref="field_Domain" name="field_A" /> --> 31 <field id="field_F" field_ref="field_A" name="field_A_zoom" grid_ref="grid_A_zoom" build_workflow_graph=".TRUE." /> 32 33 </file> 34 <file id="output2" name="output2" output_freq="4h" enabled=".TRUE."> 35 <field id="field_G" field_ref="field_A" name="field_G_zoom" grid_ref="grid_A_zoom" build_workflow_graph=".TRUE." build_workflow_graph_start="1h" build_workflow_graph_end="4h" /> 36 <!-- <field field_ref="field_Scalar" name="field_A_scalar" build_workflow_graph=".TRUE."/> --> 37 </file> 42 43 38 44 <!-- <file id="output_s" name="output_s" mode="read" > 39 45 <field id="field" name="field_A" grid_ref="grid_Scalar" operation="instant" /> -
XIOS/dev/dev_trunk_omp/src/attribute.hpp
r1680 r1681 42 42 virtual void fromString(const StdString & str) = 0; 43 43 virtual StdString dump(void) const = 0; 44 virtual StdString dump 2(void) const = 0;44 virtual StdString dump4graph(void) const = 0; 45 45 virtual bool isEqual(const CAttribute& ) = 0; 46 46 -
XIOS/dev/dev_trunk_omp/src/attribute_array.hpp
r1680 r1681 56 56 virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 57 57 virtual string dump(void) const { return _dump();} 58 virtual string dump 2(void) const { return _dump2();}58 virtual string dump4graph(void) const { return _dump4graph();} 59 59 60 60 virtual void generateCInterface(ostream& oss,const string& className) ; … … 72 72 StdString _toString(void) const; 73 73 StdString _dump(void) const; 74 StdString _dump 2(void) const;74 StdString _dump4graph(void) const; 75 75 void _fromString(const StdString & str); 76 76 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/dev/dev_trunk_omp/src/attribute_array_impl.hpp
r1680 r1681 139 139 140 140 template <typename T_numtype, int N_rank> 141 StdString CAttributeArray<T_numtype,N_rank>::_dump 2(void) const141 StdString CAttributeArray<T_numtype,N_rank>::_dump4graph(void) const 142 142 { 143 143 StdOStringStream oss; -
XIOS/dev/dev_trunk_omp/src/attribute_enum.hpp
r1680 r1681 63 63 virtual void fromString(const StdString & str) { if (str==resetInheritanceStr) { reset(); _canInherite=false ;} else _fromString(str);} 64 64 virtual StdString dump(void) const { return _toString();} 65 virtual StdString dump 2(void) const { return _dump2();}65 virtual StdString dump4graph(void) const { return _dump4graph();} 66 66 67 67 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} … … 80 80 bool isEqual_(const CAttributeEnum& attr ); 81 81 StdString _toString(void) const; 82 StdString _dump 2(void) const;82 StdString _dump4graph(void) const; 83 83 void _fromString(const StdString & str); 84 84 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/dev/dev_trunk_omp/src/attribute_enum_impl.hpp
r1680 r1681 151 151 152 152 template <class T> 153 StdString CAttributeEnum<T>::_dump 2(void) const153 StdString CAttributeEnum<T>::_dump4graph(void) const 154 154 { 155 155 StdOStringStream oss; -
XIOS/dev/dev_trunk_omp/src/attribute_map.cpp
r1680 r1681 61 61 62 62 63 StdString CAttributeMap::record XiosAttributes(void) const63 StdString CAttributeMap::record4graphXiosAttributes(void) const 64 64 { 65 65 int maxNbChar = 250; … … 74 74 if (str.length() < maxNbChar) 75 75 { 76 str.append(att.second->dump 2());76 str.append(att.second->dump4graph()); 77 77 str.append(" "); 78 78 } -
XIOS/dev/dev_trunk_omp/src/attribute_map.hpp
r1680 r1681 39 39 void clearAllAttributes(void); 40 40 StdString dumpXiosAttributes(void) const; 41 StdString record XiosAttributes(void) const;41 StdString record4graphXiosAttributes(void) const; 42 42 43 43 void clearAttribute(const StdString& key); -
XIOS/dev/dev_trunk_omp/src/attribute_template.hpp
r1680 r1681 74 74 // virtual void fromBinary(StdIStream & is); 75 75 virtual StdString dump(void) const { return _dump();} 76 virtual StdString dump 2(void) const { return _dump2();}76 virtual StdString dump4graph(void) const { return _dump4graph();} 77 77 78 78 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} … … 100 100 StdString _toString(void) const; 101 101 StdString _dump(void) const; 102 StdString _dump 2(void) const;102 StdString _dump4graph(void) const; 103 103 void _fromString(const StdString & str); 104 104 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/dev/dev_trunk_omp/src/attribute_template_impl.hpp
r1680 r1681 212 212 213 213 template <class T> 214 StdString CAttributeTemplate<T>::_dump 2(void) const214 StdString CAttributeTemplate<T>::_dump4graph(void) const 215 215 { 216 216 StdOStringStream oss; -
XIOS/dev/dev_trunk_omp/src/cxios.cpp
r1680 r1681 173 173 delete globalRegistry ; 174 174 175 // CGraphviz::showStaticWorkflowGraph();176 // CGraphviz::buildWorkflowGraphDot();177 175 CGraphviz::buildWorkflowGraphVisjs_with_info(); 178 176 179 // StdString commande_string="dot -Tpdf graph.dot -o graph.pdf";180 // const char* command=commande_string.c_str();181 // system(command);182 177 183 178 -
XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.cpp
r1680 r1681 15 15 }; 16 16 17 CDataPacketPtr CScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data)17 std::tuple<int, int, int> CScalarFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 18 18 { 19 19 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 20 20 // bool building_graph = true; 21 21 int unique_filter_id; 22 bool firstround; 22 23 23 24 if(building_graph) … … 30 31 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 31 32 { 33 firstround = true; 32 34 this->filterID = InvalidableObject::filterIdGenerator++; 33 35 int edgeID = InvalidableObject::edgeIdGenerator++; … … 35 37 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 36 38 (*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(); 39 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 40 41 42 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 43 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 40 44 41 45 … … 55 59 else 56 60 { 61 firstround=false; 57 62 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 58 63 if(data[0]->src_filterID != unique_filter_id) … … 63 68 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 64 69 } 65 66 67 70 } 68 71 } 69 72 73 return std::make_tuple(building_graph, firstround, unique_filter_id); 74 } 75 76 77 CDataPacketPtr CScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 78 { 79 70 80 CDataPacketPtr packet(new CDataPacket); 71 81 packet->date = data[0]->date; 72 82 packet->timestamp = data[0]->timestamp; 73 83 packet->status = data[0]->status; 74 if(building_graph) packet->src_filterID = unique_filter_id; 84 85 std::tuple<int, int, int> graph = buildGraph(data); 86 87 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 88 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 89 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 90 75 91 packet->field = this->field; 76 92 … … 89 105 }; 90 106 91 CDataPacketPtr CFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data)107 std::tuple<int, int, int> CFieldScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 92 108 { 93 109 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 94 110 // bool building_graph = true; 95 111 int unique_filter_id; 112 bool firstround; 96 113 97 114 if(building_graph) … … 104 121 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 105 122 { 123 firstround = true; 106 124 this->filterID = InvalidableObject::filterIdGenerator++; 107 125 int edgeID = InvalidableObject::edgeIdGenerator++; … … 109 127 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 110 128 (*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(); 129 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 130 131 132 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 133 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 114 134 115 135 … … 129 149 else 130 150 { 151 firstround=false; 131 152 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 132 153 if(data[0]->src_filterID != unique_filter_id) … … 137 158 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 138 159 } 139 140 141 160 } 142 161 } 162 163 return std::make_tuple(building_graph, firstround, unique_filter_id); 164 } 165 166 CDataPacketPtr CFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 167 { 143 168 144 169 CDataPacketPtr packet(new CDataPacket); … … 146 171 packet->timestamp = data[0]->timestamp; 147 172 packet->status = data[0]->status; 148 if(building_graph) packet->src_filterID = unique_filter_id; 173 174 std::tuple<int, int, int> graph = buildGraph(data); 175 176 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 177 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 178 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 179 149 180 packet->field = this->field; 150 151 181 152 182 if (packet->status == CDataPacket::NO_ERROR) … … 163 193 }; 164 194 165 CDataPacketPtr CFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data)166 { 167 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph: false;168 // bool building_graph = true; 195 std::tuple<int, int, int> CFieldFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 196 { 197 bool building_graph = this->tag ? ((data[0]->timestamp >= this->field->field_graph_start && data[0]->timestamp <= this->field->field_graph_end) && (data[0]->timestamp == data[1]->timestamp)) : false; 198 169 199 int unique_filter_id; 200 201 bool firstround; 170 202 171 203 if(building_graph) … … 173 205 CWorkflowGraph::allocNodeEdge(); 174 206 175 std::cout<<"CFieldFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl;207 // std::cout<<"CFieldFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 176 208 177 209 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); … … 180 212 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 181 213 { 214 firstround = true; 182 215 this->filterID = InvalidableObject::filterIdGenerator++; 183 216 int edgeID = InvalidableObject::edgeIdGenerator++; 184 217 185 218 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(); 219 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 220 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 221 222 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 188 223 189 224 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; … … 211 246 else 212 247 { 248 firstround = false; 213 249 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 214 250 if(data[0]->src_filterID != unique_filter_id) … … 230 266 } 231 267 268 return std::make_tuple(building_graph, firstround, unique_filter_id); 269 } 270 271 CDataPacketPtr CFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 272 { 232 273 233 274 CDataPacketPtr packet(new CDataPacket); 234 275 packet->date = data[0]->date; 235 276 packet->timestamp = data[0]->timestamp; 236 if(building_graph) packet->src_filterID = unique_filter_id; 277 278 std::tuple<int, int, int> graph = buildGraph(data); 279 280 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 281 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 282 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 283 237 284 packet->field = this->field; 238 285 -
XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.hpp
r1680 r1681 6 6 #include "operator_expr.hpp" 7 7 #include <unordered_map> 8 #include <tuple> 8 9 9 10 namespace xios … … 37 38 */ 38 39 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 40 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 41 42 // CDataPacketPtr virtual buildGraph_post(CDataPacketPtr packet, std::vector<CDataPacketPtr> data); 39 43 }; // class CScalarFieldArithmeticFilter 40 44 … … 67 71 */ 68 72 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 73 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 69 74 }; // class CFieldScalarArithmeticFilter 70 75 … … 95 100 */ 96 101 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 102 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 97 103 }; // class CFieldFieldArithmeticFilter 98 104 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/data_packet.hpp
r1679 r1681 30 30 std::vector<int> filterIDoutputs; 31 31 CField *field; 32 int distance; 32 33 33 34 /*! -
XIOS/dev/dev_trunk_omp/src/filter/file_server_writer_filter.cpp
r1677 r1681 16 16 void CFileServerWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 17 17 { 18 if(CXios::isClient)19 std::cout<<"CFileServerWriterFilter::onInputReady"<<std::endl;20 18 field->writeUpdateData(data[0]->data); 21 19 } -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp
r1680 r1681 19 19 } 20 20 21 void CFileWriterFilter:: onInputReady(std::vector<CDataPacketPtr> data)21 void CFileWriterFilter::buildGraph(std::vector<CDataPacketPtr> data) 22 22 { 23 23 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph: false; … … 29 29 30 30 CWorkflowGraph::allocNodeEdge(); 31 StdString namestring = to_string(this->field->name); 32 namestring.erase(0, 6); 33 namestring.erase(namestring.length()-1, 1); 31 34 32 CWorkflowGraph::addNode(this->filterID, "File Writer Filter\\n("+this->field->file->getId()+".nc)", 6, 0, 1, data[0]);35 CWorkflowGraph::addNode(this->filterID, namestring + "\\n("+this->field->file->getId()+".nc)", 6, 0, 1, data[0]); 33 36 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; 37 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 38 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 39 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].clusterID =1; 40 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance); 39 41 40 42 if(CXios::isClient && CWorkflowGraph::build_begin) … … 47 49 else CWorkflowGraph::build_begin=true; 48 50 } 51 } 52 53 void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 54 { 55 buildGraph(data); 49 56 50 57 const bool detectMissingValue = ( !field->default_value.isEmpty() && -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.hpp
r1679 r1681 21 21 CField* field; //<! The associated field 22 22 int filterID; 23 int distance; 23 24 24 25 /*! … … 47 48 */ 48 49 bool virtual isDataExpected(const CDate& date) const; 49 50 51 50 52 51 … … 59 58 */ 60 59 void virtual onInputReady(std::vector<CDataPacketPtr> data); 60 void virtual buildGraph(std::vector<CDataPacketPtr> data); 61 61 62 62 private: -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp
r1680 r1681 129 129 } 130 130 131 int COutputPin::getDistance() 132 { 133 int distance = 0; 134 // for(int i=0; i<parent_filters.size(); i++) 135 // { 136 // distance = max(distance, parent_filters[i]->getDistance()+1); 137 // } 138 return distance; 139 } 140 131 141 132 142 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.hpp
r1679 r1681 23 23 Time end_graph; 24 24 CField *field; 25 int distance; 25 26 26 27 … … 85 86 86 87 void virtual setParentFiltersTag(); 88 int virtual getDistance(); 87 89 88 90 -
XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp
r1680 r1681 11 11 } 12 12 13 CDataPacketPtr CPassThroughFilter::apply(std::vector<CDataPacketPtr> data)13 void CPassThroughFilter::buildGraph(std::vector<CDataPacketPtr> data) 14 14 { 15 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 15 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 16 // bool building_graph = this->tag ? data[0]->timestamp >= this->field->field_graph_start && data[0]->timestamp <= this->field->field_graph_end : false; 16 17 17 18 if(building_graph) 18 19 { 19 // std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl;20 // std::cout<<"CPassThroughFilter::apply field_id = "<<this->field->getId()<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 20 21 this->filterID = InvalidableObject::filterIdGenerator++; 21 22 int edgeID = InvalidableObject::edgeIdGenerator++; … … 23 24 CWorkflowGraph::allocNodeEdge(); 24 25 25 CWorkflowGraph::addNode(this->filterID, "Pass Through Filter", 2, 1, 1, data[0]); 26 CWorkflowGraph::addNode(this->filterID, "Pass Through Filter\\n("+data[0]->field->getId()+")", 2, 1, 1, data[0]); 27 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance); 26 28 27 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record XiosAttributes();28 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record XiosAttributes();29 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 30 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 29 31 30 32 … … 39 41 40 42 } 43 41 44 data[0]->field = this->field; 42 45 } 43 46 47 CDataPacketPtr CPassThroughFilter::apply(std::vector<CDataPacketPtr> data) 48 { 49 if(CXios::isClient) buildGraph(data); 44 50 return data[0]; 45 51 } -
XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.hpp
r1679 r1681 30 30 */ 31 31 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 32 void virtual buildGraph(std::vector<CDataPacketPtr> data); 32 33 }; // class CPassThroughFilter 33 34 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/source_filter.cpp
r1680 r1681 25 25 } 26 26 27 28 template <int N> 29 void CSourceFilter::streamData(CDate date, const CArray<double, N>& data, const StdString field_id) 27 void CSourceFilter::buildGraph(CDataPacketPtr packet) 30 28 { 31 date = date + offset; // this is a temporary solution, it should be part of a proper temporal filter 32 33 CDataPacketPtr packet(new CDataPacket); 34 packet->date = date; 35 packet->timestamp = date; 36 packet->status = CDataPacket::NO_ERROR; 37 38 packet->data.resize(grid->storeIndex_client.numElements()); 29 bool building_graph = this->tag ? packet->timestamp >= this->field->field_graph_start && packet->timestamp <= this->field->field_graph_end : false; 30 // bool building_graph = this->tag ? packet->timestamp >= this->start_graph && packet->timestamp <= this->end_graph : false; 39 31 40 if (compression) 41 { 42 packet->data = defaultValue; 43 grid->uncompressField(data, packet->data); 44 } 45 else 46 { 47 if (mask) 48 grid->maskField(data, packet->data); 49 else 50 grid->inputField(data, packet->data); 51 } 52 // Convert missing values to NaN 53 if (hasMissingValue) 54 { 55 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 56 const size_t nbData = packet->data.numElements(); 57 for (size_t idx = 0; idx < nbData; ++idx) 58 { 59 if (defaultValue == packet->data(idx)) 60 packet->data(idx) = nanValue; 61 } 62 } 63 64 65 bool building_graph = this->tag ? packet->timestamp >= this->start_graph && packet->timestamp <= this->end_graph : false; 32 // std::cout<<"************************************************source filter 1 : field_id = "<<this->field->getId()<<" this->start_graph = "<<this->start_graph<<" this->end_graph = "<<this->end_graph<<std::endl; 33 // std::cout<<"************************************************source filter 2 : field_id = "<<this->field->getId()<<" this->field->field_graph_start = "<<this->field->field_graph_start<<" this->field->field_graph_end = "<<this->field->field_graph_end<<std::endl; 66 34 67 35 if(building_graph) … … 70 38 packet->src_filterID=this->filterID; 71 39 packet->field = this->field; 40 packet->distance = 1; 72 41 73 if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl;42 // if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 74 43 75 44 CWorkflowGraph::allocNodeEdge(); 76 45 77 46 CWorkflowGraph::addNode(this->filterID, "Source Filter ", 1, 1, 0, packet); 78 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record XiosAttributes();47 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 79 48 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].field_id = this->field->getId(); 49 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = 1; 80 50 81 51 CWorkflowGraph::build_begin = true; 82 52 } 83 53 84 85 onOutputReady(packet); 54 // if(building_graph) std::cout<<packet->timestamp<<"************************************************ source filter : field_id = "<<this->field->getId()<<" start = "<<this->field->field_graph_start<<" end_graph = "<<this->field->field_graph_end<<std::endl; 86 55 } 87 88 template void CSourceFilter::streamData<1>(CDate date, const CArray<double, 1>& data, const StdString field_id);89 template void CSourceFilter::streamData<2>(CDate date, const CArray<double, 2>& data, const StdString field_id);90 template void CSourceFilter::streamData<3>(CDate date, const CArray<double, 3>& data, const StdString field_id);91 template void CSourceFilter::streamData<4>(CDate date, const CArray<double, 4>& data, const StdString field_id);92 template void CSourceFilter::streamData<5>(CDate date, const CArray<double, 5>& data, const StdString field_id);93 template void CSourceFilter::streamData<6>(CDate date, const CArray<double, 6>& data, const StdString field_id);94 template void CSourceFilter::streamData<7>(CDate date, const CArray<double, 7>& data, const StdString field_id);95 56 96 57 … … 130 91 } 131 92 } 132 this->filterID = InvalidableObject::filterIdGenerator++;133 packet->src_filterID=this->filterID;134 93 135 if(CXios::isClient) std::cout<<"source filter filter tag = "<<this->tag<<std::endl; 94 if(CXios::isClient) buildGraph(packet); 95 96 136 97 137 98 onOutputReady(packet); -
XIOS/dev/dev_trunk_omp/src/filter/source_filter.hpp
r1679 r1681 48 48 void streamData(CDate date, const CArray<double, N>& data); 49 49 50 template <int N> 51 void streamData(CDate date, const CArray<double, N>& data, const StdString field_id); 50 void virtual buildGraph(CDataPacketPtr packet); 52 51 53 52 /*! -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp
r1680 r1681 75 75 76 76 CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 77 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field );77 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field, this->getDistance()); 78 78 if (outputPacket) 79 79 { … … 112 112 113 113 CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 114 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field );114 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field, this->getDistance()); 115 115 116 116 if (outputPacket) … … 179 179 } 180 180 181 CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue, int tag, Time start_graph, Time end_graph, CField *field)181 bool CSpatialTransformFilterEngine::buildGraph(std::vector<CDataPacketPtr> data, int tag, Time start_graph, Time end_graph, CField *field, int distance) 182 182 { 183 183 bool building_graph = tag ? data[0]->timestamp >= start_graph && data[0]->timestamp <= end_graph : false; … … 190 190 191 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(); 192 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 193 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = field->record4graphXiosAttributes(); 194 if(field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +field->file->record4graphXiosAttributes(); 194 195 195 196 … … 203 204 } 204 205 206 return building_graph; 207 } 208 209 CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue, int tag, Time start_graph, Time end_graph, CField *field, int distance) 210 { 211 212 bool BG = buildGraph(data, tag, start_graph, end_graph, field, distance); 205 213 206 214 CDataPacketPtr packet(new CDataPacket); … … 221 229 if (0 != packet->data.numElements()) 222 230 (packet->data)(0) = defaultValue; 223 if( building_graph) apply(data[0]->data, packet->data, this->filterID);231 if(BG) apply(data[0]->data, packet->data, this->filterID); 224 232 else apply(data[0]->data, packet->data); 225 233 } 226 234 227 if(building_graph) packet->src_filterID=this->filterID; 235 if(BG) packet->src_filterID=this->filterID; 236 if(BG) packet->distance=data[0]->distance+1; 228 237 packet->field = field; 229 238 … … 347 356 int srcRank = itRecv->first; 348 357 349 if(filterID >=0) 358 if(filterID >=0) // building_graph 350 359 { 351 360 (*CWorkflowGraph::mapFilters_ptr_with_info)[filterID].filter_name = (*itAlgo)->getName(); -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.hpp
r1679 r1681 121 121 * \return the result of the grid transformation 122 122 */ 123 CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0); 123 CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0, int distance=1); 124 bool buildGraph(std::vector<CDataPacketPtr> data, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0, int distance=1); 124 125 125 126 /*! -
XIOS/dev/dev_trunk_omp/src/filter/store_filter.cpp
r1680 r1681 89 89 template CDataPacket::StatusCode CStoreFilter::getData<7>(Time timestamp, CArray<double, 7>& data); 90 90 91 void CStoreFilter:: onInputReady(std::vector<CDataPacketPtr> data)91 void CStoreFilter::buildGraph(std::vector<CDataPacketPtr> data) 92 92 { 93 94 93 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 95 94 … … 101 100 CWorkflowGraph::allocNodeEdge(); 102 101 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(); 102 CWorkflowGraph::addNode(this->filterID, "Store Filter", 7, 1, 1, data[0]); 103 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance); 104 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 105 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 106 106 107 107 // if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl; … … 114 114 else CWorkflowGraph::build_begin = true; 115 115 } 116 } 116 117 117 118 void CStoreFilter::onInputReady(std::vector<CDataPacketPtr> data) 119 { 120 buildGraph(data); 118 121 119 122 CDataPacketPtr packet; -
XIOS/dev/dev_trunk_omp/src/filter/store_filter.hpp
r1679 r1681 81 81 Time end_graph; 82 82 CField *field; 83 int distance; 83 84 84 85 … … 90 91 */ 91 92 void virtual onInputReady(std::vector<CDataPacketPtr> data); 93 void virtual buildGraph(std::vector<CDataPacketPtr> data); 92 94 93 95 private: -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
r1680 r1681 33 33 } 34 34 35 CDataPacketPtr CTemporalFilter::apply(std::vector<CDataPacketPtr> data) 36 { 37 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 38 39 if(building_graph) 40 { 41 int edgeID = InvalidableObject::edgeIdGenerator++; 42 43 CWorkflowGraph::allocNodeEdge(); 44 45 if(CWorkflowGraph::build_begin) 46 { 47 CWorkflowGraph::addEdge(edgeID, -1, data[0]); 48 } 49 this->filterIDoutputs_pair.push_back(make_pair(edgeID, data[0]->src_filterID)); 50 } 51 52 53 CDataPacketPtr packet; 54 55 if (data[0]->status != CDataPacket::END_OF_STREAM) 56 { 57 bool usePacket, outputResult, copyLess; 58 if (isOnceOperation) 59 usePacket = outputResult = copyLess = isFirstOperation; 60 else 61 { 62 usePacket = (data[0]->date >= nextSamplingDate); 63 outputResult = (data[0]->date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 64 copyLess = (isInstantOperation && usePacket && outputResult); 65 } 66 67 if (usePacket) 68 { 69 nbSamplingDates ++; 70 if (!copyLess) 71 { 72 if (!tmpData.numElements()) 73 tmpData.resize(data[0]->data.numElements()); 74 75 (*functor)(data[0]->data); 76 } 77 78 nextSamplingDate = ((initDate + offsetMonth) + nbSamplingDates * samplingFreq) + offsetAllButMonth + initDate.getRelCalendar().getTimeStep(); 79 } 80 81 if (outputResult) 82 { 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 } 35 102 36 103 37 104 38 105 nbOperationDates ++; 106 if (!copyLess) 107 { 108 functor->final(); 109 110 packet = CDataPacketPtr(new CDataPacket); 111 packet->date = data[0]->date; 112 packet->timestamp = data[0]->timestamp; 113 packet->status = data[0]->status; 114 packet->data.resize(tmpData.numElements()); 115 packet->data = tmpData; 116 } 117 else 118 packet = data[0]; 119 120 isFirstOperation = false; 121 122 packet->field = this->field; 123 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) 39 bool CTemporalFilter::buildGraph(std::vector<CDataPacketPtr> data) 135 40 { 136 41 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; … … 150 55 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].transform_type = this->temp_op; 151 56 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = false ; 57 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].clusterID = 1 ; 58 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = (data[0]->distance); 59 60 61 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 62 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 152 63 } 153 64 … … 159 70 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 160 71 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb += 1 ; 72 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = max(data[0]->distance+1, (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance); 161 73 } 162 74 … … 164 76 this->filterIDoutputs.push_back(data[0]->src_filterID); 165 77 } 166 167 78 79 return building_graph; 80 } 81 82 83 CDataPacketPtr CTemporalFilter::apply(std::vector<CDataPacketPtr> data) 84 { 85 bool BG = buildGraph(data); 86 168 87 CDataPacketPtr packet; 169 88 … … 207 126 packet->data.resize(tmpData.numElements()); 208 127 packet->data = tmpData; 128 209 129 } 210 130 else … … 214 134 215 135 packet->field = this->field; 216 if(building_graph) packet->src_filterID=this->filterID; 217 if(building_graph) this->filterIDoutputs.clear(); 218 if(building_graph) CWorkflowGraph::build_begin=true; 219 if(building_graph) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = true ; 136 137 if(BG) 138 { 139 packet->src_filterID=this->filterID; 140 packet->distance = data[0]->distance+1; 141 this->filterIDoutputs.clear(); 142 CWorkflowGraph::build_begin=true; 143 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = true ; 144 } 220 145 } 221 146 } -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.hpp
r1680 r1681 40 40 */ 41 41 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 42 CDataPacketPtr virtual apply_old(std::vector<CDataPacketPtr> data);42 bool virtual buildGraph(std::vector<CDataPacketPtr> data); 43 43 44 44 /*! -
XIOS/dev/dev_trunk_omp/src/filter/ternary_arithmetic_filter.cpp
r1680 r1681 2 2 #include "workflow_graph.hpp" 3 3 #include "yacc_var.hpp" 4 #include "file.hpp" 4 5 5 6 namespace xios … … 15 16 }; 16 17 17 CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 18 { 19 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 20 18 std::tuple<int, int, int> CScalarScalarFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 19 { 20 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 21 int unique_filter_id; 22 bool firstround; 23 21 24 if(building_graph) 22 25 { 23 this->filterID = InvalidableObject::filterIdGenerator++;24 int edgeID = InvalidableObject::edgeIdGenerator++;25 26 26 CWorkflowGraph::allocNodeEdge(); 27 27 28 std::cout<<"CScalarScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 29 30 31 32 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 33 34 35 if(CWorkflowGraph::build_begin) 36 { 37 38 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 39 40 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 28 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 29 30 // first round 31 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 32 { 33 firstround = true; 34 this->filterID = InvalidableObject::filterIdGenerator++; 35 int edgeID = InvalidableObject::edgeIdGenerator++; 36 37 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 38 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 39 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 40 41 42 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 43 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 44 45 46 if(CWorkflowGraph::build_begin) 47 { 48 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 49 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 50 51 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 52 } 53 else CWorkflowGraph::build_begin = true; 54 55 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 56 unique_filter_id = this->filterID; 41 57 } 42 else CWorkflowGraph::build_begin = true; 43 } 44 58 // not first round 59 else 60 { 61 firstround=false; 62 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 63 if(data[0]->src_filterID != unique_filter_id) 64 { 65 int edgeID = InvalidableObject::edgeIdGenerator++; 66 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 67 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 68 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 69 } 70 } 71 } 72 73 return std::make_tuple(building_graph, firstround, unique_filter_id); 74 } 75 76 CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 77 { 78 45 79 CDataPacketPtr packet(new CDataPacket); 46 80 packet->date = data[0]->date; 47 81 packet->timestamp = data[0]->timestamp; 48 82 packet->status = data[0]->status; 49 if(building_graph) packet->src_filterID = this->filterID; 83 84 std::tuple<int, int, int> graph = buildGraph(data); 85 86 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 87 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 88 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 89 50 90 packet->field = this->field; 51 91 … … 66 106 }; 67 107 68 CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 69 { 70 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 71 108 std::tuple<int, int, int> CScalarFieldScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 109 { 110 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 111 int unique_filter_id; 112 bool firstround; 113 72 114 if(building_graph) 73 115 { 74 this->filterID = InvalidableObject::filterIdGenerator++;75 int edgeID = InvalidableObject::edgeIdGenerator++;76 77 78 116 CWorkflowGraph::allocNodeEdge(); 79 117 80 std::cout<<"CScalarFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 81 82 83 84 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 85 86 if(CWorkflowGraph::build_begin) 87 { 88 89 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 90 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 118 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 119 120 // first round 121 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 122 { 123 firstround = true; 124 this->filterID = InvalidableObject::filterIdGenerator++; 125 int edgeID = InvalidableObject::edgeIdGenerator++; 126 127 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 128 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 129 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 130 131 132 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 133 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 134 135 136 if(CWorkflowGraph::build_begin) 137 { 138 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 139 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 140 141 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 142 } 143 else CWorkflowGraph::build_begin = true; 144 145 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 146 unique_filter_id = this->filterID; 91 147 } 92 else CWorkflowGraph::build_begin = true; 93 } 148 // not first round 149 else 150 { 151 firstround=false; 152 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 153 if(data[0]->src_filterID != unique_filter_id) 154 { 155 int edgeID = InvalidableObject::edgeIdGenerator++; 156 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 157 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 158 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 159 } 160 } 161 } 162 163 return std::make_tuple(building_graph, firstround, unique_filter_id); 164 } 165 166 CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 167 { 94 168 95 169 CDataPacketPtr packet(new CDataPacket); … … 97 171 packet->timestamp = data[0]->timestamp; 98 172 packet->status = data[0]->status; 99 if(building_graph) packet->src_filterID = this->filterID; 173 174 std::tuple<int, int, int> graph = buildGraph(data); 175 176 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 177 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 178 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 179 100 180 packet->field = this->field; 101 181 … … 115 195 }; 116 196 197 std::tuple<int, int, int> CScalarFieldFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 198 { 199 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 200 int unique_filter_id; 201 202 bool firstround; 203 204 if(building_graph) 205 { 206 CWorkflowGraph::allocNodeEdge(); 207 208 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 209 210 // first round 211 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 212 { 213 firstround = true; 214 this->filterID = InvalidableObject::filterIdGenerator++; 215 int edgeID = InvalidableObject::edgeIdGenerator++; 216 217 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 218 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 219 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 220 221 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 222 223 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 224 if(CWorkflowGraph::build_begin) 225 { 226 227 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 228 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 229 230 edgeID = InvalidableObject::edgeIdGenerator++; 231 232 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 233 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 234 235 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 236 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 237 } 238 CWorkflowGraph::build_begin = true; 239 240 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 241 unique_filter_id = this->filterID; 242 243 } 244 // not first round 245 else 246 { 247 firstround = false; 248 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 249 if(data[0]->src_filterID != unique_filter_id) 250 { 251 int edgeID = InvalidableObject::edgeIdGenerator++; 252 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 253 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 254 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 255 } 256 if(data[1]->src_filterID != unique_filter_id) 257 { 258 int edgeID = InvalidableObject::edgeIdGenerator++; 259 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); 260 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 261 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 262 } 263 264 } 265 } 266 267 return std::make_tuple(building_graph, firstround, unique_filter_id); 268 } 269 117 270 CDataPacketPtr CScalarFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 118 271 { 119 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false;120 121 if(building_graph)122 {123 this->filterID = InvalidableObject::filterIdGenerator++;124 int edgeID = InvalidableObject::edgeIdGenerator++;125 126 127 CWorkflowGraph::allocNodeEdge();128 129 std::cout<<"CScalarFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl;130 131 132 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]);133 134 if(CWorkflowGraph::build_begin)135 {136 137 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);138 139 140 edgeID = InvalidableObject::edgeIdGenerator++;141 142 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]);143 144 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;145 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ;146 }147 else CWorkflowGraph::build_begin = true;148 }149 272 150 273 CDataPacketPtr packet(new CDataPacket); … … 152 275 packet->timestamp = data[0]->timestamp; 153 276 packet->status = data[0]->status; 154 if(building_graph) packet->src_filterID = this->filterID; 277 278 std::tuple<int, int, int> graph = buildGraph(data); 279 280 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 281 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 282 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 283 155 284 packet->field = this->field; 156 285 … … 179 308 }; 180 309 181 CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 182 { 183 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 184 310 std::tuple<int, int, int> CFieldScalarScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 311 { 312 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 313 int unique_filter_id; 314 bool firstround; 315 185 316 if(building_graph) 186 317 { 187 this->filterID = InvalidableObject::filterIdGenerator++;188 int edgeID = InvalidableObject::edgeIdGenerator++;189 190 191 318 CWorkflowGraph::allocNodeEdge(); 192 319 193 std::cout<<"CFieldScalarScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 194 195 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 196 197 if(CWorkflowGraph::build_begin) 198 { 199 200 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 201 202 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 320 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 321 322 // first round 323 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 324 { 325 firstround = true; 326 this->filterID = InvalidableObject::filterIdGenerator++; 327 int edgeID = InvalidableObject::edgeIdGenerator++; 328 329 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 330 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 331 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 332 333 334 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 335 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 336 337 338 if(CWorkflowGraph::build_begin) 339 { 340 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 341 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 342 343 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 344 } 345 else CWorkflowGraph::build_begin = true; 346 347 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 348 unique_filter_id = this->filterID; 203 349 } 204 else CWorkflowGraph::build_begin = true; 205 } 350 // not first round 351 else 352 { 353 firstround=false; 354 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 355 if(data[0]->src_filterID != unique_filter_id) 356 { 357 int edgeID = InvalidableObject::edgeIdGenerator++; 358 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 359 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 360 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 361 } 362 } 363 } 364 365 return std::make_tuple(building_graph, firstround, unique_filter_id); 366 } 367 368 CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 369 { 206 370 207 371 CDataPacketPtr packet(new CDataPacket); … … 209 373 packet->timestamp = data[0]->timestamp; 210 374 packet->status = data[0]->status; 211 if(building_graph) packet->src_filterID = this->filterID; 375 376 std::tuple<int, int, int> graph = buildGraph(data); 377 378 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 379 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 380 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 381 212 382 packet->field = this->field; 213 383 … … 228 398 }; 229 399 400 std::tuple<int, int, int> CFieldScalarFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 401 { 402 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 403 int unique_filter_id; 404 405 bool firstround; 406 407 if(building_graph) 408 { 409 CWorkflowGraph::allocNodeEdge(); 410 411 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 412 413 // first round 414 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 415 { 416 firstround = true; 417 this->filterID = InvalidableObject::filterIdGenerator++; 418 int edgeID = InvalidableObject::edgeIdGenerator++; 419 420 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 421 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 422 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 423 424 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 425 426 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 427 if(CWorkflowGraph::build_begin) 428 { 429 430 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 431 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 432 433 edgeID = InvalidableObject::edgeIdGenerator++; 434 435 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 436 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 437 438 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 439 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 440 } 441 CWorkflowGraph::build_begin = true; 442 443 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 444 unique_filter_id = this->filterID; 445 446 } 447 // not first round 448 else 449 { 450 firstround = false; 451 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 452 if(data[0]->src_filterID != unique_filter_id) 453 { 454 int edgeID = InvalidableObject::edgeIdGenerator++; 455 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 456 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 457 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 458 } 459 if(data[1]->src_filterID != unique_filter_id) 460 { 461 int edgeID = InvalidableObject::edgeIdGenerator++; 462 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); 463 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 464 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 465 } 466 467 } 468 } 469 470 return std::make_tuple(building_graph, firstround, unique_filter_id); 471 } 472 230 473 CDataPacketPtr CFieldScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 231 474 { 232 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false;233 234 if(building_graph)235 {236 this->filterID = InvalidableObject::filterIdGenerator++;237 int edgeID = InvalidableObject::edgeIdGenerator++;238 239 240 CWorkflowGraph::allocNodeEdge();241 242 std::cout<<"CFieldScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl;243 244 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]);245 246 if(CWorkflowGraph::build_begin)247 {248 249 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);250 251 edgeID = InvalidableObject::edgeIdGenerator++;252 253 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]);254 255 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;256 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ;257 }258 else CWorkflowGraph::build_begin = true;259 }260 475 261 476 CDataPacketPtr packet(new CDataPacket); … … 263 478 packet->timestamp = data[0]->timestamp; 264 479 packet->status = data[0]->status; 265 if(building_graph) packet->src_filterID = this->filterID; 480 481 std::tuple<int, int, int> graph = buildGraph(data); 482 483 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 484 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 485 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 486 266 487 packet->field = this->field; 267 488 … … 288 509 }; 289 510 511 std::tuple<int, int, int> CFieldFieldScalarArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 512 { 513 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 514 int unique_filter_id; 515 516 bool firstround; 517 518 if(building_graph) 519 { 520 CWorkflowGraph::allocNodeEdge(); 521 522 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 523 524 // first round 525 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 526 { 527 firstround = true; 528 this->filterID = InvalidableObject::filterIdGenerator++; 529 int edgeID = InvalidableObject::edgeIdGenerator++; 530 531 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 532 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 533 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 534 535 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 536 537 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 538 if(CWorkflowGraph::build_begin) 539 { 540 541 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 542 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 543 544 edgeID = InvalidableObject::edgeIdGenerator++; 545 546 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 547 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 548 549 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 550 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 551 } 552 CWorkflowGraph::build_begin = true; 553 554 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 555 unique_filter_id = this->filterID; 556 557 } 558 // not first round 559 else 560 { 561 firstround = false; 562 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 563 if(data[0]->src_filterID != unique_filter_id) 564 { 565 int edgeID = InvalidableObject::edgeIdGenerator++; 566 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 567 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 568 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 569 } 570 if(data[1]->src_filterID != unique_filter_id) 571 { 572 int edgeID = InvalidableObject::edgeIdGenerator++; 573 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); 574 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 575 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 576 } 577 578 } 579 } 580 581 return std::make_tuple(building_graph, firstround, unique_filter_id); 582 } 583 290 584 CDataPacketPtr CFieldFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 291 585 { 292 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false;293 294 if(building_graph)295 {296 this->filterID = InvalidableObject::filterIdGenerator++;297 int edgeID = InvalidableObject::edgeIdGenerator++;298 299 CWorkflowGraph::allocNodeEdge();300 301 std::cout<<"CFieldFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl;302 303 304 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]);305 306 if(CWorkflowGraph::build_begin)307 {308 309 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);310 311 int edgeID = InvalidableObject::edgeIdGenerator++;312 313 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]);314 315 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;316 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ;317 }318 else CWorkflowGraph::build_begin = true;319 }320 586 321 587 CDataPacketPtr packet(new CDataPacket); … … 323 589 packet->timestamp = data[0]->timestamp; 324 590 packet->status = data[0]->status; 325 if(building_graph) packet->src_filterID = this->filterID; 591 592 std::tuple<int, int, int> graph = buildGraph(data); 593 594 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 595 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 596 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 597 326 598 packet->field = this->field; 327 599 … … 347 619 }; 348 620 621 std::tuple<int, int, int> CFieldFieldFieldArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 622 { 623 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 624 int unique_filter_id; 625 626 bool firstround; 627 628 if(building_graph) 629 { 630 CWorkflowGraph::allocNodeEdge(); 631 632 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 633 634 // first round 635 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 636 { 637 firstround = true; 638 this->filterID = InvalidableObject::filterIdGenerator++; 639 int edgeID = InvalidableObject::edgeIdGenerator++; 640 641 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 642 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 643 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 644 645 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 646 647 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 648 if(CWorkflowGraph::build_begin) 649 { 650 651 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 652 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 653 654 edgeID = InvalidableObject::edgeIdGenerator++; 655 656 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 657 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 658 659 edgeID = InvalidableObject::edgeIdGenerator++; 660 661 CWorkflowGraph::addEdge(edgeID, this->filterID, data[2]); 662 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 663 664 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 665 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 666 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[2]->src_filterID].filter_filled = 0 ; 667 } 668 CWorkflowGraph::build_begin = true; 669 670 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 671 unique_filter_id = this->filterID; 672 673 } 674 // not first round 675 else 676 { 677 firstround = false; 678 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 679 if(data[0]->src_filterID != unique_filter_id) 680 { 681 int edgeID = InvalidableObject::edgeIdGenerator++; 682 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 683 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 684 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 685 } 686 if(data[1]->src_filterID != unique_filter_id) 687 { 688 int edgeID = InvalidableObject::edgeIdGenerator++; 689 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); 690 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 691 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 692 } 693 if(data[2]->src_filterID != unique_filter_id) 694 { 695 int edgeID = InvalidableObject::edgeIdGenerator++; 696 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[2]); 697 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[2]->src_filterID].filter_filled = 0 ; 698 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 699 } 700 701 } 702 } 703 704 return std::make_tuple(building_graph, firstround, unique_filter_id); 705 } 706 349 707 CDataPacketPtr CFieldFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 350 708 { 351 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false;352 353 if(building_graph)354 {355 this->filterID = InvalidableObject::filterIdGenerator++;356 int edgeID = InvalidableObject::edgeIdGenerator++;357 358 359 CWorkflowGraph::allocNodeEdge();360 361 std::cout<<"CFieldFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl;362 363 364 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 3, data[0]);365 366 if(CWorkflowGraph::build_begin)367 {368 369 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]);370 371 372 edgeID = InvalidableObject::edgeIdGenerator++;373 374 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]);375 376 377 edgeID = InvalidableObject::edgeIdGenerator++;378 379 CWorkflowGraph::addEdge(edgeID, this->filterID, data[2]);380 381 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ;382 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ;383 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[2]->src_filterID].filter_filled = 0 ;384 }385 else CWorkflowGraph::build_begin = true;386 }387 388 709 389 710 CDataPacketPtr packet(new CDataPacket); … … 391 712 packet->timestamp = data[0]->timestamp; 392 713 packet->status = data[0]->status; 393 if(building_graph) packet->src_filterID = this->filterID; 714 715 std::tuple<int, int, int> graph = buildGraph(data); 716 717 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 718 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 719 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 720 394 721 packet->field = this->field; 395 722 -
XIOS/dev/dev_trunk_omp/src/filter/ternary_arithmetic_filter.hpp
r1162 r1681 5 5 #include <string> 6 6 #include "operator_expr.hpp" 7 #include <tuple> 7 8 8 9 namespace xios … … 36 37 */ 37 38 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 39 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 38 40 }; // class CScalarScalarFieldArithmeticFilter 39 41 … … 67 69 */ 68 70 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 71 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 69 72 }; // class CScalarScalarFieldArithmeticFilter 70 73 … … 95 98 */ 96 99 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 100 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 97 101 }; // class CScalarScalarFieldArithmeticFilter 98 102 … … 127 131 */ 128 132 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 133 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 129 134 }; // class CFieldScalarScalarArithmeticFilter 130 135 … … 156 161 */ 157 162 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 163 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 158 164 }; // class CFieldScalarFieldArithmeticFilter 159 165 … … 185 191 */ 186 192 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 193 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 187 194 }; // class CFieldFielScalardArithmeticFilter 188 195 … … 212 219 */ 213 220 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 221 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 214 222 }; // class CFieldFielFieldArithmeticFilter 215 223 -
XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.cpp
r1680 r1681 13 13 }; 14 14 15 CDataPacketPtr CUnaryArithmeticFilter::apply(std::vector<CDataPacketPtr> data)15 std::tuple<int, int, int> CUnaryArithmeticFilter::buildGraph(std::vector<CDataPacketPtr> data) 16 16 { 17 17 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 18 18 int unique_filter_id; 19 bool firstround; 19 20 20 21 if(building_graph) … … 26 27 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 27 28 { 29 firstround=true; 28 30 this->filterID = InvalidableObject::filterIdGenerator++; 29 31 int edgeID = InvalidableObject::edgeIdGenerator++; … … 31 33 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 32 34 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 35 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 33 36 34 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record XiosAttributes();35 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record XiosAttributes();37 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 38 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 36 39 37 40 if(CWorkflowGraph::build_begin) … … 50 53 else 51 54 { 55 firstround=false; 52 56 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 53 57 if(data[0]->src_filterID != unique_filter_id) … … 57 61 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 58 62 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 59 } 60 61 63 } 62 64 } 63 65 64 66 } 67 68 return std::make_tuple(building_graph, firstround, unique_filter_id); 69 } 70 71 CDataPacketPtr CUnaryArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 72 { 65 73 66 74 CDataPacketPtr packet(new CDataPacket); … … 68 76 packet->timestamp = data[0]->timestamp; 69 77 packet->status = data[0]->status; 78 79 std::tuple<int, int, int> graph = buildGraph(data); 80 81 if(std::get<0>(graph)) packet->src_filterID = std::get<2>(graph); 82 if(std::get<0>(graph) && std::get<1>(graph)) packet->distance = data[0]->distance+1; 83 if(std::get<0>(graph) && !std::get<1>(graph)) packet->distance = data[0]->distance; 84 70 85 packet->field = this->field; 71 86 … … 73 88 packet->data.reference(op(data[0]->data)); 74 89 75 if(building_graph) packet->src_filterID = unique_filter_id;76 77 90 return packet; 78 91 } -
XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.hpp
r642 r1681 34 34 */ 35 35 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 36 std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 36 37 }; // class CUnaryArithmeticFilter 37 38 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/graphviz.cpp
r1680 r1681 103 103 fs_json << " \"inputs\": \""<<it->second.inputs_complete<<"\", "<<std::endl; 104 104 fs_json << " \"tag\": \""<<it->second.filter_tag<<"\", "<<std::endl; 105 if(it->second.clusterID != -1) fs_json << " \"cid\": \""<<it->second.clusterID<<"\", "<<std::endl; 105 fs_json << " \"cid\": \""<<it->second.clusterID<<"\", "<<std::endl; 106 fs_json << " \"distance\": \""<<it->second.distance<<"\", "<<std::endl; 106 107 fs_json << " \"attributes\": \""<<it->second.attributes<<"\"}"<<std::endl<<" "; 107 108 } … … 135 136 fs_json << " ]}"<<std::endl; 136 137 137 138 139 140 141 142 138 fs_json.close(); 143 144 145 146 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;183 184 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;207 208 209 210 // fs.close();211 212 139 } 213 140 } -
XIOS/dev/dev_trunk_omp/src/node/field.cpp
r1680 r1681 46 46 , mustAutoTrigger(false) 47 47 , isEOF(false), nstepMaxRead(false) 48 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 48 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 49 field_graph_start = -2; 50 field_graph_end = -2; 51 } 49 52 50 53 CField::CField(const StdString& id) … … 64 67 , mustAutoTrigger(false) 65 68 , isEOF(false), nstepMaxRead(false) 66 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); } 69 { setVirtualVariableGroup(CVariableGroup::create(getId() + "_virtual_variable_group")); 70 field_graph_start = -2; 71 field_graph_end = -2; 72 } 73 67 74 68 75 CField::~CField(void) … … 72 79 73 80 74 const StdString& CField::getOId(void) 75 { 76 if (this->getId().compare(2,5,"field") == 0 && this->getId().compare(8,5,"undef") == 0) 77 { 78 if(!name.isEmpty()) return name; 79 else return CField::get(field_ref)->getOId(); 80 } 81 else if(!name.isEmpty()) return name; 82 else return this->getId(); 83 } 81 84 82 85 83 void CField::setVirtualVariableGroup(CVariableGroup* newVVariableGroup) … … 690 688 691 689 //---------------------------------------------------------------- 692 690 693 691 StdString CField::GetName(void) { return StdString("field"); } 694 692 StdString CField::GetDefName(void) { return CField::GetName(); } … … 1127 1125 * read by the client or/and written to a file 1128 1126 */ 1129 void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput )1127 void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput, Time start_graph, Time end_graph) 1130 1128 TRY 1131 1129 { … … 1141 1139 1142 1140 CContext* context = CContext::getCurrent(); 1141 1143 1142 Time filter_start; 1144 1143 if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start; … … 1150 1149 else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807; 1151 1150 else filter_end = -1; 1151 1152 if(this->field_graph_start==-2) this->field_graph_start = filter_start; 1153 if(this->field_graph_end==-2) this->field_graph_end = filter_end; // init 1154 1155 // if(CXios::isClient) std::cout<<"****************** buildFilterGraph : field_id = "<<this->getId()<<" BEFORE: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl; 1156 1157 if(start_graph == -1) 1158 { 1159 //nothing 1160 // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case1: this->field_graph_start = "<<this->field_graph_start<<std::endl; 1161 } 1162 else //if(start_graph != -1) 1163 { 1164 if(this->field_graph_start == -1) this->field_graph_start = start_graph; 1165 else this->field_graph_start = min(this->field_graph_start, start_graph); 1166 1167 // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case2: this->field_graph_start = "<<this->field_graph_start<<std::endl; 1168 } 1169 1170 1171 if(end_graph == -1) 1172 { 1173 //nothing 1174 // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case1: this->field_graph_end = "<<this->field_graph_end<<std::endl; 1175 } 1176 else 1177 { 1178 if(this->field_graph_end == -1) this->field_graph_end = end_graph; 1179 else this->field_graph_end = max(this->field_graph_end, end_graph); 1180 1181 // if(CXios::isClient) std::cout<<"buildFilterGraph field_id = "<<this->getId()<<" case2: this->field_graph_end = "<<this->field_graph_end<<std::endl; 1182 } 1183 1184 1185 filter_start = this->field_graph_start; 1186 filter_end = this->field_graph_end; 1187 1188 1189 // if(CXios::isClient) std::cout<<"****************** buildFilterGraph : field_id = "<<this->getId()<<" AFTER: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl; 1190 1191 1192 1152 1193 1153 1194 … … 1195 1236 { 1196 1237 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 1197 std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this );1238 std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this, filter_start, filter_end); 1198 1239 1199 1240 // Check if a spatial transformation is needed … … 1227 1268 filter->tag = filter->tag || filter->parent_filters[i]->tag; 1228 1269 } 1229 1230 1231 1232 1233 1234 1270 } 1235 1271 // Check if we have a reference on another field 1236 1272 else if (!field_ref.isEmpty()) 1237 1273 { 1238 instantDataFilter = getFieldReference(gc );1274 instantDataFilter = getFieldReference(gc, filter_start, filter_end); 1239 1275 instantDataFilter->tag = buildWorkflowGraph; 1240 1276 instantDataFilter->start_graph = filter_start; … … 1262 1298 instantDataFilter->end_graph = filter_end; 1263 1299 instantDataFilter->field = this; 1300 // if(CXios::isClient) std::cout<<"***********************buildFilterGraph init source filter : field_id = "<<this->getId()<<" sourcefilter->start_graph = "<<clientSourceFilter->start_graph<<" sourcefilter->end_graph = "<<clientSourceFilter->end_graph<<std::endl; 1264 1301 } 1265 1302 } … … 1282 1319 storeFilter->end_graph = filter_end; 1283 1320 storeFilter->field = this; 1321 storeFilter->distance = instantDataFilter->getDistance()+1; 1284 1322 } 1285 1323 … … 1292 1330 getTemporalDataFilter(gc, file->output_freq)->start_graph = filter_start; 1293 1331 getTemporalDataFilter(gc, file->output_freq)->end_graph = filter_end; 1332 getTemporalDataFilter(gc, file->output_freq)->tag = buildWorkflowGraph; 1294 1333 getTemporalDataFilter(gc, file->output_freq)->setParentFiltersTag(); 1295 1334 fileWriterFilter->start_graph = filter_start; 1296 1335 fileWriterFilter->end_graph = filter_end; 1336 fileWriterFilter->distance = getTemporalDataFilter(gc, file->output_freq)->getDistance()+1; 1297 1337 1298 1338 // std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<" field = "<<this->getId()<<std::endl; … … 1311 1351 * \return the output pin corresponding to the field reference 1312 1352 */ 1313 std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc) 1314 TRY 1315 { 1353 std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc, Time start_graph, Time end_graph) 1354 TRY 1355 { 1356 1357 1358 1316 1359 if (instantDataFilter || field_ref.isEmpty()) 1317 1360 ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", … … 1319 1362 1320 1363 CField* fieldRef = CField::get(field_ref); 1321 fieldRef->buildFilterGraph(gc, false );1364 fieldRef->buildFilterGraph(gc, false, start_graph, end_graph); 1322 1365 const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1323 1366 … … 1333 1376 else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807; 1334 1377 else filter_end = -1; 1378 1379 if(this->field_graph_start==-2) this->field_graph_start = filter_start; 1380 if(this->field_graph_end==-2) this->field_graph_end = filter_end; // init 1381 1382 // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" BEFORE: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl; 1383 1384 if(start_graph == -1) 1385 { 1386 //nothing 1387 // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case1: this->field_graph_start = "<<this->field_graph_start<<std::endl; 1388 } 1389 else //if(start_graph != -1) 1390 { 1391 if(this->field_graph_start == -1) this->field_graph_start = start_graph; 1392 else this->field_graph_start = min(this->field_graph_start, start_graph); 1393 1394 // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case2: this->field_graph_start = "<<this->field_graph_start<<std::endl; 1395 } 1396 1397 if(end_graph == -1) 1398 { 1399 //nothing 1400 // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case1: this->field_graph_end = "<<this->field_graph_end<<std::endl; 1401 } 1402 else 1403 { 1404 if(this->field_graph_end == -1) this->field_graph_end = end_graph; 1405 else this->field_graph_end = max(this->field_graph_end, end_graph); 1406 1407 // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" case2: this->field_graph_end = "<<this->field_graph_end<<std::endl; 1408 } 1409 1410 filter_start = this->field_graph_start; 1411 filter_end = this->field_graph_end; 1412 1413 // if(CXios::isClient) std::cout<<"getFieldReference field_id = "<<this->getId()<<" AFTER: this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl; 1335 1414 1336 1415 … … 1388 1467 * \return the output pin corresponding to a self reference 1389 1468 */ 1390 std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc) 1391 TRY 1392 { 1469 std::shared_ptr<COutputPin> CField::getSelfReference(CGarbageCollector& gc, Time start_graph, Time end_graph) 1470 TRY 1471 { 1472 if(CXios::isClient) std::cout<<"getSelfReference field_id = "<<this->getId()<<" start_graph = "<<start_graph<<" end_graph = "<<end_graph<<std::endl; 1473 1393 1474 if (instantDataFilter || !hasExpression()) 1394 1475 ERROR("COutputPin* CField::getSelfReference(CGarbageCollector& gc)", … … 1455 1536 CContext* context = CContext::getCurrent(); 1456 1537 1457 Time filter_start; 1458 if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start; 1459 else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0; 1460 else filter_start = -1; 1461 1462 Time filter_end; 1463 if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end; 1464 else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807; 1465 else filter_end = -1; 1466 1467 1538 // Time filter_start; 1539 // if(!build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = context->calendar->getInitDate()+build_workflow_graph_start; 1540 // else if(build_workflow_graph_start.isEmpty() && buildWorkflowGraph) filter_start = 0; 1541 // else filter_start = -1; 1542 1543 // Time filter_end; 1544 // if(!build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = context->calendar->getInitDate()+build_workflow_graph_end; 1545 // else if(build_workflow_graph_end.isEmpty() && buildWorkflowGraph) filter_end = 9223372036854775807; 1546 // else filter_end = -1; 1547 1548 // filter_start = this->field_graph_start; 1549 // filter_end = this->field_graph_end; 1550 1551 // if(CXios::isClient) std::cout<<"getTemporalDataFilter field_id = "<<this->getId()<<" this->field_graph_start = "<<this->field_graph_start<<" this->field_graph_end = "<<this->field_graph_end<<std::endl; 1468 1552 1469 1553 if (it == temporalDataFilters.end()) … … 1481 1565 1482 1566 instantDataFilter->connectOutput(temporalFilter, 0); 1483 temporalFilter->tag = buildWorkflowGraph;1567 // temporalFilter->tag = buildWorkflowGraph; 1484 1568 1485 1569 temporalFilter->parent_filters.resize(1); … … 1489 1573 if(temporalFilter->parent_filters[0]->tag) temporalFilter->tag=true; 1490 1574 1491 temporalFilter->start_graph = filter_start;1492 temporalFilter->end_graph = filter_end;1575 // temporalFilter->start_graph = filter_start; 1576 // temporalFilter->end_graph = filter_end; 1493 1577 temporalFilter->field = this; 1494 1578 -
XIOS/dev/dev_trunk_omp/src/node/field.hpp
r1677 r1681 89 89 90 90 public: 91 const StdString& getOId(void);92 91 93 92 int getNStep(void) const; … … 142 141 void checkTimeAttributes(CDuration* freqOp=NULL); 143 142 144 void buildFilterGraph(CGarbageCollector& gc, bool enableOutput );143 void buildFilterGraph(CGarbageCollector& gc, bool enableOutput, Time start_graph=-1, Time end_graph=-1); 145 144 size_t getGlobalWrittenSize(void) ; 146 145 147 146 148 std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc );149 std::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc );147 std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc, Time start_graph=-1, Time end_graph=-1); 148 std::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc, Time start_graph=-1, Time end_graph=-1); 150 149 std::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); 151 150 std::shared_ptr<COutputPin> getSelfTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); … … 246 245 bool hasTimeCentered; 247 246 247 Time field_graph_start; 248 Time field_graph_end; 249 248 250 249 251 DECLARE_REF_FUNC(Field,field) -
XIOS/dev/dev_trunk_omp/src/node/field_impl.hpp
r1677 r1681 22 22 { 23 23 if (check_if_active.isEmpty() || (!check_if_active.isEmpty() && (!check_if_active) || isActive(true))) 24 //clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data);25 clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data, this->getId());24 clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 25 // clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data, this->getId()); 26 26 } 27 27 else if (instantDataFilter) -
XIOS/dev/dev_trunk_omp/src/parse_expr/filter_expr_node.cpp
r1680 r1681 12 12 13 13 14 std::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const14 std::shared_ptr<COutputPin> CFilterFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 15 15 { 16 16 std::shared_ptr<COutputPin> outputPin; … … 40 40 << "Use the keyword \"this\" if you want to reference the input data sent to this field."); 41 41 42 field->buildFilterGraph(gc, false); 42 // field->buildFilterGraph(gc, false); 43 field->buildFilterGraph(gc, false, start_graph, end_graph); 43 44 outputPin = field->getInstantDataFilter(); 44 45 } … … 55 56 56 57 57 std::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const58 std::shared_ptr<COutputPin> CFilterTemporalFieldExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 58 59 { 59 60 std::shared_ptr<COutputPin> outputPin; … … 104 105 } 105 106 106 std::shared_ptr<COutputPin> CFilterUnaryOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const107 { 108 std::shared_ptr<COutputPin> ch = child->reduce(gc, thisField );107 std::shared_ptr<COutputPin> CFilterUnaryOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 108 { 109 std::shared_ptr<COutputPin> ch = child->reduce(gc, thisField, start_graph, end_graph); 109 110 110 111 std::shared_ptr<CUnaryArithmeticFilter> filter(new CUnaryArithmeticFilter(gc, opId)); … … 133 134 } 134 135 135 std::shared_ptr<COutputPin> CFilterScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const136 { 137 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField );136 std::shared_ptr<COutputPin> CFilterScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 137 { 138 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField, start_graph, end_graph); 138 139 std::shared_ptr<CScalarFieldArithmeticFilter> filter(new CScalarFieldArithmeticFilter(gc, opId, child1->reduce())); 139 140 ch2->connectOutput(filter, 0); … … 160 161 } 161 162 162 std::shared_ptr<COutputPin> CFilterFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const163 { 164 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField );163 std::shared_ptr<COutputPin> CFilterFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 164 { 165 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField, start_graph, end_graph); 165 166 166 167 std::shared_ptr<CFieldScalarArithmeticFilter> filter(new CFieldScalarArithmeticFilter(gc, opId, child2->reduce())); … … 188 189 } 189 190 190 std::shared_ptr<COutputPin> CFilterFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const191 { 192 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField );193 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField );191 std::shared_ptr<COutputPin> CFilterFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 192 { 193 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField, start_graph, end_graph); 194 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField, start_graph, end_graph); 194 195 195 196 std::shared_ptr<CFieldFieldArithmeticFilter> filter(new CFieldFieldArithmeticFilter(gc, opId)); … … 204 205 filter->start_graph = ch1->tag? ch1->start_graph : (ch2->tag? ch2->start_graph: -1); 205 206 filter->end_graph = ch1->tag? ch1->end_graph : (ch2->tag? ch2->end_graph: -1); 207 206 208 filter->field = &thisField; 207 209 … … 224 226 } 225 227 226 std::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const227 { 228 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField );228 std::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 229 { 230 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField, start_graph, end_graph); 229 231 230 232 std::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); … … 254 256 } 255 257 256 std::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const257 { 258 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField );258 std::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 259 { 260 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField, start_graph, end_graph); 259 261 260 262 std::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); … … 284 286 } 285 287 286 std::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const287 { 288 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField );289 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField );288 std::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 289 { 290 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField, start_graph, end_graph); 291 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField, start_graph, end_graph); 290 292 291 293 std::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce())); … … 318 320 } 319 321 320 std::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const321 { 322 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField );322 std::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 323 { 324 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField, start_graph, end_graph); 323 325 324 326 std::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); … … 349 351 } 350 352 351 std::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const352 { 353 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField );354 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField );353 std::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 354 { 355 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField, start_graph, end_graph); 356 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField, start_graph, end_graph); 355 357 356 358 std::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce())); … … 383 385 } 384 386 385 std::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const386 { 387 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField );388 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField );387 std::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 388 { 389 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField, start_graph, end_graph); 390 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField, start_graph, end_graph); 389 391 390 392 std::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce())); … … 415 417 } 416 418 417 std::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField ) const418 { 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 );419 std::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField, Time start_graph, Time end_graph) const 420 { 421 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField, start_graph, end_graph); 422 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField, start_graph, end_graph); 423 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField, start_graph, end_graph); 422 424 423 425 std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId)); -
XIOS/dev/dev_trunk_omp/src/parse_expr/filter_expr_node.hpp
r1542 r1681 5 5 #include <boost/smart_ptr/scoped_ptr.hpp> 6 6 #include "scalar_expr_node.hpp" 7 8 #include "duration.hpp" 7 9 8 10 namespace xios … … 25 27 * \return the output pin of the filter producing the result of the expression 26 28 */ 27 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const = 0;29 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const = 0; 28 30 }; 29 31 … … 42 44 CFilterFieldExprNode(const std::string& fieldId); 43 45 44 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;46 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 45 47 46 48 private: … … 63 65 CFilterTemporalFieldExprNode(const std::string& fieldId); 64 66 65 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;67 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 66 68 67 69 private: … … 86 88 CFilterUnaryOpExprNode(const std::string& opId, IFilterExprNode* child); 87 89 88 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;90 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 89 91 90 92 private: … … 111 113 CFilterScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2); 112 114 113 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;115 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 114 116 115 117 private: … … 137 139 CFilterFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2); 138 140 139 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;141 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 140 142 141 143 private: … … 162 164 CFilterFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2); 163 165 164 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;166 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 165 167 166 168 private: … … 190 192 CFilterScalarScalarFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 191 193 192 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;194 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 193 195 194 196 private: … … 219 221 CFilterScalarFieldScalarOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 220 222 221 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;223 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 222 224 223 225 private: … … 248 250 CFilterScalarFieldFieldOpExprNode(IScalarExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 249 251 250 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;252 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 251 253 252 254 private: … … 278 280 CFilterFieldScalarScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IScalarExprNode* child3); 279 281 280 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;282 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 281 283 282 284 private: … … 307 309 CFilterFieldScalarFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IScalarExprNode* child2, IFilterExprNode* child3); 308 310 309 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;311 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 310 312 311 313 private: … … 335 337 CFilterFieldFieldScalarOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IScalarExprNode* child3); 336 338 337 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;339 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 338 340 339 341 private: … … 364 366 CFilterFieldFieldFieldOpExprNode(IFilterExprNode* child1, const std::string& opId, IFilterExprNode* child2, IFilterExprNode* child3); 365 367 366 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField ) const;368 virtual std::shared_ptr<COutputPin> reduce(CGarbageCollector& gc, CField& thisField, Time start_graph=-1, Time end_graph=-1) const; 367 369 368 370 private: -
XIOS/dev/dev_trunk_omp/src/test/test_omp.f90
r1679 r1681 169 169 PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 170 170 171 DO ts=1, 4171 DO ts=1,24 172 172 CALL xios_update_calendar(ts) 173 173 CALL xios_send_field("field_A",field_A) -
XIOS/dev/dev_trunk_omp/src/workflow_graph.cpp
r1680 r1681 64 64 TRY 65 65 { 66 // showStaticWorkflow(); 66 67 67 68 if(mapFilters_ptr_with_info==0 || mapFieldToFilters_ptr_with_info==0) … … 76 77 for (auto it=mapFilters_ptr_with_info->begin(); it != mapFilters_ptr_with_info->end(); it++) 77 78 { 79 // std::cout<<"it->first = "<<it->first<<std::endl; 78 80 filters[it->first]=it->second.filter_name; 79 81 } … … 149 151 (*mapFieldToFilters_ptr_with_info)[edgeID].timestamp = packet->timestamp; 150 152 (*mapFieldToFilters_ptr_with_info)[edgeID].field = packet->field; 151 (*mapFieldToFilters_ptr_with_info)[edgeID].attributes = packet->field->record XiosAttributes();153 (*mapFieldToFilters_ptr_with_info)[edgeID].attributes = packet->field->record4graphXiosAttributes(); 152 154 } 153 155 CATCH -
XIOS/dev/dev_trunk_omp/src/workflow_graph.hpp
r1680 r1681 29 29 int filter_tag; 30 30 int clusterID; 31 int distance; 31 32 }; 32 33
Note: See TracChangeset
for help on using the changeset viewer.