Changeset 1680
- Timestamp:
- 07/08/19 16:58:12 (6 years ago)
- Location:
- XIOS/dev/dev_trunk_omp
- Files:
-
- 58 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/context_atm.xml
r1679 r1680 363 363 <file_definition type="one_file" > 364 364 365 <file id="atm_output" output_freq=" 1ts" type="one_file" enabled="true">365 <file id="atm_output" output_freq="4ts" type="one_file" enabled="true"> 366 366 <!-- <field field_ref="field3D" /> 367 367 <field field_ref="field2D" /> -
XIOS/dev/dev_trunk_omp/inputs/iodef.xml
r1679 r1680 17 17 18 18 19 <file_definition type="one_file" par_access="collective" output_freq=" 4h" output_level="10" >19 <file_definition type="one_file" par_access="collective" output_freq="1h" output_level="10" > 20 20 <file id="output" name="output" enabled=".TRUE."> 21 21 <!-- <field field_ref="field_Domain" name="field_A" /> --> 22 <field field_ref="field_A" name="field_A_name" build_workflow_graph=". FALSE." />23 <field field_ref="field_B" name="field_B_name" build_workflow_graph=". FALSE."/>22 <field field_ref="field_A" name="field_A_name" build_workflow_graph=".TRUE." /> 23 <field field_ref="field_B" name="field_B_name" build_workflow_graph=".TRUE."/> 24 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" > field_A + field_B</field>26 < !-- <field id="field_E" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_E_name" build_workflow_graph_start="1h" > field_D*2 </field> -->25 <field id="field_D" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_D_name" build_workflow_graph_start="1h" > sqrt(field_A) + sqrt(field_B) + sqrt(field_C) </field> 26 <field id="field_E" field_ref="field_A" operation="instant" build_workflow_graph=".TRUE." name="field_E_name" build_workflow_graph_start="1h" > sqrt(field_A) + sqrt(field_B) + sqrt(field_C)</field> 27 27 <!-- <field field_ref="field_A_zoom" name="field_B" build_workflow_graph=".TRUE."/> --> 28 28 </file> 29 <file id="output1" name="output1" output_freq="8h" enabled=". FALSE.">29 <file id="output1" name="output1" output_freq="8h" enabled=".TRUE."> 30 30 <!-- <field field_ref="field_Domain" name="field_A" /> --> 31 31 <field id="field_F" field_ref="field_A" name="field_A_zoom" grid_ref="grid_A_zoom" build_workflow_graph=".TRUE." /> -
XIOS/dev/dev_trunk_omp/src/attribute.hpp
r1646 r1680 42 42 virtual void fromString(const StdString & str) = 0; 43 43 virtual StdString dump(void) const = 0; 44 virtual StdString dump2(void) const = 0; 44 45 virtual bool isEqual(const CAttribute& ) = 0; 45 46 -
XIOS/dev/dev_trunk_omp/src/attribute_array.hpp
r1646 r1680 56 56 virtual bool fromBuffer(CBufferIn& buffer) { return _fromBuffer(buffer); } 57 57 virtual string dump(void) const { return _dump();} 58 virtual string dump2(void) const { return _dump2();} 58 59 59 60 virtual void generateCInterface(ostream& oss,const string& className) ; … … 71 72 StdString _toString(void) const; 72 73 StdString _dump(void) const; 74 StdString _dump2(void) const; 73 75 void _fromString(const StdString & str); 74 76 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/dev/dev_trunk_omp/src/attribute_array_impl.hpp
r1646 r1680 138 138 } 139 139 140 template <typename T_numtype, int N_rank> 141 StdString CAttributeArray<T_numtype,N_rank>::_dump2(void) const 142 { 143 StdOStringStream oss; 144 if (! isEmpty() && this->hasId() && (this->numElements()!=0)) 145 oss << this->getName() << "=" << CArray<T_numtype, N_rank>::dump() << ""; 146 return (oss.str()); 147 } 148 140 149 141 150 template <typename T_numtype, int N_rank> -
XIOS/dev/dev_trunk_omp/src/attribute_enum.hpp
r1661 r1680 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 dump2(void) const { return _dump2();} 65 66 66 67 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} … … 79 80 bool isEqual_(const CAttributeEnum& attr ); 80 81 StdString _toString(void) const; 82 StdString _dump2(void) const; 81 83 void _fromString(const StdString & str); 82 84 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/dev/dev_trunk_omp/src/attribute_enum_impl.hpp
r1219 r1680 149 149 } 150 150 151 152 template <class T> 153 StdString CAttributeEnum<T>::_dump2(void) const 154 { 155 StdOStringStream oss; 156 if (!CEnum<T>::isEmpty() && this->hasId()) 157 oss << this->getName() << "=" << CEnum<T>::toString() << "</br>"; 158 return (oss.str()); 159 } 160 161 151 162 template <class T> 152 163 void CAttributeEnum<T>::_fromString(const StdString & str) -
XIOS/dev/dev_trunk_omp/src/attribute_map.cpp
r1646 r1680 48 48 { 49 49 str.append(att.second->dump()); 50 str.append(" "); 51 } 52 else if (str.length() == maxNbChar) 53 { 54 str.append("..."); 55 } 56 } 57 } 58 return str; 59 } 60 61 62 63 StdString CAttributeMap::recordXiosAttributes(void) const 64 { 65 int maxNbChar = 250; 66 StdString str; 67 typedef std::pair<StdString, CAttribute*> StdStrAttPair; 68 auto it = SuperClassMap::begin(), end = SuperClassMap::end(); 69 for (; it != end; it++) 70 { 71 const StdStrAttPair& att = *it; 72 if (!att.second->isEmpty()) 73 { 74 if (str.length() < maxNbChar) 75 { 76 str.append(att.second->dump2()); 50 77 str.append(" "); 51 78 } -
XIOS/dev/dev_trunk_omp/src/attribute_map.hpp
r1646 r1680 39 39 void clearAllAttributes(void); 40 40 StdString dumpXiosAttributes(void) const; 41 StdString recordXiosAttributes(void) const; 41 42 42 43 void clearAttribute(const StdString& key); -
XIOS/dev/dev_trunk_omp/src/attribute_template.hpp
r1646 r1680 74 74 // virtual void fromBinary(StdIStream & is); 75 75 virtual StdString dump(void) const { return _dump();} 76 virtual StdString dump2(void) const { return _dump2();} 76 77 77 78 virtual bool toBuffer (CBufferOut& buffer) const { return _toBuffer(buffer);} … … 99 100 StdString _toString(void) const; 100 101 StdString _dump(void) const; 102 StdString _dump2(void) const; 101 103 void _fromString(const StdString & str); 102 104 bool _toBuffer (CBufferOut& buffer) const; -
XIOS/dev/dev_trunk_omp/src/attribute_template_impl.hpp
r1646 r1680 208 208 if (!CType<T>::isEmpty() && this->hasId()) 209 209 oss << this->getName() << "=\"" << CType<T>::dump() << "\""; 210 return (oss.str()); 211 } 212 213 template <class T> 214 StdString CAttributeTemplate<T>::_dump2(void) const 215 { 216 StdOStringStream oss; 217 if (!CType<T>::isEmpty() && this->hasId()) 218 oss << this->getName() << "=" << CType<T>::dump() << "</br>"; 210 219 return (oss.str()); 211 220 } -
XIOS/dev/dev_trunk_omp/src/cxios.cpp
r1679 r1680 174 174 175 175 // CGraphviz::showStaticWorkflowGraph(); 176 CGraphviz::buildWorkflowGraphDot();176 // CGraphviz::buildWorkflowGraphDot(); 177 177 CGraphviz::buildWorkflowGraphVisjs_with_info(); 178 178 179 StdString commande_string="dot -Tpdf graph.dot -o graph.pdf";180 const char* command=commande_string.c_str();181 system(command);179 // StdString commande_string="dot -Tpdf graph.dot -o graph.pdf"; 180 // const char* command=commande_string.c_str(); 181 // system(command); 182 182 183 183 -
XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.cpp
r1679 r1680 1 1 #include "binary_arithmetic_filter.hpp" 2 2 #include "workflow_graph.hpp" 3 #include "yacc_var.hpp" 4 #include "file.hpp" 3 5 4 6 … … 10 12 , value(value) 11 13 { 12 StdString input_op_expression=op; 13 if(input_op_expression == "add") 14 op_expression = "+"; 15 else if(input_op_expression == "minus") 16 op_expression = "-"; 17 else if(input_op_expression == "mult") 18 op_expression = "x"; 19 else if(input_op_expression == "div") 20 op_expression = "/"; 21 else if(input_op_expression == "eq") 22 op_expression = "="; 23 else if(input_op_expression == "lt") 24 op_expression = "<"; 25 else if(input_op_expression == "gt") 26 op_expression = ">"; 27 else if(input_op_expression == "le") 28 op_expression = "<="; 29 else if(input_op_expression == "ge") 30 op_expression = ">="; 31 else if(input_op_expression == "ne") 32 op_expression = "!="; 33 else 34 op_expression = " "; 14 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 35 15 }; 36 16 … … 38 18 { 39 19 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 20 // bool building_graph = true; 21 int unique_filter_id; 40 22 41 23 if(building_graph) 42 24 { 43 this->filterID = InvalidableObject::filterIdGenerator++; 44 int edgeID = InvalidableObject::edgeIdGenerator++; 45 46 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 47 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 48 49 std::cout<<"CScalarFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 50 51 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "S "+op_expression +" F Filter" ; 52 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2 ; 53 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1 ; 54 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1 ; 55 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date ; 56 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp ; 57 58 if(CWorkflowGraph::build_begin) 59 { 60 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 61 62 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 25 CWorkflowGraph::allocNodeEdge(); 26 27 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 28 29 // first round 30 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 31 { 32 this->filterID = InvalidableObject::filterIdGenerator++; 33 int edgeID = InvalidableObject::edgeIdGenerator++; 34 35 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 36 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 37 38 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 39 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 40 41 42 if(CWorkflowGraph::build_begin) 43 { 44 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 45 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 46 47 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 48 } 49 else CWorkflowGraph::build_begin = true; 50 51 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 52 unique_filter_id = this->filterID; 63 53 } 64 else CWorkflowGraph::build_begin = true; 54 // not first round 55 else 56 { 57 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 58 if(data[0]->src_filterID != unique_filter_id) 59 { 60 int edgeID = InvalidableObject::edgeIdGenerator++; 61 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 62 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 63 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 64 } 65 66 67 } 65 68 } 66 69 … … 69 72 packet->timestamp = data[0]->timestamp; 70 73 packet->status = data[0]->status; 71 if(building_graph) packet->src_filterID = this->filterID;74 if(building_graph) packet->src_filterID = unique_filter_id; 72 75 packet->field = this->field; 73 76 … … 83 86 , value(value) 84 87 { 85 StdString input_op_expression=op; 86 if(input_op_expression == "add") 87 op_expression = "+"; 88 else if(input_op_expression == "minus") 89 op_expression = "-"; 90 else if(input_op_expression == "mult") 91 op_expression = "x"; 92 else if(input_op_expression == "div") 93 op_expression = "/"; 94 else if(input_op_expression == "pow") 95 op_expression = "^"; 96 else if(input_op_expression == "eq") 97 op_expression = "="; 98 else if(input_op_expression == "lt") 99 op_expression = "<"; 100 else if(input_op_expression == "gt") 101 op_expression = ">"; 102 else if(input_op_expression == "le") 103 op_expression = "<="; 104 else if(input_op_expression == "ge") 105 op_expression = ">="; 106 else if(input_op_expression == "ne") 107 op_expression = "!="; 108 else 109 op_expression = " "; 88 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 110 89 }; 111 90 … … 113 92 { 114 93 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 94 // bool building_graph = true; 95 int unique_filter_id; 115 96 116 97 if(building_graph) 117 98 { 118 this->filterID = InvalidableObject::filterIdGenerator++; 119 int edgeID = InvalidableObject::edgeIdGenerator++; 120 121 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 122 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 123 124 std::cout<<"CFieldScalarArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 125 126 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "F "+op_expression +" S Filter" ; 127 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2 ; 128 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1 ; 129 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1 ; 130 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date ; 131 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp ; 132 133 if(CWorkflowGraph::build_begin) 134 { 135 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 136 137 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 99 CWorkflowGraph::allocNodeEdge(); 100 101 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 102 103 // first round 104 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 105 { 106 this->filterID = InvalidableObject::filterIdGenerator++; 107 int edgeID = InvalidableObject::edgeIdGenerator++; 108 109 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 110 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 111 112 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 113 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 114 115 116 if(CWorkflowGraph::build_begin) 117 { 118 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 119 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 120 121 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 122 } 123 else CWorkflowGraph::build_begin = true; 124 125 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 126 unique_filter_id = this->filterID; 138 127 } 139 else CWorkflowGraph::build_begin = true; 128 // not first round 129 else 130 { 131 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 132 if(data[0]->src_filterID != unique_filter_id) 133 { 134 int edgeID = InvalidableObject::edgeIdGenerator++; 135 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 136 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 137 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 138 } 139 140 141 } 140 142 } 141 143 … … 144 146 packet->timestamp = data[0]->timestamp; 145 147 packet->status = data[0]->status; 146 if(building_graph) packet->src_filterID = this->filterID;148 if(building_graph) packet->src_filterID = unique_filter_id; 147 149 packet->field = this->field; 148 150 … … 158 160 , op(operatorExpr.getOpFieldField(op)) 159 161 { 160 StdString input_op_expression=op; 161 if(input_op_expression == "add") 162 op_expression = "+"; 163 else if(input_op_expression == "minus") 164 op_expression = "-"; 165 else if(input_op_expression == "mult") 166 op_expression = "x"; 167 else if(input_op_expression == "div") 168 op_expression = "/"; 169 else if(input_op_expression == "pow") 170 op_expression = "^"; 171 else if(input_op_expression == "eq") 172 op_expression = "="; 173 else if(input_op_expression == "lt") 174 op_expression = "<"; 175 else if(input_op_expression == "gt") 176 op_expression = ">"; 177 else if(input_op_expression == "le") 178 op_expression = "<="; 179 else if(input_op_expression == "ge") 180 op_expression = ">="; 181 else if(input_op_expression == "ne") 182 op_expression = "!="; 183 else 184 op_expression = " "; 162 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 185 163 }; 186 164 … … 188 166 { 189 167 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 168 // bool building_graph = true; 169 int unique_filter_id; 190 170 191 171 if(building_graph) 192 { 193 194 this->filterID = InvalidableObject::filterIdGenerator++; 195 int edgeID = InvalidableObject::edgeIdGenerator++; 196 197 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 198 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 172 { 173 CWorkflowGraph::allocNodeEdge(); 199 174 200 175 std::cout<<"CFieldFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 201 176 202 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "F "+op_expression +" F Filter" ; 203 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2 ; 204 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1 ; 205 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2 ; 206 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date ; 207 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp ; 208 209 if(CWorkflowGraph::build_begin) 210 { 211 212 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 213 214 edgeID = InvalidableObject::edgeIdGenerator++; 215 216 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 217 218 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 219 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 177 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 178 179 // first round 180 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 181 { 182 this->filterID = InvalidableObject::filterIdGenerator++; 183 int edgeID = InvalidableObject::edgeIdGenerator++; 184 185 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 186 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 187 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 188 189 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 190 if(CWorkflowGraph::build_begin) 191 { 192 193 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 194 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 195 196 edgeID = InvalidableObject::edgeIdGenerator++; 197 198 CWorkflowGraph::addEdge(edgeID, this->filterID, data[1]); 199 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 200 201 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 202 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 203 } 204 CWorkflowGraph::build_begin = true; 205 206 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 207 unique_filter_id = this->filterID; 208 220 209 } 221 CWorkflowGraph::build_begin = true; 210 // not first round 211 else 212 { 213 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 214 if(data[0]->src_filterID != unique_filter_id) 215 { 216 int edgeID = InvalidableObject::edgeIdGenerator++; 217 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 218 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 219 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 220 } 221 if(data[1]->src_filterID != unique_filter_id) 222 { 223 int edgeID = InvalidableObject::edgeIdGenerator++; 224 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[1]); 225 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[1]->src_filterID].filter_filled = 0 ; 226 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 227 } 228 229 } 222 230 } 223 231 … … 226 234 packet->date = data[0]->date; 227 235 packet->timestamp = data[0]->timestamp; 228 if(building_graph) packet->src_filterID = this->filterID;236 if(building_graph) packet->src_filterID = unique_filter_id; 229 237 packet->field = this->field; 230 238 -
XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.hpp
r1677 r1680 24 24 CScalarFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value); 25 25 StdString virtual GetName(void); 26 26 27 27 28 protected: … … 54 55 StdString virtual GetName(void); 55 56 57 56 58 protected: 57 59 COperatorExpr::functionFieldScalar op; //!< The binary field-scalar operator attached to the binary arithmeric filter … … 82 84 StdString virtual GetName(void); 83 85 86 84 87 protected: 85 88 COperatorExpr::functionFieldField op; //!< The binary field-field operator attached to the binary arithmeric filter -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp
r1679 r1680 22 22 { 23 23 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph: false; 24 24 25 if(building_graph) 25 26 { … … 27 28 int edgeID = InvalidableObject::edgeIdGenerator++; 28 29 29 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 30 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 30 CWorkflowGraph::allocNodeEdge(); 31 31 32 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "File Writer Filter"; 33 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 4; 34 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 0; 35 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 36 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 37 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 32 CWorkflowGraph::addNode(this->filterID, "File Writer Filter \\n("+this->field->file->getId()+".nc)", 6, 0, 1, data[0]); 38 33 39 if(CXios::isClient) std::cout<<"CFileWriterFilter::apply filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 34 // (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->file->recordXiosAttributes(); 35 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 36 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 37 38 // if(CXios::isClient) std::cout<<"CFileWriterFilter::apply filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 40 39 41 40 if(CXios::isClient && CWorkflowGraph::build_begin) -
XIOS/dev/dev_trunk_omp/src/filter/filter.hpp
r1679 r1680 68 68 69 69 int filterID; 70 StdString op_expression;70 StdString expression; 71 71 72 72 protected: -
XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.cpp
r1679 r1680 8 8 int InvalidableObject::edgeIdGenerator = 0; 9 9 #pragma omp threadprivate(InvalidableObject::edgeIdGenerator) 10 11 int InvalidableObject::clusterIdGenerator = 0; 12 #pragma omp threadprivate(InvalidableObject::clusterIdGenerator) 10 13 11 14 void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp) -
XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.hpp
r1679 r1680 28 28 static int edgeIdGenerator; 29 29 #pragma omp threadprivate(edgeIdGenerator) 30 31 static int clusterIdGenerator; 32 #pragma omp threadprivate(clusterIdGenerator) 30 33 31 34 -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp
r1679 r1680 116 116 { 117 117 118 if(parent_filters[i]->start_graph==0) parent_filters[i]->start_graph = start_graph; 119 else if(parent_filters[i]->start_graph<0) parent_filters[i]->start_graph = start_graph; 118 if(parent_filters[i]->start_graph<0) parent_filters[i]->start_graph = start_graph; 120 119 else parent_filters[i]->start_graph = min(parent_filters[i]->start_graph, start_graph); 121 120 122 121 123 if(parent_filters[i]->end_graph==9223372036854775807) parent_filters[i]->end_graph = end_graph; 124 else if(parent_filters[i]->end_graph<0) parent_filters[i]->end_graph = end_graph; 122 if(parent_filters[i]->end_graph<0) parent_filters[i]->end_graph = end_graph; 125 123 else parent_filters[i]->end_graph = max(parent_filters[i]->end_graph, end_graph); 126 124 -
XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp
r1679 r1680 2 2 #include "workflow_graph.hpp" 3 3 #include "field.hpp" 4 #include "file.hpp" 4 5 5 6 namespace xios … … 16 17 if(building_graph) 17 18 { 18 std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl;19 // std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 19 20 this->filterID = InvalidableObject::filterIdGenerator++; 20 21 int edgeID = InvalidableObject::edgeIdGenerator++; 21 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>;22 22 23 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Pass Through Filter"; 24 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 5; 25 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 26 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 27 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 28 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 23 CWorkflowGraph::allocNodeEdge(); 29 24 30 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 25 CWorkflowGraph::addNode(this->filterID, "Pass Through Filter", 2, 1, 1, data[0]); 26 27 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 28 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 29 31 30 32 31 if(CWorkflowGraph::build_begin) -
XIOS/dev/dev_trunk_omp/src/filter/source_filter.cpp
r1679 r1680 71 71 packet->field = this->field; 72 72 73 74 73 if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 75 74 76 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 77 78 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Source Filter "+ this->field->getId(); 79 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 1; 80 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 81 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 0; 82 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = date; 83 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = packet->timestamp; 84 85 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge>; 75 CWorkflowGraph::allocNodeEdge(); 76 77 CWorkflowGraph::addNode(this->filterID, "Source Filter ", 1, 1, 0, packet); 78 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 79 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].field_id = this->field->getId(); 86 80 87 81 CWorkflowGraph::build_begin = true; -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp
r1679 r1680 9 9 #endif 10 10 #include "workflow_graph.hpp" 11 #include "file.hpp" 11 12 namespace xios 12 13 { … … 184 185 { 185 186 this->filterID = InvalidableObject::filterIdGenerator++; 186 int edgeID = InvalidableObject::edgeIdGenerator++; 187 188 std::cout<<"CSpatialTransformFilter::apply filter tag = "<<tag<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 189 190 191 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 192 193 194 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Spatial Transform Filter"; 195 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 6; 196 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 197 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 198 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 199 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 200 201 202 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 187 int edgeID = InvalidableObject::edgeIdGenerator++; 188 189 CWorkflowGraph::allocNodeEdge(); 190 191 CWorkflowGraph::addNode(this->filterID, "Spatial Transform Filter", 4, 1, 1, data[0]); 192 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = field->recordXiosAttributes(); 193 if(field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +field->file->recordXiosAttributes(); 194 203 195 204 196 if(CWorkflowGraph::build_begin) … … 229 221 if (0 != packet->data.numElements()) 230 222 (packet->data)(0) = defaultValue; 231 apply(data[0]->data, packet->data, this->filterID); 223 if(building_graph) apply(data[0]->data, packet->data, this->filterID); 224 else apply(data[0]->data, packet->data); 232 225 } 233 226 … … 354 347 int srcRank = itRecv->first; 355 348 356 if(filterID >=0) (*CWorkflowGraph::mapFilters_ptr_with_info)[filterID].transform_type = (*itAlgo)->getName(); 349 if(filterID >=0) 350 { 351 (*CWorkflowGraph::mapFilters_ptr_with_info)[filterID].filter_name = (*itAlgo)->getName(); 352 } 357 353 if (srcRank != rank) 358 354 { -
XIOS/dev/dev_trunk_omp/src/filter/store_filter.cpp
r1679 r1680 3 3 #include "grid.hpp" 4 4 #include "timer.hpp" 5 #include "file.hpp" 5 6 6 7 namespace xios … … 98 99 int edgeID = InvalidableObject::edgeIdGenerator++; 99 100 100 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 101 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 101 CWorkflowGraph::allocNodeEdge(); 102 103 CWorkflowGraph::addNode(this->filterID, "Store Filter", 4, 1, 1, data[0]); 104 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 105 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 102 106 103 104 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Store Filter"; 105 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 4; 106 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 107 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 108 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 109 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 110 111 if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl; 107 // if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl; 112 108 113 109 if(CXios::isClient && CWorkflowGraph::build_begin) -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
r1679 r1680 3 3 #include "calendar_util.hpp" 4 4 #include "workflow_graph.hpp" 5 #include "file.hpp" 5 6 6 7 namespace xios … … 28 29 // , nextOperationDate(initDate + opFreq + this->samplingOffset) 29 30 , isFirstOperation(true) 31 , temp_op(opId) 30 32 { 31 33 } … … 34 36 { 35 37 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 36 38 37 39 if(building_graph) 38 40 { 39 if(this->filterIDoutputs.size()==0) this->filterID = InvalidableObject::filterIdGenerator++;40 41 int edgeID = InvalidableObject::edgeIdGenerator++; 41 42 43 std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<<" start = "<<this->start_graph<<" end = "<<this->end_graph<<std::endl; 44 45 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 42 43 CWorkflowGraph::allocNodeEdge(); 46 44 47 45 if(CWorkflowGraph::build_begin) 48 46 { 49 50 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 51 52 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 53 } 54 55 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 56 57 if(this->filterIDoutputs.size()==0) 58 { 59 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "Temporal Filter"; 60 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 3; 61 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 62 // (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = (initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth) / data[0]->date +1 ; 63 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb =-1; 64 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 65 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 66 } 67 68 69 this->filterIDoutputs.push_back(data[0]->src_filterID); 47 CWorkflowGraph::addEdge(edgeID, -1, data[0]); 48 } 49 this->filterIDoutputs_pair.push_back(make_pair(edgeID, data[0]->src_filterID)); 70 50 } 71 51 … … 101 81 if (outputResult) 102 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 } 102 103 104 103 105 nbOperationDates ++; 104 106 if (!copyLess) … … 117 119 118 120 isFirstOperation = false; 121 122 packet->field = this->field; 119 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) 135 { 136 bool building_graph=this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 137 138 if(building_graph) 139 { 140 if(this->filterIDoutputs.size()==0) this->filterID = InvalidableObject::filterIdGenerator++; 141 int edgeID = InvalidableObject::edgeIdGenerator++; 142 143 // std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<<" start = "<<this->start_graph<<" end = "<<this->end_graph<<std::endl; 144 145 CWorkflowGraph::allocNodeEdge(); 146 147 if(this->filterIDoutputs.size()==0) 148 { 149 CWorkflowGraph::addNode(this->filterID, "Temporal Filter\\n("+this->temp_op+")", 5, 1, 0, data[0]); 150 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].transform_type = this->temp_op; 151 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = false ; 152 } 153 154 if(CWorkflowGraph::build_begin) 155 { 156 157 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 158 159 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 160 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb += 1 ; 161 } 162 163 164 this->filterIDoutputs.push_back(data[0]->src_filterID); 165 } 166 167 168 CDataPacketPtr packet; 169 170 if (data[0]->status != CDataPacket::END_OF_STREAM) 171 { 172 bool usePacket, outputResult, copyLess; 173 if (isOnceOperation) 174 usePacket = outputResult = copyLess = isFirstOperation; 175 else 176 { 177 usePacket = (data[0]->date >= nextSamplingDate); 178 outputResult = (data[0]->date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 179 copyLess = (isInstantOperation && usePacket && outputResult); 180 } 181 182 if (usePacket) 183 { 184 nbSamplingDates ++; 185 if (!copyLess) 186 { 187 if (!tmpData.numElements()) 188 tmpData.resize(data[0]->data.numElements()); 189 190 (*functor)(data[0]->data); 191 } 192 193 nextSamplingDate = ((initDate + offsetMonth) + nbSamplingDates * samplingFreq) + offsetAllButMonth + initDate.getRelCalendar().getTimeStep(); 194 } 195 196 if (outputResult) 197 { 198 nbOperationDates ++; 199 if (!copyLess) 200 { 201 functor->final(); 202 203 packet = CDataPacketPtr(new CDataPacket); 204 packet->date = data[0]->date; 205 packet->timestamp = data[0]->timestamp; 206 packet->status = data[0]->status; 207 packet->data.resize(tmpData.numElements()); 208 packet->data = tmpData; 209 } 210 else 211 packet = data[0]; 212 213 isFirstOperation = false; 214 120 215 packet->field = this->field; 216 if(building_graph) packet->src_filterID=this->filterID; 121 217 if(building_graph) this->filterIDoutputs.clear(); 122 218 if(building_graph) CWorkflowGraph::build_begin=true; 219 if(building_graph) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].inputs_complete = true ; 123 220 } 124 221 } -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.hpp
r1679 r1680 40 40 */ 41 41 CDataPacketPtr virtual apply(std::vector<CDataPacketPtr> data); 42 CDataPacketPtr virtual apply_old(std::vector<CDataPacketPtr> data); 42 43 43 44 /*! … … 54 55 */ 55 56 bool virtual isDataExpected(const CDate& date) const; 56 std::vector<int> filterIDoutputs; 57 std::vector<int > filterIDoutputs; 58 std::vector<std::pair<int, int> > filterIDoutputs_pair; 59 60 StdString temp_op; 57 61 58 62 private: -
XIOS/dev/dev_trunk_omp/src/filter/ternary_arithmetic_filter.cpp
r1679 r1680 1 1 #include "ternary_arithmetic_filter.hpp" 2 2 #include "workflow_graph.hpp" 3 #include "yacc_var.hpp" 3 4 4 5 namespace xios … … 9 10 , value1(value1) 10 11 , value2(value2) 11 { /* Nothing to do */ }; 12 { 13 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 14 /* Nothing to do */ 15 }; 12 16 13 17 CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) … … 20 24 int edgeID = InvalidableObject::edgeIdGenerator++; 21 25 22 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 23 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 26 CWorkflowGraph::allocNodeEdge(); 24 27 25 28 std::cout<<"CScalarScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 26 29 27 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "SSF Filter"; 28 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 29 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 30 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 31 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 32 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 30 31 32 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 33 33 34 34 … … 61 61 , value1(value1) 62 62 , value2(value2) 63 { /* Nothing to do */ }; 63 { 64 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 65 /* Nothing to do */ 66 }; 64 67 65 68 CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) … … 73 76 74 77 75 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 76 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 78 CWorkflowGraph::allocNodeEdge(); 77 79 78 80 std::cout<<"CScalarFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 79 81 80 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "SFS Filter"; 81 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 82 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 83 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 84 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 85 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 82 83 84 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 86 85 87 86 if(CWorkflowGraph::build_begin) … … 111 110 , op(operatorExpr.getOpScalarFieldField(op)) 112 111 , value(value) 113 { /* Nothing to do */ }; 112 { 113 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 114 /* Nothing to do */ 115 }; 114 116 115 117 CDataPacketPtr CScalarFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) … … 123 125 124 126 125 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 126 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 127 CWorkflowGraph::allocNodeEdge(); 127 128 128 129 std::cout<<"CScalarFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 129 130 130 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "SFF Filter"; 131 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 132 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 133 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2; 134 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 135 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 131 132 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]); 136 133 137 134 if(CWorkflowGraph::build_begin) … … 177 174 , value1(value1) 178 175 , value2(value2) 179 { /* Nothing to do */ }; 176 { 177 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 178 /* Nothing to do */ 179 }; 180 180 181 181 CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) … … 189 189 190 190 191 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 192 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 191 CWorkflowGraph::allocNodeEdge(); 193 192 194 193 std::cout<<"CFieldScalarScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 195 194 196 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FSS Filter"; 197 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 198 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 199 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 200 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 201 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 195 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 1, data[0]); 202 196 203 197 if(CWorkflowGraph::build_begin) … … 229 223 , op(operatorExpr.getOpFieldScalarField(op)) 230 224 , value(value) 231 { /* Nothing to do */ }; 225 { 226 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 227 /* Nothing to do */ 228 }; 232 229 233 230 CDataPacketPtr CFieldScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) … … 241 238 242 239 243 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 244 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 240 CWorkflowGraph::allocNodeEdge(); 245 241 246 242 std::cout<<"CFieldScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 247 243 248 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FSF Filter"; 249 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 250 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 251 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2; 252 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 253 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 244 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]); 254 245 255 246 if(CWorkflowGraph::build_begin) … … 291 282 , op(operatorExpr.getOpFieldFieldScalar(op)) 292 283 , value(value) 293 { /* Nothing to do */ }; 284 { 285 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 286 std::cout<<"expression = "<<expression; 287 /* Nothing to do */ 288 }; 294 289 295 290 CDataPacketPtr CFieldFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) … … 302 297 int edgeID = InvalidableObject::edgeIdGenerator++; 303 298 304 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 305 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 299 CWorkflowGraph::allocNodeEdge(); 306 300 307 301 std::cout<<"CFieldFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 308 302 309 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FFS Filter"; 310 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 311 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 312 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 2; 313 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 314 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 303 304 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 2, data[0]); 315 305 316 306 if(CWorkflowGraph::build_begin) … … 352 342 : CFilter(gc, 3, this) 353 343 , op(operatorExpr.getOpFieldFieldField(op)) 354 { /* Nothing to do */ }; 344 { 345 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 346 /* Nothing to do */ 347 }; 355 348 356 349 CDataPacketPtr CFieldFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) … … 364 357 365 358 366 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 367 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 359 CWorkflowGraph::allocNodeEdge(); 368 360 369 361 std::cout<<"CFieldFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 370 362 371 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "FFF Filter"; 372 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 373 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 374 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 3; 375 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 376 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 363 364 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 3, data[0]); 377 365 378 366 if(CWorkflowGraph::build_begin) -
XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.cpp
r1679 r1680 1 1 #include "unary_arithmetic_filter.hpp" 2 2 #include "workflow_graph.hpp" 3 #include "yacc_var.hpp" 4 #include "file.hpp" 5 3 6 namespace xios 4 7 { … … 7 10 , op(operatorExpr.getOpField(op)) 8 11 { 9 StdString input_op_expression=op; 10 if(input_op_expression == "neg") 11 op_expression = "-"; 12 else if(input_op_expression == "sin") 13 op_expression = "sin"; 14 else if(input_op_expression == "cos") 15 op_expression = "cos"; 16 else if(input_op_expression == "tan") 17 op_expression = "tan"; 18 else if(input_op_expression == "exp") 19 op_expression = "exp"; 20 else if(input_op_expression == "log") 21 op_expression = "log"; 22 else if(input_op_expression == "log10") 23 op_expression = "log10"; 24 else if(input_op_expression == "sqrt") 25 op_expression = "sqrt"; 26 else 27 op_expression = " "; 12 expression.assign(*yacc_globalInputText_ptr, 0, yacc_globalInputText_ptr->size()-1); 28 13 }; 29 14 … … 31 16 { 32 17 bool building_graph = this->tag ? data[0]->timestamp >= this->start_graph && data[0]->timestamp <= this->end_graph : false; 33 18 int unique_filter_id; 19 34 20 if(building_graph) 35 21 { 36 this->filterID = InvalidableObject::filterIdGenerator++; 37 int edgeID = InvalidableObject::edgeIdGenerator++; 22 CWorkflowGraph::allocNodeEdge(); 23 size_t filterhash = std::hash<StdString>{}(expression+to_string(data[0]->timestamp)+this->field->getId()); 24 25 // first round 26 if(CWorkflowGraph::mapHashFilterID_ptr->find(filterhash) == CWorkflowGraph::mapHashFilterID_ptr->end()) 27 { 28 this->filterID = InvalidableObject::filterIdGenerator++; 29 int edgeID = InvalidableObject::edgeIdGenerator++; 30 31 CWorkflowGraph::addNode(this->filterID, "Arithmetic Filter\\n("+expression+")", 3, 1, 0, data[0]); 32 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_tag = this->tag; 33 34 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->recordXiosAttributes(); 35 if(this->field->file) (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->recordXiosAttributes(); 38 36 39 if(CWorkflowGraph::mapFieldToFilters_ptr_with_info==0) CWorkflowGraph::mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >;40 if(CWorkflowGraph::mapFilters_ptr_with_info==0) CWorkflowGraph::mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>;37 if(CWorkflowGraph::build_begin) 38 { 41 39 42 std::cout<<"CunaryArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 40 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 41 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb ++; 43 42 44 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_name = "F Filter"; 45 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_class = 2; 46 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].filter_filled = 1; 47 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].expected_entry_nb = 1; 48 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].date = data[0]->date; 49 (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].timestamp = data[0]->timestamp; 43 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 44 } 45 else CWorkflowGraph::build_begin = true; 50 46 51 if(CWorkflowGraph::build_begin) 47 (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash] = this->filterID; 48 unique_filter_id = this->filterID; 49 } 50 else 52 51 { 53 54 CWorkflowGraph::addEdge(edgeID, this->filterID, data[0]); 55 56 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 57 } 58 else CWorkflowGraph::build_begin = true; 52 unique_filter_id = (*CWorkflowGraph::mapHashFilterID_ptr)[filterhash]; 53 if(data[0]->src_filterID != unique_filter_id) 54 { 55 int edgeID = InvalidableObject::edgeIdGenerator++; 56 CWorkflowGraph::addEdge(edgeID, unique_filter_id, data[0]); 57 (*CWorkflowGraph::mapFilters_ptr_with_info)[data[0]->src_filterID].filter_filled = 0 ; 58 (*CWorkflowGraph::mapFilters_ptr_with_info)[unique_filter_id].expected_entry_nb ++; 59 } 60 61 62 } 59 63 60 64 } … … 69 73 packet->data.reference(op(data[0]->data)); 70 74 71 if(building_graph) packet->src_filterID = this->filterID;75 if(building_graph) packet->src_filterID = unique_filter_id; 72 76 73 77 return packet; 74 78 } 75 79 } // namespace xios 80 -
XIOS/dev/dev_trunk_omp/src/graphviz.cpp
r1679 r1680 72 72 { 73 73 CWorkflowGraph::buildStaticWorkflow_with_info(); 74 75 StdString color_table[7] = {"black", "red", "blue", "green", "purple", "yellow", "gray"}; 74 76 75 77 std::ofstream fs_json; 76 78 fs_json.open ("graph_data.json", std::fstream::out); 77 79 78 fs_json << "{ \"node\" : ["<<std::endl; 80 fs_json << "{\"nodes\":["<<std::endl<<" "; 81 static bool firstnode=true; 82 static bool firstedge=true; 79 83 80 84 for (auto it=CWorkflowGraph::mapFilters_ptr_with_info->begin(); it != CWorkflowGraph::mapFilters_ptr_with_info->end(); it++) 81 85 { 82 fs_json << " {\"id\": "<<it->first +1<<"}, "<<std::endl; 83 fs_json << " {\"label\": \""<<it->second.filter_name<<"\"}, "<<std::endl ; 84 fs_json << " {\"class\": "<<it->second.filter_class<<"}, "<<std::endl ; 85 fs_json << " {\"filled\": "<<it->second.filter_filled<<"}, "<<std::endl ; 86 fs_json << " {\"entry\": "<<it->second.expected_entry_nb<<"}, "<<std::endl ; 87 // fs_json << " {\"date\": \""<<it->second.date<<"\"}, "<<std::endl ; 88 fs_json << " {\"type\": \""<<it->second.transform_type<<"\"}, "<<std::endl ; 86 if(firstnode) 87 { 88 fs_json << "{\"id\": "<<it->first +1<<", "<<std::endl; 89 firstnode = false; 90 } 91 else 92 { 93 fs_json << ",{\"id\": "<<it->first +1<<", "<<std::endl; 94 } 95 if(it->second.filter_class == 1) // source filter 96 fs_json << " \"label\": \""<<it->second.filter_name<<"\\n("<<it->second.field_id<<")\", "<<std::endl; 97 else 98 fs_json << " \"label\": \""<<it->second.filter_name<<"\", "<<std::endl; 99 fs_json << " \"class\": \""<<it->second.filter_class<<"\", "<<std::endl; 100 fs_json << " \"filled\": \""<<it->second.filter_filled<<"\", "<<std::endl; 101 fs_json << " \"type\": \""<<it->second.transform_type<<"\", "<<std::endl; 102 fs_json << " \"entry\": \""<<it->second.expected_entry_nb<<"\", "<<std::endl; 103 fs_json << " \"inputs\": \""<<it->second.inputs_complete<<"\", "<<std::endl; 104 fs_json << " \"tag\": \""<<it->second.filter_tag<<"\", "<<std::endl; 105 if(it->second.clusterID != -1) fs_json << " \"cid\": \""<<it->second.clusterID<<"\", "<<std::endl; 106 fs_json << " \"attributes\": \""<<it->second.attributes<<"\"}"<<std::endl<<" "; 89 107 } 90 fs_json << " ]}"<<std::endl<<std::endl; 91 92 fs_json << "{ \"edge\" : ["<<std::endl; 108 fs_json << " ],"<<std::endl; 109 110 111 fs_json << " \"edges\" : ["<<std::endl<<" "; 93 112 94 113 for (auto it=CWorkflowGraph::mapFieldToFilters_ptr_with_info->begin(); it != CWorkflowGraph::mapFieldToFilters_ptr_with_info->end(); it++) 95 114 { 96 fs_json << " {\"id\": "<<it->first +1<<"}, "<<std::endl; 97 fs_json << " {\"from\": "<<it->second.from +1<<"}, "<<std::endl; 98 fs_json << " {\"to\": "<<it->second.to+1<<"}, "<<std::endl ; 99 fs_json << " {\"fid\": \""<<it->second.field_id<<"\"}, "<<std::endl ; 100 fs_json << " {\"fname\": \""<<it->second.field_name<<"\"}, "<<std::endl ; 101 fs_json << " {\"gid\": \""<<it->second.grid_id<<"\"}, "<<std::endl ; 102 fs_json << " {\"date\": \""<<it->second.date<<"\"}, "<<std::endl ; 115 if(firstedge) 116 { 117 fs_json << "{\"id\": "<<it->first +1<<", "<<std::endl; 118 firstedge = false; 119 } 120 else 121 { 122 fs_json << ",{\"id\": "<<it->first +1<<", "<<std::endl; 123 } 124 fs_json << " \"from\": "<<it->second.from+1<<", "<<std::endl; 125 fs_json << " \"to\": "<<it->second.to+1<<", "<<std::endl; 126 fs_json << " \"label\": \""<<it->second.field_id<<"\\n"<<it->second.date<<"\", "<<std::endl; 127 // fs_json << " \"title\": \""<<"Show more information about this field"<<"\", "<<std::endl; 128 // fs_json << " \"fid\": \""<<it->second.field_id<<"\", "<<std::endl; 129 // fs_json << " \"fname\": \""<<it->second.field_name<<"\", "<<std::endl; 130 // fs_json << " \"gid\": \""<<it->second.grid_id<<"\", "<<std::endl; 131 fs_json << " \"date\": \""<<it->second.date<<"\", "<<std::endl; 132 fs_json << " \"attributes\": \"id = "<<it->second.field_id<<"</br>"<<it->second.attributes<<"\"}"<<std::endl<<" "; 133 103 134 } 104 fs_json << " ]}"<<std::endl <<std::endl;135 fs_json << " ]}"<<std::endl; 105 136 106 137 … … 114 145 115 146 116 std::ofstream fs; 117 fs.open ("graph_with_info.html", std::fstream::out); 118 119 fs << "<html>" <<std::endl; 120 fs << "<head>" <<std::endl; 121 fs << " <script type=\"text/javascript\" src=\"../../../vis-4.21.0/dist/vis.js\"></script>" <<std::endl; 122 fs << " <link href=\"../../../vis-4.21.0/dist/vis.css\" rel=\"stylesheet\" type=\"text/css\" />" <<std::endl <<std::endl; 123 fs << " <style type=\"text/css\">"<<std::endl; 124 fs << " #mynetwork {"<<std::endl; 125 fs << " width: 1000px;"<<std::endl; 126 fs << " height: 800px;"<<std::endl; 127 fs << " border: 1px solid lightgray"<<std::endl; 128 fs << " }"<<std::endl; 129 fs << " </style>"<<std::endl; 130 fs << "</head>"<<std::endl; 131 fs << "<body>"<<std::endl; 132 fs << "<div id=\"mynetwork\"></div>"<<std::endl<<std::endl; 133 fs << "<script type=\"text/javascript\">"<<std::endl; 134 135 fs << " var nodes = new vis.DataSet(["<<std::endl; 136 for(int i=0; i<CWorkflowGraph::filters.size(); i++) 137 { 138 fs << " {id: "<<i+1<<", label: \'"<<CWorkflowGraph::filters[i]<<"\'},"<<std::endl ; 139 } 140 fs << " ]);"<<std::endl<<std::endl; 141 142 143 fs << " var edges = new vis.DataSet(["<<std::endl; 144 for(int i=0; i<CWorkflowGraph::fieldsToFilters.size(); i++) 145 { 146 fs <<" {from: "<<CWorkflowGraph::fieldsToFilters[i].first+1<<", to: "<<CWorkflowGraph::fieldsToFilters[i].second+1<<", label: \'"<<CWorkflowGraph::fields[i]<<"\'},"<<std::endl; 147 } 148 fs << " ]);"<<std::endl<<std::endl; 147 // std::ofstream fs; 148 // fs.open ("graph_with_info.html", std::fstream::out); 149 150 // fs << "<html>" <<std::endl; 151 // fs << "<head>" <<std::endl; 152 // fs << " <script type=\"text/javascript\" src=\"../../../vis-4.21.0/dist/vis.js\"></script>" <<std::endl; 153 // fs << " <link href=\"../../../vis-4.21.0/dist/vis.css\" rel=\"stylesheet\" type=\"text/css\" />" <<std::endl <<std::endl; 154 // fs << " <style type=\"text/css\">"<<std::endl; 155 // fs << " #mynetwork {"<<std::endl; 156 // fs << " width: 1000px;"<<std::endl; 157 // fs << " height: 800px;"<<std::endl; 158 // fs << " border: 1px solid lightgray"<<std::endl; 159 // fs << " }"<<std::endl; 160 // fs << " </style>"<<std::endl; 161 // fs << "</head>"<<std::endl; 162 // fs << "<body>"<<std::endl; 163 // fs << "<div id=\"mynetwork\"></div>"<<std::endl<<std::endl; 164 // fs << "<script type=\"text/javascript\">"<<std::endl; 165 166 // fs << " var nodes = new vis.DataSet(["<<std::endl; 167 // for(int i=0; i<CWorkflowGraph::filters.size(); i++) 168 // { 169 // StdString color_table[7] = {"black", "red", "blue", "green", "purple", "yellow", "gray"}; 170 171 // fs << " {id: "<<i+1<<", label: \'"<<CWorkflowGraph::filters[i]<<"\', title: \'"<<"Show more information about this filter"<<"\'"; 172 // fs <<", color: \'"<<color_table[(*CWorkflowGraph::mapFilters_ptr_with_info)[i].filter_class]<<"\'},"<<std::endl ; 173 // } 174 // fs << " ]);"<<std::endl<<std::endl; 175 176 177 // fs << " var edges = new vis.DataSet(["<<std::endl; 178 // for(int i=0; i<CWorkflowGraph::fieldsToFilters.size(); i++) 179 // { 180 // fs <<" {from: "<<CWorkflowGraph::fieldsToFilters[i].first+1<<", to: "<<CWorkflowGraph::fieldsToFilters[i].second+1<<", label: \'"<<CWorkflowGraph::fields[i]<<"\', title: \'"<<"Show more information about this field"<<"\'},"<<std::endl ; 181 // } 182 // fs << " ]);"<<std::endl<<std::endl; 149 183 150 184 151 fs << " var container = document.getElementById(\'mynetwork\');" <<std::endl<<std::endl;152 fs << " var data = {" <<std::endl;153 fs << " nodes: nodes," <<std::endl;154 fs << " edges: edges" <<std::endl;155 fs << " };" <<std::endl;156 fs << " var options = {"<<std::endl;157 fs << " edges:{"<<std::endl;158 fs << " smooth: false,"<<std::endl;159 fs << " arrows: \'to\',"<<std::endl;160 fs << " color: 'red',"<<std::endl;161 fs << " font:{align: \'middle\'},"<<std::endl;162 fs << " },"<<std::endl;163 fs << " physics:{"<<std::endl;164 fs << " enabled: false,"<<std::endl;165 fs << " },"<<std::endl;166 fs << "};" <<std::endl<<std::endl;167 168 fs << " var network = new vis.Network(container, data, options);" <<std::endl<<std::endl;169 170 fs << "</script>"<<std::endl;171 fs << "</body>"<<std::endl;172 fs << "</html>"<<std::endl;185 // fs << " var container = document.getElementById(\'mynetwork\');" <<std::endl<<std::endl; 186 // fs << " var data = {" <<std::endl; 187 // fs << " nodes: nodes," <<std::endl; 188 // fs << " edges: edges" <<std::endl; 189 // fs << " };" <<std::endl; 190 // fs << " var options = {"<<std::endl; 191 // fs << " edges:{"<<std::endl; 192 // fs << " smooth: false,"<<std::endl; 193 // fs << " arrows: \'to\',"<<std::endl; 194 // fs << " color: 'red',"<<std::endl; 195 // fs << " font:{align: \'middle\'},"<<std::endl; 196 // fs << " },"<<std::endl; 197 // fs << " physics:{"<<std::endl; 198 // fs << " enabled: false,"<<std::endl; 199 // fs << " },"<<std::endl; 200 // fs << "};" <<std::endl<<std::endl; 201 202 // fs << " var network = new vis.Network(container, data, options);" <<std::endl<<std::endl; 203 204 // fs << "</script>"<<std::endl; 205 // fs << "</body>"<<std::endl; 206 // fs << "</html>"<<std::endl; 173 207 174 208 175 209 176 fs.close();210 // fs.close(); 177 211 178 212 } -
XIOS/dev/dev_trunk_omp/src/node/field.cpp
r1679 r1680 922 922 TRY 923 923 { 924 924 925 CContext* context = CContext::getCurrent(); 925 926 bool hasClient = context->hasClient; … … 1200 1201 { 1201 1202 CField* fieldRef = CField::get(field_ref); 1202 fieldRef->build_workflow_graph.setValue(buildWorkflowGraph);1203 1203 CGrid* gridRef = fieldRef->grid; 1204 1204 … … 1236 1236 else if (!field_ref.isEmpty()) 1237 1237 { 1238 CField::get(field_ref)->build_workflow_graph.setValue(buildWorkflowGraph);1239 1238 instantDataFilter = getFieldReference(gc); 1240 1239 instantDataFilter->tag = buildWorkflowGraph; … … 1297 1296 fileWriterFilter->end_graph = filter_end; 1298 1297 1299 std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<std::endl;1298 // std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<" field = "<<this->getId()<<std::endl; 1300 1299 1301 1300 } … … 1368 1367 filters.second->parent_filters[0]= fieldRef->getInstantDataFilter(); 1369 1368 1370 filters.second->tag = buildWorkflowGraph || filters.second->parent_filters[0]->tag;1369 filters.second->tag = (buildWorkflowGraph || filters.second->parent_filters[0]->tag); 1371 1370 1372 1371 filters.second->start_graph = filter_start; … … 1528 1527 1529 1528 const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true); 1530 bool buildWorkflowGraph = buildWorkflowGraph =(!build_workflow_graph.isEmpty() && build_workflow_graph == true);1529 bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1531 1530 std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 1532 1531 CContext::getCurrent()->getCalendar()->getInitDate(), -
XIOS/dev/dev_trunk_omp/src/parse_expr/filter_expr_node.cpp
r1677 r1680 106 106 std::shared_ptr<COutputPin> CFilterUnaryOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 107 107 { 108 std::shared_ptr<COutputPin> ch = child->reduce(gc, thisField); 109 108 110 std::shared_ptr<CUnaryArithmeticFilter> filter(new CUnaryArithmeticFilter(gc, opId)); 109 child->reduce(gc, thisField)->connectOutput(filter, 0); 110 111 (filter->parent_filters).resize(1); 112 (filter->parent_filters)[0] = child->reduce(gc, thisField); 111 ch->connectOutput(filter, 0); 112 113 (filter->parent_filters).resize(1); 114 (filter->parent_filters)[0] = ch; 115 116 filter->tag = ch->tag; 117 filter->start_graph = ch->start_graph; 118 filter->end_graph = ch->end_graph; 119 filter->field = &thisField; 120 113 121 114 122 return filter; … … 127 135 std::shared_ptr<COutputPin> CFilterScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 128 136 { 137 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 129 138 std::shared_ptr<CScalarFieldArithmeticFilter> filter(new CScalarFieldArithmeticFilter(gc, opId, child1->reduce())); 130 ch ild2->reduce(gc, thisField)->connectOutput(filter, 0);139 ch2->connectOutput(filter, 0); 131 140 132 141 (filter->parent_filters).resize(1); 133 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 142 (filter->parent_filters)[0] = ch2; 143 144 filter->tag = ch2->tag; 145 filter->start_graph = ch2->start_graph; 146 filter->end_graph = ch2->end_graph; 147 filter->field = &thisField; 134 148 135 149 return filter; … … 148 162 std::shared_ptr<COutputPin> CFilterFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 149 163 { 164 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 165 150 166 std::shared_ptr<CFieldScalarArithmeticFilter> filter(new CFieldScalarArithmeticFilter(gc, opId, child2->reduce())); 151 child1->reduce(gc, thisField)->connectOutput(filter, 0); 152 153 (filter->parent_filters).resize(1); 154 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 167 ch1->connectOutput(filter, 0); 168 169 (filter->parent_filters).resize(1); 170 (filter->parent_filters)[0] = ch1; 171 172 filter->tag = ch1->tag; 173 filter->start_graph = ch1->start_graph; 174 filter->end_graph = ch1->end_graph; 175 filter->field = &thisField; 176 155 177 return filter; 156 178 } … … 168 190 std::shared_ptr<COutputPin> CFilterFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 169 191 { 192 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 193 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 194 170 195 std::shared_ptr<CFieldFieldArithmeticFilter> filter(new CFieldFieldArithmeticFilter(gc, opId)); 171 ch ild1->reduce(gc, thisField)->connectOutput(filter, 0);172 ch ild2->reduce(gc, thisField)->connectOutput(filter, 1);196 ch1->connectOutput(filter, 0); 197 ch2->connectOutput(filter, 1); 173 198 174 199 (filter->parent_filters).resize(2); 175 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 176 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 200 (filter->parent_filters)[0] = ch1; 201 (filter->parent_filters)[1] = ch2; 202 203 filter->tag = (ch1->tag || ch2->tag); 204 filter->start_graph = ch1->tag? ch1->start_graph : (ch2->tag? ch2->start_graph: -1); 205 filter->end_graph = ch1->tag? ch1->end_graph : (ch2->tag? ch2->end_graph: -1); 206 filter->field = &thisField; 207 208 177 209 return filter; 178 210 } … … 194 226 std::shared_ptr<COutputPin> CFilterScalarScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 195 227 { 228 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 229 196 230 std::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); 197 ch ild3->reduce(gc, thisField)->connectOutput(filter, 0);231 ch3->connectOutput(filter, 0); 198 232 199 233 (filter->parent_filters).resize(1); 200 (filter->parent_filters)[0] = child3->reduce(gc, thisField); 234 (filter->parent_filters)[0] = ch3; 235 236 filter->tag = ch3->tag; 237 filter->start_graph = ch3->start_graph; 238 filter->end_graph = ch3->end_graph; 239 filter->field = &thisField; 201 240 202 241 return filter; … … 217 256 std::shared_ptr<COutputPin> CFilterScalarFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 218 257 { 258 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 259 219 260 std::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); 220 child2->reduce(gc, thisField)->connectOutput(filter, 0); 221 222 (filter->parent_filters).resize(1); 223 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 261 ch2->connectOutput(filter, 0); 262 263 (filter->parent_filters).resize(1); 264 (filter->parent_filters)[0] = ch2; 265 266 filter->tag = ch2->tag; 267 filter->start_graph = ch2->start_graph; 268 filter->end_graph = ch2->end_graph; 269 filter->field = &thisField; 270 224 271 return filter; 225 272 } … … 239 286 std::shared_ptr<COutputPin> CFilterScalarFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 240 287 { 288 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 289 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 290 241 291 std::shared_ptr<CScalarFieldFieldArithmeticFilter> filter(new CScalarFieldFieldArithmeticFilter(gc, opId, child1->reduce())); 242 ch ild2->reduce(gc, thisField)->connectOutput(filter, 0);243 ch ild3->reduce(gc, thisField)->connectOutput(filter, 1);292 ch2->connectOutput(filter, 0); 293 ch3->connectOutput(filter, 1); 244 294 245 295 (filter->parent_filters).resize(2); 246 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 247 (filter->parent_filters)[1] = child3->reduce(gc, thisField); 296 (filter->parent_filters)[0] = ch2; 297 (filter->parent_filters)[1] = ch3; 298 299 filter->tag = (ch3->tag || ch2->tag); 300 filter->start_graph = ch3->tag? ch3->start_graph : (ch2->tag? ch2->start_graph: -1); 301 filter->end_graph = ch3->tag? ch3->end_graph : (ch2->tag? ch2->end_graph: -1); 302 filter->field = &thisField; 248 303 249 304 return filter; … … 265 320 std::shared_ptr<COutputPin> CFilterFieldScalarScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 266 321 { 322 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 323 267 324 std::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); 268 child1->reduce(gc, thisField)->connectOutput(filter, 0); 269 270 (filter->parent_filters).resize(1); 271 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 325 ch1->connectOutput(filter, 0); 326 327 (filter->parent_filters).resize(1); 328 (filter->parent_filters)[0] = ch1; 329 330 filter->tag = ch1->tag; 331 filter->start_graph = ch1->start_graph; 332 filter->end_graph = ch1->end_graph; 333 filter->field = &thisField; 334 272 335 return filter; 273 336 } … … 288 351 std::shared_ptr<COutputPin> CFilterFieldScalarFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 289 352 { 353 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 354 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 355 290 356 std::shared_ptr<CFieldScalarFieldArithmeticFilter> filter(new CFieldScalarFieldArithmeticFilter(gc, opId, child2->reduce())); 291 ch ild1->reduce(gc, thisField)->connectOutput(filter, 0);292 ch ild3->reduce(gc, thisField)->connectOutput(filter, 1);357 ch1->connectOutput(filter, 0); 358 ch3->connectOutput(filter, 1); 293 359 294 360 (filter->parent_filters).resize(2); 295 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 296 (filter->parent_filters)[1] = child3->reduce(gc, thisField); 361 (filter->parent_filters)[0] = ch1; 362 (filter->parent_filters)[1] = ch3; 363 364 filter->tag = (ch3->tag || ch1->tag); 365 filter->start_graph = ch3->tag? ch3->start_graph : (ch1->tag? ch1->start_graph: -1); 366 filter->end_graph = ch3->tag? ch3->end_graph : (ch1->tag? ch1->end_graph: -1); 367 filter->field = &thisField; 297 368 298 369 return filter; … … 314 385 std::shared_ptr<COutputPin> CFilterFieldFieldScalarOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 315 386 { 387 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 388 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 389 316 390 std::shared_ptr<CFieldFieldScalarArithmeticFilter> filter(new CFieldFieldScalarArithmeticFilter(gc, opId, child3->reduce())); 317 ch ild1->reduce(gc, thisField)->connectOutput(filter, 0);318 ch ild2->reduce(gc, thisField)->connectOutput(filter, 1);391 ch1->connectOutput(filter, 0); 392 ch2->connectOutput(filter, 1); 319 393 320 394 (filter->parent_filters).resize(2); 321 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 322 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 395 (filter->parent_filters)[0] = ch1; 396 (filter->parent_filters)[1] = ch2; 397 398 filter->tag = (ch2->tag || ch1->tag); 399 filter->start_graph = ch2->tag? ch2->start_graph : (ch1->tag? ch1->start_graph: -1); 400 filter->end_graph = ch2->tag? ch2->end_graph : (ch1->tag? ch1->end_graph: -1); 401 filter->field = &thisField; 323 402 return filter; 324 403 } … … 338 417 std::shared_ptr<COutputPin> CFilterFieldFieldFieldOpExprNode::reduce(CGarbageCollector& gc, CField& thisField) const 339 418 { 419 std::shared_ptr<COutputPin> ch1 = child1->reduce(gc, thisField); 420 std::shared_ptr<COutputPin> ch2 = child2->reduce(gc, thisField); 421 std::shared_ptr<COutputPin> ch3 = child3->reduce(gc, thisField); 422 340 423 std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId)); 341 child1->reduce(gc, thisField)->connectOutput(filter, 0); 342 child2->reduce(gc, thisField)->connectOutput(filter, 1); 343 child3->reduce(gc, thisField)->connectOutput(filter, 2); 424 std::cout<<"std::shared_ptr<CFieldFieldFieldArithmeticFilter> filter(new CFieldFieldFieldArithmeticFilter(gc, opId))" <<std::endl; 425 ch1->connectOutput(filter, 0); 426 ch2->connectOutput(filter, 1); 427 ch3->connectOutput(filter, 2); 344 428 345 429 (filter->parent_filters).resize(3); 346 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 347 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 348 (filter->parent_filters)[2] = child3->reduce(gc, thisField); 430 (filter->parent_filters)[0] = ch1; 431 (filter->parent_filters)[1] = ch2; 432 (filter->parent_filters)[2] = ch3; 433 434 435 filter->tag = (ch1->tag || ch1->tag || ch3->tag); 436 filter->start_graph = ch1->tag? ch1->start_graph : (ch2->tag? ch2->start_graph: (ch3->tag? ch3->start_graph: -1)); 437 filter->end_graph = ch1->tag? ch1->end_graph : (ch2->tag? ch2->end_graph: (ch3->tag? ch3->end_graph: -1)); 438 filter->field = &thisField; 439 349 440 350 441 return filter; -
XIOS/dev/dev_trunk_omp/src/parse_expr/yacc_parser.cpp
r1601 r1680 70 70 #include "exception.hpp" 71 71 72 #include "yacc_var.hpp" 73 72 74 using namespace std; 73 75 using namespace xios; … … 86 88 #pragma omp threadprivate(parsed, globalInputText_ptr, globalReadOffset) 87 89 90 91 std::string *xios::yacc_globalInputText_ptr = 0; 92 // #pragma omp threadprivate(xios::yacc_globalInputText_ptr) 93 88 94 int readInputForLexer(char* buffer, size_t* numBytesRead, size_t maxBytesToRead) 89 95 { 96 yacc_globalInputText_ptr = globalInputText_ptr; 97 98 std::cout<<"========= yacc_globalInputText_ptr = "<<*yacc_globalInputText_ptr<<std::endl; 90 99 if(globalInputText_ptr == 0) globalInputText_ptr = new std::string; 91 100 size_t numBytesToRead = maxBytesToRead; -
XIOS/dev/dev_trunk_omp/src/parse_expr/yacc_parser.hpp
r1158 r1680 92 92 int yyparse (void); 93 93 94 94 95 #endif /* !YY_YY_YACC_PARSER_HPP_INCLUDED */ -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_duplicate_scalar.hpp
r1314 r1680 33 33 static bool registerTrans(); 34 34 35 virtual StdString getName() {return "Axis Trans. Filter \\n Duplicate Scalar";} 36 35 37 protected: 36 38 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_extract.hpp
r1558 r1680 27 27 28 28 static bool registerTrans(); 29 30 virtual StdString getName() {return "Axis Trans. Filter \\n Extract";} 31 29 32 protected: 30 33 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_extract_domain.hpp
r1601 r1680 40 40 41 41 static bool registerTrans(); 42 43 virtual StdString getName() {return "Axis Trans. Filter \\n Extract Domain";} 44 42 45 protected: 43 46 enum ExtractDirection { -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_interpolate.hpp
r933 r1680 32 32 33 33 static bool registerTrans(); 34 35 virtual StdString getName() {return "Axis Trans. Filter \\n Interpolation";} 36 34 37 protected: 35 38 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_inverse.hpp
r933 r1680 31 31 static bool registerTrans(); 32 32 33 virtual StdString getName() {return "Axis Trans. Filter \\n Inverse";} 34 33 35 protected: 34 36 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_axis.hpp
r1601 r1680 40 40 41 41 static bool registerTrans(); 42 43 virtual StdString getName() {return "Axis Trans. Filter \\n Reduce Axis";} 42 44 protected: 43 45 -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_domain.hpp
r1601 r1680 41 41 42 42 static bool registerTrans(); 43 44 virtual StdString getName() {return "Axis Trans. Filter \\n Reduce Domain";} 45 43 46 protected: 44 47 enum ReduceDirection { -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_temporal_splitting.hpp
r1275 r1680 34 34 static bool registerTrans(); 35 35 36 virtual StdString getName() {return "Axis Trans. Filter \\n Temporal Splitting";} 37 36 38 protected: 37 39 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_transformation.hpp
r1275 r1680 31 31 virtual ~CAxisAlgorithmTransformation(); 32 32 33 virtual StdString getName() {return "Axis Trans. Filter \\n Transformation";} 34 33 35 protected: 34 36 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_zoom.hpp
r1559 r1680 27 27 28 28 static bool registerTrans(); 29 30 virtual StdString getName() {return "Axis Trans. Filter \\n Zoom";} 31 29 32 protected: 30 33 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_compute_connectivity.hpp
r944 r1680 28 28 29 29 static bool registerTrans(); 30 31 virtual StdString getName() {return "Domain Trans. Filter \\n Compute Connectivity";} 32 30 33 protected: 31 34 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_expand.hpp
r1158 r1680 28 28 29 29 static bool registerTrans(); 30 31 virtual StdString getName() {return "Domain Trans. Filter \\n Expand";} 30 32 31 33 protected: -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_extract.hpp
r1549 r1680 23 23 24 24 static bool registerTrans(); 25 26 virtual StdString getName() {return "Domain Trans. Filter \\n Extract";} 25 27 protected: 26 28 void updateDomainAttributes(); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_generate_rectilinear.hpp
r1410 r1680 33 33 virtual ~CDomainAlgorithmGenerateRectilinear() {} 34 34 35 virtual StdString getName() {return "Domain Trans. Filter \\n Generate Rectilinear";} 36 35 37 protected: 36 38 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.hpp
r1601 r1680 39 39 40 40 static bool registerTrans(); 41 42 virtual StdString getName() {return "Domain Trans. Filter \\n Interpolation";} 43 41 44 protected: 42 45 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_reorder.hpp
r1457 r1680 26 26 static bool registerTrans(); 27 27 28 virtual StdString getName() {return "Domain Trans. Filter \\n Reorder";} 29 28 30 protected: 29 31 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_transformation.hpp
r888 r1680 27 27 virtual ~CDomainAlgorithmTransformation(); 28 28 29 virtual StdString getName() {return "Domain Trans. Filter \\n Transformation";} 30 29 31 protected: 30 32 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >&); -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_zoom.hpp
r1553 r1680 23 23 24 24 static bool registerTrans(); 25 26 virtual StdString getName() {return "Domain Trans. Filter \\n Zoom";} 25 27 protected: 26 28 void updateDomainAttributes(); -
XIOS/dev/dev_trunk_omp/src/transformation/generic_algorithm_transformation.hpp
r1679 r1680 74 74 bool ignoreMissingValue, bool firstPass); 75 75 76 virtual StdString getName() {return "Generic algorithm transformation";}76 virtual StdString getName() {return "Generic Trans. Filter";} 77 77 78 78 /*! -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_extract_axis.hpp
r1601 r1680 40 40 static bool registerTrans(); 41 41 42 virtual StdString getName() {return "Scalar Trans. Filter \\n Extract Axis";} 43 42 44 protected: 43 45 int pos_; -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_axis.hpp
r1601 r1680 41 41 42 42 static bool registerTrans(); 43 44 virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Axis";} 45 43 46 protected: 44 47 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_domain.hpp
r1601 r1680 41 41 42 42 static bool registerTrans(); 43 44 virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Domain";} 45 43 46 protected: 44 47 bool local ; -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_scalar.hpp
r1601 r1680 36 36 37 37 static bool registerTrans(); 38 39 virtual StdString getName() {return "Scalar Trans. Filter \\n Reduce Scalar";} 40 38 41 protected: 39 42 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_transformation.hpp
r888 r1680 31 31 virtual ~CScalarAlgorithmTransformation(); 32 32 33 virtual StdString getName() {return "Scalar Trans. Filter \\n Transformation";} 34 33 35 protected: 34 36 void computeIndexSourceMapping_(const std::vector<CArray<double,1>* >& dataAuxInputs); -
XIOS/dev/dev_trunk_omp/src/workflow_graph.cpp
r1679 r1680 9 9 std::unordered_map <int, graph_info_box_edge > *CWorkflowGraph::mapFieldToFilters_ptr_with_info = 0; 10 10 #pragma omp threadprivate(CWorkflowGraph::mapFieldToFilters_ptr_with_info) 11 12 std::unordered_map <size_t, int> *CWorkflowGraph::mapHashFilterID_ptr = 0; 13 #pragma omp threadprivate(CWorkflowGraph::mapHashFilterID_ptr) 11 14 12 15 … … 121 124 122 125 126 void CWorkflowGraph::addNode(int nodeID, StdString filterName, int filterClass, bool filterFilled, int entry_nb, CDataPacketPtr packet) 127 TRY 128 { 129 (*mapFilters_ptr_with_info)[nodeID].filter_name = filterName; 130 (*mapFilters_ptr_with_info)[nodeID].filter_class = filterClass; 131 (*mapFilters_ptr_with_info)[nodeID].filter_filled = filterFilled; 132 (*mapFilters_ptr_with_info)[nodeID].expected_entry_nb = entry_nb; 133 (*mapFilters_ptr_with_info)[nodeID].date = packet->date; 134 (*mapFilters_ptr_with_info)[nodeID].timestamp = packet->timestamp; 135 } 136 CATCH 137 138 139 123 140 void CWorkflowGraph::addEdge(int edgeID, int toID, CDataPacketPtr packet) 124 141 TRY … … 131 148 (*mapFieldToFilters_ptr_with_info)[edgeID].date = packet->date; 132 149 (*mapFieldToFilters_ptr_with_info)[edgeID].timestamp = packet->timestamp; 150 (*mapFieldToFilters_ptr_with_info)[edgeID].field = packet->field; 151 (*mapFieldToFilters_ptr_with_info)[edgeID].attributes = packet->field->recordXiosAttributes(); 152 } 153 CATCH 154 155 156 void CWorkflowGraph::allocNodeEdge() 157 TRY 158 { 159 if(mapFilters_ptr_with_info==0) mapFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_node>; 160 if(mapFieldToFilters_ptr_with_info==0) mapFieldToFilters_ptr_with_info = new std::unordered_map <int, graph_info_box_edge >; 161 if(mapHashFilterID_ptr==0) mapHashFilterID_ptr = new std::unordered_map <size_t, int >; 133 162 } 134 163 CATCH -
XIOS/dev/dev_trunk_omp/src/workflow_graph.hpp
r1679 r1680 12 12 namespace xios 13 13 { 14 class CField; 14 15 15 16 struct graph_info_box_node … … 23 24 Time timestamp; 24 25 StdString transform_type; 26 StdString attributes; 27 StdString field_id; 28 bool inputs_complete; 29 int filter_tag; 30 int clusterID; 25 31 }; 26 32 … … 34 40 CDate date; 35 41 Time timestamp; 42 CField *field; 43 StdString attributes; 36 44 37 45 }; … … 60 68 #pragma omp threadprivate(mapFieldToFilters_ptr_with_info) 61 69 70 static std::unordered_map <size_t, int> *mapHashFilterID_ptr; 71 #pragma omp threadprivate(mapHashFilterID_ptr) 72 62 73 63 74 static bool build_begin; 64 75 #pragma omp threadprivate(build_begin) 65 76 77 static void addNode(int nodeID, StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet); 66 78 static void addEdge(int edgeID, int toID, CDataPacketPtr packet); 79 static void allocNodeEdge(); 67 80 68 81 private:
Note: See TracChangeset
for help on using the changeset viewer.