Changeset 1677
- Timestamp:
- 06/25/19 16:14:54 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp
- Files:
-
- 53 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/inputs/COMPLETE/context_atmosphere.xml
r1671 r1677 9 9 10 10 <file_definition type="one_file" par_access="collective" output_freq="6h" sync_freq="6h" output_level="10" enabled=".TRUE."> 11 <file id="output_atmosphere" name="output_atmosphere"> 12 <field field_ref="field_A_atm" build_workflow_graph=".TRUE."/> 13 <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom" build_workflow_graph=".TRUE."/> 11 <file id="output_atmosphere" name="output_atmosphere" enabled=".FALSE." > 12 <field field_ref="field_A_atm" enabled=".TRUE."/> 14 13 </file> 15 <file id="output_atmosphere_zoom" name="output_atmosphere_zoom"> 16 <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom" build_workflow_graph=".FALSE."/> 14 <file id="output_atmosphere_zoom" name="output_atmosphere_zoom" enabled=".FALSE."> 15 <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom" /> 16 <!-- <field field_ref="field_A_atm" name="field_A_atm_zoom2" operation="average" freq_op="1ts" grid_ref="grid_A_atm_zoom" build_workflow_graph=".TRUE."/> --> 17 17 </file> 18 18 </file_definition> -
XIOS/dev/dev_trunk_omp/inputs/COMPLETE/context_surface.xml
r1671 r1677 4 4 5 5 <field_definition level="1" enabled=".TRUE." domain_ref="domain_srf" axis_ref="axis_srf" operation="average" freq_op="1ts" default_value="9.96921e+36" prec="4"> 6 <field id="field_A_srf" name="field_A_srf" long_name="Champ en degC" operation="average" unit="degC" />6 <field id="field_A_srf" name="field_A_srf" long_name="Champ en degC" operation="average" unit="degC" build_workflow_graph=".FALSE." /> 7 7 <field id="field_A_srf_2" field_ref="field_A_srf" /> 8 8 <field id="field_A_srf_K" name="field_A_srf_K" field_ref="field_A_srf" long_name="Champ en degK" unit="degK"> field_A_srf + 273.15 </field> … … 12 12 </field_definition> 13 13 14 <file_definition type="one_file" par_access="collective" output_level="10" enabled=". TRUE.">14 <file_definition type="one_file" par_access="collective" output_level="10" enabled=".FALSE."> 15 15 <file id="output_surface" name="output_surface_6h" output_freq="6h"> 16 <field field_ref="field_A_srf" build_workflow_graph=".FALSE.">16 <field field_ref="field_A_srf" > 17 17 <variable id="my_attribute1" type="string">surf_att</variable> 18 18 <variable id="my_attribute2" type="int"> 10 </variable> … … 20 20 <variable id="my_attribute5" type="double">100.201</variable> 21 21 </field> 22 <field field_ref="field_A_srf_K" build_workflow_graph=".FALSE."/>23 <field field_ref="field_A_srf_K_2" name="field_A_srf_K_2" build_workflow_graph=".FALSE."/> <!-- Should be identical to field_A_srf_K -->24 <field field_ref="field_A_srf_K" name="field_A_srf_K_3" build_workflow_graph=".FALSE.">field_A_srf_K</field> <!-- Should be identical to field_A_srf_K -->25 <field field_ref="field_A_srf_K_2" name="field_A_srf_K_max_mean" build_workflow_graph=".FALSE."long_name="Maximum of hourly average over 6h" operation="maximum" freq_op="1h"> @field_A_srf_K </field>26 <field field_ref="field_A_srf" name="field_A_srf_min" operation="minimum" build_workflow_graph=".FALSE."/>27 <field field_ref="field_A_srf_2" name="field_A_srf_min_2" operation="minimum" build_workflow_graph=".FALSE."/> <!-- Should be identical to field_A_srf_min -->28 <field field_ref="field_A_srf " name="field_A_srf_max" operation="maximum" build_workflow_graph=".FALSE."/>29 <field field_ref="field_A_srf" name="field_A_srf_prec4" prec="8" build_workflow_graph=".FALSE."/>30 <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" build_workflow_graph=".FALSE."long_name="Average of hourly maximum over 6h" operation="average" freq_op="1h"> @field_A_srf_max </field>31 <variable id="my_global_attribute" type="string">file_6h</variable> 22 <!-- <field field_ref="field_A_srf_K" /> 23 <field field_ref="field_A_srf_K_2" name="field_A_srf_K_2" /> 24 <field field_ref="field_A_srf_K" name="field_A_srf_K_3" >field_A_srf_K</field> 25 <field field_ref="field_A_srf_K_2" name="field_A_srf_K_max_mean" long_name="Maximum of hourly average over 6h" operation="maximum" freq_op="1h"> @field_A_srf_K </field> 26 <field field_ref="field_A_srf" name="field_A_srf_min" operation="minimum" /> 27 <field field_ref="field_A_srf_2" name="field_A_srf_min_2" operation="minimum" /> 28 <field field_ref="field_A_srf_max" name="field_A_srf_max" operation="maximum" /> 29 <field field_ref="field_A_srf" name="field_A_srf_prec4" prec="8" /> 30 <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" long_name="Average of hourly maximum over 6h" operation="average" freq_op="1h"> @field_A_srf_max </field> 31 <variable id="my_global_attribute" type="string">file_6h</variable> --> 32 32 </file> 33 33 34 <file type="one_file" id="output_surface_1d" name="output_surface_1d" output_freq="1d" enabled=" TRUE">35 <field field_ref="field_A_srf" indexed_output="TRUE" build_workflow_graph=". FALSE.">34 <file type="one_file" id="output_surface_1d" name="output_surface_1d" output_freq="1d" enabled=".TRUE."> 35 <field field_ref="field_A_srf" indexed_output="TRUE" build_workflow_graph=".TRUE."> 36 36 <variable id="my_attribute1" type="string">surf_att</variable> 37 37 <variable id="my_attribute2" type="int">10</variable> … … 39 39 <variable id="my_attribute4" type="double">100.201</variable> 40 40 </field> 41 <field field_ref="field_A_srf_K" build_workflow_graph=". FALSE."/>41 <field field_ref="field_A_srf_K" build_workflow_graph=".TRUE."/> 42 42 <field field_ref="field_A_srf" name="field_A_srf_min" operation="minimum" build_workflow_graph=".FALSE." /> 43 43 <field field_ref="field_A_srf" name="field_A_srf_max" operation="maximum" build_workflow_graph=".FALSE."/> 44 44 <field field_ref="field_A_srf" name="field_A_srf_prec4" prec="8" build_workflow_graph=".FALSE."/> 45 <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" build_workflow_graph=". FALSE." long_name="Average of hourly maximum over 1d" operation="average" freq_op="1h"> @field_A_srf_max </field>45 <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" build_workflow_graph=".TRUE." long_name="Average of hourly maximum over 1d" operation="average" freq_op="1h"> @field_A_srf_max </field> 46 46 <variable id="my_global_attribute" type="string" >file_1d</variable> 47 47 </file> -
XIOS/dev/dev_trunk_omp/inputs/REMAP/iodef.xml
r1671 r1677 37 37 <field field_ref="src_field_2D" name="field_dst_regular_0" build_workflow_graph=".TRUE." domain_ref="dst_domain_regular_pole" default_value="10.e+5"/> 38 38 <field field_ref="dst_field_2D" name="field_dst_regular_1" build_workflow_graph=".TRUE."/> 39 <field field_ref="dst_field_2D_regular_pole" name="field_dst_regular_2" build_workflow_graph=". TRUE."/>40 <field field_ref="dst_field_2D_clone" name="field_dst_regular_3" build_workflow_graph=". TRUE."/>39 <field field_ref="dst_field_2D_regular_pole" name="field_dst_regular_2" build_workflow_graph=".FALSE."/> 40 <field field_ref="dst_field_2D_clone" name="field_dst_regular_3" build_workflow_graph=".FALSE."/> 41 41 </file> 42 42 <file id="output_3D" name="output_3D" > 43 <field field_ref="src_field_3D" name="field_src" build_workflow_graph=". TRUE."/>44 <field field_ref="src_field_3D_pression" name="field" build_workflow_graph=". TRUE."/>45 <field field_ref="dst_field_3D_interp" name="field_dst_interp_domain" build_workflow_graph=". TRUE."/>46 <field field_ref="dst_field_3D_interp" name="field_dst_interp_domain_axis" domain_ref="dst_domain_regular_pole" build_workflow_graph=". TRUE."/>43 <field field_ref="src_field_3D" name="field_src" build_workflow_graph=".FALSE."/> 44 <field field_ref="src_field_3D_pression" name="field" build_workflow_graph=".FALSE."/> 45 <field field_ref="dst_field_3D_interp" name="field_dst_interp_domain" build_workflow_graph=".FALSE."/> 46 <field field_ref="dst_field_3D_interp" name="field_dst_interp_domain_axis" domain_ref="dst_domain_regular_pole" build_workflow_graph=".FALSE."/> 47 47 </file> 48 48 <file id="output_4D" name="output_4D" > -
XIOS/dev/dev_trunk_omp/inputs/iodef.xml
r1671 r1677 8 8 <field_definition level="1" enabled=".TRUE."> 9 9 <field id="field_A" operation="average" freq_op="3600s" grid_ref="grid_A"/> 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"/> 10 12 <field id="field_Axis" operation="average" freq_op="3600s" axis_ref="axis_A"/> 11 13 <field id="field_Domain" operation="average" freq_op="3600s" domain_ref="domain_A"/> … … 18 20 <file id="output" name="output" enabled=".TRUE."> 19 21 <!-- <field field_ref="field_Domain" name="field_A" /> --> 20 <field field_ref="field_A" name="field_A" build_workflow_graph=".TRUE." /> 21 <field field_ref="field_A_zoom" name="field_B" build_workflow_graph=".TRUE."/> 22 <field field_ref="field_A" name="field_A_name" enabled=".TRUE." build_workflow_graph=".TRUE." /> 23 <field field_ref="field_B" name="field_B_name" enabled=".TRUE." build_workflow_graph=".FALSE."/> 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=".FALSE." name="field_D_name" enabled=".TRUE."> field_A + field_B</field> 26 <field id="field_E" field_ref="field_A" operation="instant" build_workflow_graph=".FALSE." name="field_E_name" enabled=".TRUE."> field_D </field> 27 <!-- <field field_ref="field_A_zoom" name="field_B" build_workflow_graph=".TRUE."/> --> 22 28 </file> 23 29 <file id="output1" name="output1" enabled=".TRUE."> 24 30 <!-- <field field_ref="field_Domain" name="field_A" /> --> 25 <field field_ref="field_A" name="field_A_dup" build_workflow_graph=".TRUE."/>31 <field id="field_F" field_ref="field_A" name="field_A_zoom" grid_ref="grid_A_zoom" build_workflow_graph=".TRUE."/> 26 32 </file> 27 <file id="output2" name="output2" enabled=". TRUE.">33 <file id="output2" name="output2" enabled=".FALSE."> 28 34 <!-- <field field_ref="field_Domain" name="field_A" /> --> 29 35 <field field_ref="field_Scalar" name="field_A_scalar" build_workflow_graph=".TRUE."/> -
XIOS/dev/dev_trunk_omp/src/cxios.cpp
r1671 r1677 173 173 delete globalRegistry ; 174 174 175 CGraphviz::showStaticWorkflowGraph();175 // CGraphviz::showStaticWorkflowGraph(); 176 176 CGraphviz::buildStaticWorkflowGraph(); 177 177 178 StdString commande_string="dot -Tpdf graph.dot -o graph.pdf"; 179 const char* command=commande_string.c_str(); 180 system(command); 181 182 178 183 } 179 184 -
XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.cpp
r804 r1677 1 1 #include "binary_arithmetic_filter.hpp" 2 #include "workflow_graph.hpp" 2 3 3 4 namespace xios … … 7 8 , op(operatorExpr.getOpScalarField(op)) 8 9 , value(value) 9 { /* Nothing to do */ }; 10 { 11 StdString input_op_expression=op; 12 if(input_op_expression == "add") 13 op_expression = "+"; 14 else if(input_op_expression == "minus") 15 op_expression = "-"; 16 else if(input_op_expression == "mult") 17 op_expression = "x"; 18 else if(input_op_expression == "div") 19 op_expression = "/"; 20 else if(input_op_expression == "eq") 21 op_expression = "="; 22 else if(input_op_expression == "lt") 23 op_expression = "<"; 24 else if(input_op_expression == "gt") 25 op_expression = ">"; 26 else if(input_op_expression == "le") 27 op_expression = "<="; 28 else if(input_op_expression == "ge") 29 op_expression = ">="; 30 else if(input_op_expression == "ne") 31 op_expression = "!="; 32 else 33 op_expression = " "; 34 }; 10 35 11 36 CDataPacketPtr CScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 12 37 { 38 if(this->tag) 39 { 40 this->filterID = InvalidableObject::filterIdGenerator++; 41 42 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 43 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 44 45 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "S "+op_expression +" F Filter" ; 46 std::cout<<"CScalarFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 47 48 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 49 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 50 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 51 } 52 13 53 CDataPacketPtr packet(new CDataPacket); 14 54 packet->date = data[0]->date; 15 55 packet->timestamp = data[0]->timestamp; 16 56 packet->status = data[0]->status; 57 if(this->tag) packet->src_filterID = this->filterID; 58 packet->fieldID = this->output_field_id; 17 59 18 60 if (packet->status == CDataPacket::NO_ERROR) … … 26 68 , op(operatorExpr.getOpFieldScalar(op)) 27 69 , value(value) 28 { /* Nothing to do */ }; 70 { 71 StdString input_op_expression=op; 72 if(input_op_expression == "add") 73 op_expression = "+"; 74 else if(input_op_expression == "minus") 75 op_expression = "-"; 76 else if(input_op_expression == "mult") 77 op_expression = "x"; 78 else if(input_op_expression == "div") 79 op_expression = "/"; 80 else if(input_op_expression == "pow") 81 op_expression = "^"; 82 else if(input_op_expression == "eq") 83 op_expression = "="; 84 else if(input_op_expression == "lt") 85 op_expression = "<"; 86 else if(input_op_expression == "gt") 87 op_expression = ">"; 88 else if(input_op_expression == "le") 89 op_expression = "<="; 90 else if(input_op_expression == "ge") 91 op_expression = ">="; 92 else if(input_op_expression == "ne") 93 op_expression = "!="; 94 else 95 op_expression = " "; 96 }; 29 97 30 98 CDataPacketPtr CFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 31 99 { 100 if(this->tag) 101 { 102 this->filterID = InvalidableObject::filterIdGenerator++; 103 104 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 105 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 106 107 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "F "+op_expression +" S Filter" ; 108 std::cout<<"CFieldScalarArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 109 110 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 111 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 112 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 113 } 114 32 115 CDataPacketPtr packet(new CDataPacket); 33 116 packet->date = data[0]->date; 34 117 packet->timestamp = data[0]->timestamp; 35 118 packet->status = data[0]->status; 119 if(this->tag) packet->src_filterID = this->filterID; 120 packet->fieldID = this->output_field_id; 121 36 122 37 123 if (packet->status == CDataPacket::NO_ERROR) … … 44 130 : CFilter(gc, 2, this) 45 131 , op(operatorExpr.getOpFieldField(op)) 46 { /* Nothing to do */ }; 132 { 133 StdString input_op_expression=op; 134 if(input_op_expression == "add") 135 op_expression = "+"; 136 else if(input_op_expression == "minus") 137 op_expression = "-"; 138 else if(input_op_expression == "mult") 139 op_expression = "x"; 140 else if(input_op_expression == "div") 141 op_expression = "/"; 142 else if(input_op_expression == "pow") 143 op_expression = "^"; 144 else if(input_op_expression == "eq") 145 op_expression = "="; 146 else if(input_op_expression == "lt") 147 op_expression = "<"; 148 else if(input_op_expression == "gt") 149 op_expression = ">"; 150 else if(input_op_expression == "le") 151 op_expression = "<="; 152 else if(input_op_expression == "ge") 153 op_expression = ">="; 154 else if(input_op_expression == "ne") 155 op_expression = "!="; 156 else 157 op_expression = " "; 158 }; 47 159 48 160 CDataPacketPtr CFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 49 161 { 162 if(this->tag) 163 { 164 165 this->filterID = InvalidableObject::filterIdGenerator++; 166 167 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 168 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 169 170 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "F "+op_expression +" F Filter" ; 171 std::cout<<"CFieldFieldArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 172 173 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 174 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 175 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 176 177 str = data[1]->fieldID +" ts=" + to_string(data[0]->timestamp); 178 179 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[1]->src_filterID); 180 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 181 } 182 183 50 184 CDataPacketPtr packet(new CDataPacket); 51 185 packet->date = data[0]->date; 52 186 packet->timestamp = data[0]->timestamp; 187 if(this->tag) packet->src_filterID = this->filterID; 188 packet->fieldID = this->output_field_id; 189 53 190 54 191 if (data[0]->status != CDataPacket::NO_ERROR) … … 64 201 return packet; 65 202 } 203 204 StdString CScalarFieldArithmeticFilter::GetName(void) { return StdString("CScalarFieldArithmeticFilter"); } 205 StdString CFieldScalarArithmeticFilter::GetName(void) { return StdString("CFieldScalarArithmeticFilter"); } 206 StdString CFieldFieldArithmeticFilter::GetName(void) { return StdString("CFieldFieldArithmeticFilter"); } 207 208 66 209 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.hpp
r1542 r1677 23 23 */ 24 24 CScalarFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value); 25 StdString virtual GetName(void); 25 26 26 27 protected: … … 51 52 */ 52 53 CFieldScalarArithmeticFilter(CGarbageCollector& gc, const std::string& op, double value); 54 StdString virtual GetName(void); 53 55 54 56 protected: … … 78 80 */ 79 81 CFieldFieldArithmeticFilter(CGarbageCollector& gc, const std::string& op); 82 StdString virtual GetName(void); 80 83 81 84 protected: -
XIOS/dev/dev_trunk_omp/src/filter/data_packet.hpp
r1542 r1677 26 26 Time timestamp; //!< Timestamp of the data 27 27 StatusCode status; //!< Status of the packet 28 28 int src_filterID; 29 std::vector<int> filterIDoutputs; 30 StdString fieldID; 31 29 32 /*! 30 33 * Creates a deep copy of the packet. -
XIOS/dev/dev_trunk_omp/src/filter/file_server_writer_filter.cpp
r1668 r1677 16 16 void CFileServerWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 17 17 { 18 if(CXios::isClient) 19 std::cout<<"CFileServerWriterFilter::onInputReady"<<std::endl; 18 20 field->writeUpdateData(data[0]->data); 19 21 } … … 29 31 } 30 32 31 int CFileServerWriterFilter::getFilterId(void)32 {33 return filterId;34 }35 33 36 34 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/file_server_writer_filter.hpp
r1668 r1677 37 37 bool virtual isDataExpected(const CDate& date) const; 38 38 39 /*!40 * Returns filter's id needed in case of building workflow graph41 */42 int getFilterId();43 39 44 40 protected: -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp
r1671 r1677 4 4 #include "utils.hpp" 5 5 #include "workflow_graph.hpp" 6 #include "graphviz.hpp" 7 8 using namespace ep_lib; 6 9 7 10 namespace xios … … 14 17 ERROR("CFileWriterFilter::CFileWriterFilter(CField* field)", 15 18 "The field cannot be null."); 16 if (buildWorkflowGraph)17 {18 filterId = InvalidableObject::count;19 InvalidableObject::count++;20 }21 19 } 22 20 23 21 void CFileWriterFilter::onInputReady(std::vector<CDataPacketPtr> data) 24 22 { 23 if(this->tag) 24 { 25 this->filterID = InvalidableObject::filterIdGenerator++; 26 27 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 28 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 29 30 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "File Writer Filter"; 31 32 if(CXios::isClient) std::cout<<"CFileWriterFilter::apply filter tag = "<<this->tag<<std::endl; 33 34 if(CXios::isClient) 35 { 36 StdString str = this->output_field_id +" ts=" + to_string(data[0]->timestamp); 37 // StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 38 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 39 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 40 } 41 } 42 25 43 const bool detectMissingValue = ( !field->default_value.isEmpty() && 26 44 ( (!field->detect_missing_value.isEmpty() || field->detect_missing_value == true) … … 41 59 42 60 field->sendUpdateData(dataArray); 61 62 63 43 64 } 44 65 … … 53 74 } 54 75 55 int CFileWriterFilter::getFilterId(void) 56 { 57 return filterId; 58 } 76 59 77 60 78 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.hpp
r1671 r1677 15 15 { 16 16 public: 17 int tag; 18 StdString output_field_id; 17 19 /*! 18 20 * Constructs the filter (with one input slot) associated to the specified field … … 43 45 bool virtual isDataExpected(const CDate& date) const; 44 46 45 /*! 46 * Returns filter's id needed in case of building workflow graph 47 */ 48 int getFilterId(); 47 48 int filterID; 49 49 50 50 51 protected: … … 59 60 CField* field; //<! The associated field 60 61 std::map<Time, CDataPacketPtr> packets; //<! The stored packets 61 int filterId; //<! Filter's id needed in case of building a workflow62 62 63 63 }; // class CFileWriterFilter -
XIOS/dev/dev_trunk_omp/src/filter/filter.cpp
r1668 r1677 14 14 void CFilter::onInputReady(std::vector<CDataPacketPtr> data) 15 15 { 16 // std::cout<<"CFilter::onInputReady"<<std::endl; 16 17 CDataPacketPtr outputPacket = engine->apply(data); 17 18 if (outputPacket) 19 { 20 // std::cout<<"Filter onOutputReady"<<std::endl; 18 21 onOutputReady(outputPacket); 22 } 19 23 } 20 24 … … 52 56 return COutputPin::isDataExpected(date); 53 57 } 58 59 54 60 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/filter.hpp
r1668 r1677 65 65 bool virtual isDataExpected(const CDate& date) const; 66 66 67 68 69 70 int filterID; 71 StdString op_expression; 72 67 73 protected: 68 74 IFilterEngine* engine; //!< The filter engine, might be the filter itself -
XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.cpp
r1668 r1677 3 3 namespace xios 4 4 { 5 6 int InvalidableObject::count = 0; 7 #pragma omp threadprivate(InvalidableObject::count) 5 int InvalidableObject::filterIdGenerator = 0; 6 #pragma omp threadprivate(InvalidableObject::filterIdGenerator) 8 7 9 8 void CGarbageCollector::registerObject(InvalidableObject* Object, Time timestamp) -
XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.hpp
r1671 r1677 21 21 void virtual invalidate(Time timestamp) = 0; 22 22 23 static int count; //!< Counter used to identify a filter in case building workflow graph 24 #pragma omp threadprivate(count) 23 24 25 static int filterIdGenerator; 26 #pragma omp threadprivate(filterIdGenerator) 27 28 25 29 26 30 }; // struct InvalidableObject -
XIOS/dev/dev_trunk_omp/src/filter/input_pin.cpp
r1668 r1677 12 12 , triggers(slotsCount) 13 13 , hasTriggers(false) 14 { } 14 { 15 // parent_filters = new std::list< std::shared_ptr<COutputPin> >; 16 } 15 17 16 18 StdString CInputPin::GetName(void) … … 42 44 gc.unregisterObject(this, packet->timestamp); 43 45 onInputReady(it->second.packets); 46 //if(CXios::isClient) std::cout<<"setInput timestamp = "<<packet->timestamp<<std::endl; 44 47 inputs.erase(it); 45 48 } … … 84 87 } 85 88 86 int CInputPin::getFilterId(void) 87 { 88 return -1; 89 } 89 90 91 90 92 91 93 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/input_pin.hpp
r1668 r1677 18 18 { 19 19 public: 20 20 21 /*! 21 22 * Constructs an input pin with the specified number of slots … … 82 83 void virtual invalidate(Time timestamp); 83 84 84 /*!85 * Returns filter's id needed in case of building workflow graph86 * This function should never be called from this class, instead functions defined in derived classes or in class COutputPin should be used87 */88 int virtual getFilterId();89 85 90 86 protected: -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp
r1671 r1677 5 5 namespace xios 6 6 { 7 8 7 9 COutputPin::COutputPin(CGarbageCollector& gc, bool manualTrigger /*= false*/, bool buildWorkflowGraph /* =false */) 8 10 : gc(gc) … … 10 12 , buildWorkflowGraph(buildWorkflowGraph) 11 13 { 12 if (buildWorkflowGraph) 13 { 14 filterId = InvalidableObject::count; 15 InvalidableObject::count++; 16 } 14 // parent_filter = new std::vector< void >(0); 17 15 } 18 16 … … 40 38 "The packet cannot be null."); 41 39 42 if (buildWorkflowGraph) 43 { 44 if(CWorkflowGraph::mapFilterTimestamps_ptr==0) CWorkflowGraph::mapFilterTimestamps_ptr = new std::unordered_map <int, vector<Time> >; 45 if(CWorkflowGraph::timestamps_ptr==0) CWorkflowGraph::timestamps_ptr = new set<Time>; 46 (*CWorkflowGraph::mapFilterTimestamps_ptr)[this->getFilterId()].push_back(packet->timestamp); 47 CWorkflowGraph::timestamps_ptr->insert(packet->timestamp); 48 } 40 //if(CXios::isClient) std::cout<<"onOutputReady"<<std::endl; 41 49 42 50 43 if (manualTrigger) // Don't use canBeTriggered here, this function is virtual and can be overriden … … 123 116 } 124 117 125 int COutputPin::getFilterId(void)118 void COutputPin::setParentFiltersTag() 126 119 { 127 return filterId; 120 for(int i=0; i<parent_filters.size(); i++) 121 { 122 parent_filters[i]->tag += tag; 123 parent_filters[i]->setParentFiltersTag(); 124 } 128 125 } 129 126 127 130 128 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.hpp
r1668 r1677 7 7 namespace xios 8 8 { 9 class CInputPin; 10 class CFilter; 9 11 /*! 10 12 * An output pin handles the connections with downstream filters. … … 13 15 { 14 16 public: 17 StdString output_field_id; 18 int tag; 19 20 std::vector< std::shared_ptr<COutputPin> > parent_filters; 21 15 22 /*! 16 23 * Constructs an ouput pin with manual or automatic trigger … … 69 76 void virtual invalidate(Time timestamp); 70 77 71 /*! 72 * Returns filter's id needed in case of building workflow graph 73 */ 74 int getFilterId(); 78 void virtual setParentFiltersTag(); 79 75 80 76 81 protected: … … 109 114 bool buildWorkflowGraph; 110 115 111 //! Filter's id needed in case of building a workflow graph112 int filterId;113 114 116 115 117 }; // class COutputPin -
XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp
r1668 r1677 1 1 #include "pass_through_filter.hpp" 2 #include "workflow_graph.hpp" 2 3 3 4 namespace xios … … 5 6 CPassThroughFilter::CPassThroughFilter(CGarbageCollector& gc, bool buildWorkflowGraph /*= false*/) 6 7 : CFilter(gc, 1, this, buildWorkflowGraph) 7 { /* Nothing to do */ } 8 { 9 } 8 10 9 11 CDataPacketPtr CPassThroughFilter::apply(std::vector<CDataPacketPtr> data) 10 12 { 13 if(this->tag) 14 { 15 std::cout<<"CPassThroughFilter::apply tag = "<<this->tag<<std::endl; 16 this->filterID = InvalidableObject::filterIdGenerator++; 17 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 18 19 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "Pass Through Filter"; 20 21 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 22 23 StdString str = data[0]->fieldID + " ts=" + to_string(data[0]->timestamp); 24 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 25 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 26 data[0]->src_filterID=this->filterID; 27 28 } 29 30 data[0]->fieldID = this->output_field_id; 31 32 11 33 return data[0]; 12 34 } 35 13 36 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/source_filter.cpp
r1668 r1677 26 26 } 27 27 28 28 29 template <int N> 29 void CSourceFilter::streamData(CDate date, const CArray<double, N>& data )30 void CSourceFilter::streamData(CDate date, const CArray<double, N>& data, const StdString field_id) 30 31 { 31 32 date = date + offset; // this is a temporary solution, it should be part of a proper temporal filter … … 62 63 } 63 64 65 packet->fieldID = field_id; 66 this->output_field_id = field_id; 67 68 69 if(this->tag) 70 { 71 this->filterID.first = InvalidableObject::filterIdGenerator++; 72 packet->src_filterID=this->filterID.first; 73 74 75 if(CXios::isClient) std::cout<<"source filter tag = "<<this->tag<<std::endl; 76 77 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 78 79 (*CWorkflowGraph::mapFilters_ptr)[this->filterID.first] = "Source Filter"; 80 81 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 82 83 84 } 85 86 87 onOutputReady(packet); 88 } 89 90 template void CSourceFilter::streamData<1>(CDate date, const CArray<double, 1>& data, const StdString field_id); 91 template void CSourceFilter::streamData<2>(CDate date, const CArray<double, 2>& data, const StdString field_id); 92 template void CSourceFilter::streamData<3>(CDate date, const CArray<double, 3>& data, const StdString field_id); 93 template void CSourceFilter::streamData<4>(CDate date, const CArray<double, 4>& data, const StdString field_id); 94 template void CSourceFilter::streamData<5>(CDate date, const CArray<double, 5>& data, const StdString field_id); 95 template void CSourceFilter::streamData<6>(CDate date, const CArray<double, 6>& data, const StdString field_id); 96 template void CSourceFilter::streamData<7>(CDate date, const CArray<double, 7>& data, const StdString field_id); 97 98 99 template <int N> 100 void CSourceFilter::streamData(CDate date, const CArray<double, N>& data) 101 { 102 date = date + offset; // this is a temporary solution, it should be part of a proper temporal filter 103 104 CDataPacketPtr packet(new CDataPacket); 105 packet->date = date; 106 packet->timestamp = date; 107 packet->status = CDataPacket::NO_ERROR; 108 109 packet->data.resize(grid->storeIndex_client.numElements()); 110 111 if (compression) 112 { 113 packet->data = defaultValue; 114 grid->uncompressField(data, packet->data); 115 } 116 else 117 { 118 if (mask) 119 grid->maskField(data, packet->data); 120 else 121 grid->inputField(data, packet->data); 122 } 123 // Convert missing values to NaN 124 if (hasMissingValue) 125 { 126 const double nanValue = std::numeric_limits<double>::quiet_NaN(); 127 const size_t nbData = packet->data.numElements(); 128 for (size_t idx = 0; idx < nbData; ++idx) 129 { 130 if (defaultValue == packet->data(idx)) 131 packet->data(idx) = nanValue; 132 } 133 } 134 this->filterID.first = InvalidableObject::filterIdGenerator++; 135 packet->src_filterID=this->filterID.first; 136 137 if(CXios::isClient) std::cout<<"source filter filter tag = "<<this->tag<<std::endl; 138 139 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 140 141 (*CWorkflowGraph::mapFilters_ptr)[this->filterID.first] = "Source Filter"; 142 143 144 64 145 onOutputReady(packet); 65 146 } … … 73 154 template void CSourceFilter::streamData<7>(CDate date, const CArray<double, 7>& data); 74 155 156 157 75 158 void CSourceFilter::streamDataFromServer(CDate date, const std::map<int, CArray<double, 1> >& data) 76 159 { … … 121 204 onOutputReady(packet); 122 205 } 206 207 123 208 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/source_filter.hpp
r1668 r1677 50 50 void streamData(CDate date, const CArray<double, N>& data); 51 51 52 template <int N> 53 void streamData(CDate date, const CArray<double, N>& data, const StdString field_id); 54 52 55 /*! 53 56 * Transforms the data received from the server into a packet and send it … … 66 69 */ 67 70 void signalEndOfStream(CDate date); 71 std::pair<int, int> filterID; 72 std::vector<int> filterIDoutputs; 68 73 69 74 private: … … 74 79 const bool compression ; //!< indicates if data need to be compressed : on client side : true, on server side : false 75 80 const bool mask ; //!< indicates whether grid mask should be applied (true for clients, false for servers) 81 76 82 }; // class CSourceFilter 77 83 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp
r1671 r1677 54 54 { 55 55 filter->connectOutput(firstFilter, 0); 56 if (buildWorkflowGraph)57 {58 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>;59 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >;60 int filterOut = (std::static_pointer_cast<COutputPin>(filter))->getFilterId();61 int filterIn = (std::static_pointer_cast<COutputPin>(firstFilter))->getFilterId();62 // PASS field's id here63 (*CWorkflowGraph::mapFieldToFilters_ptr)["XXX"].push_back(filterOut);64 (*CWorkflowGraph::mapFieldToFilters_ptr)["XXX"].push_back(filterIn);65 (*CWorkflowGraph::mapFilters_ptr)[filterOut] = "Spatial transform filter";66 (*CWorkflowGraph::mapFilters_ptr)[filterIn] = "Spatial transform filter";67 std::cout<<"CSpatialTransformFilter::CSpatialTransformFilter CWorkflowGraph::mapFieldToFilters_ptr->size = "<<CWorkflowGraph::mapFieldToFilters_ptr->size()<<std::endl;68 }69 56 } 70 57 … … 86 73 void CSpatialTransformFilter::onInputReady(std::vector<CDataPacketPtr> data) 87 74 { 75 // if(CXios::isClient) std::cout<<"CSpatialTransformFilter onInputReady"<<std::endl; 76 88 77 CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 89 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue );78 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->output_field_id); 90 79 if (outputPacket) 80 { 81 // std::cout<<"Spatial Transform Filter onOutputReady"<<std::endl; 91 82 onOutputReady(outputPacket); 83 } 92 84 } 93 85 … … 120 112 void CSpatialTemporalFilter::onInputReady(std::vector<CDataPacketPtr> data) 121 113 { 114 if(CXios::isClient) std::cout<<"CSpatialTemporalFilter onInputReady"<<std::endl; 115 122 116 CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 123 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue );117 CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->output_field_id); 124 118 125 119 if (outputPacket) … … 146 140 packet->data.resize(tmpData.numElements()); 147 141 packet->data = tmpData; 142 std::cout<<"Spatial temporal filter onOutputReady"<<std::endl; 148 143 onOutputReady(packet); 149 144 tmpData.resize(0) ; … … 187 182 } 188 183 189 CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue) 190 { 184 CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue, int tag, StdString fieldID) 185 { 186 if(tag) 187 { 188 this->filterID = InvalidableObject::filterIdGenerator++; 189 190 std::cout<<"CSpatialTransformFilter::apply filter tag = "<<tag<<std::endl; 191 192 193 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 194 195 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "Spatial Transform Filter"; 196 197 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 198 199 StdString str = data[0]->fieldID + " ts=" + to_string(data[0]->timestamp); 200 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 201 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 202 } 203 204 191 205 CDataPacketPtr packet(new CDataPacket); 192 206 packet->date = data[0]->date; … … 207 221 apply(data[0]->data, packet->data); 208 222 } 223 224 if(tag) packet->src_filterID=this->filterID; 225 packet->fieldID=fieldID; 209 226 210 227 return packet; -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.hpp
r1668 r1677 101 101 { 102 102 public: 103 104 int filterID; 105 int tag; 103 106 /*! 104 107 * Returns the engine wrapping the specified grid transformation. … … 117 120 * \return the result of the grid transformation 118 121 */ 119 CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0 );122 CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0, int tag=0, StdString fieldID=0); 120 123 121 124 /*! -
XIOS/dev/dev_trunk_omp/src/filter/store_filter.cpp
r1668 r1677 90 90 void CStoreFilter::onInputReady(std::vector<CDataPacketPtr> data) 91 91 { 92 if(CXios::isClient) std::cout<<"CStoreFilter onInputReady"<<std::endl; 93 94 if(this->tag) 95 { 96 this->filterID = InvalidableObject::filterIdGenerator++; 97 98 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 99 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 100 101 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "Store Filter"; 102 103 if(CXios::isClient) std::cout<<"CStoreFilter::apply filter tag = "<<this->tag<<std::endl; 104 105 if(CXios::isClient) 106 { 107 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 108 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 109 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 110 } 111 } 112 113 92 114 93 115 CDataPacketPtr packet; … … 139 161 } 140 162 141 int CStoreFilter::getFilterId(void)142 {143 return filterId;144 }145 163 146 164 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/store_filter.hpp
r1668 r1677 3 3 4 4 #include "input_pin.hpp" 5 #include "workflow_graph.hpp" 6 5 7 6 8 namespace xios … … 73 75 void virtual invalidate(Time timestamp); 74 76 75 /*! 76 * Returns filter's id needed in case of building workflow graph 77 */ 78 int getFilterId(); 77 int filterID; 78 int tag; 79 79 80 80 81 protected: … … 93 94 const double missingValue; //!< The value to use to replace missing values 94 95 std::map<Time, CDataPacketPtr> packets; //<! The stored packets 95 int filterId; //!< Filter's id needed in case of building a workflow 96 96 97 97 98 }; // class CStoreFilter -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp
r1668 r1677 2 2 #include "functor_type.hpp" 3 3 #include "calendar_util.hpp" 4 #include "workflow_graph.hpp" 4 5 5 6 namespace xios … … 32 33 CDataPacketPtr CTemporalFilter::apply(std::vector<CDataPacketPtr> data) 33 34 { 35 36 if(this->tag) 37 { 38 if(this->filterIDoutputs.size()==0) this->filterID = InvalidableObject::filterIdGenerator++; 39 40 41 std::cout<<"CTemporalFilter::apply filter tag = "<<this->tag<<std::endl; 42 43 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 44 45 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 46 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 47 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 48 49 50 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 51 52 if(this->filterIDoutputs.size()==0) (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "Temporal Filter"; 53 54 this->filterIDoutputs.push_back(data[0]->src_filterID); 55 } 56 57 34 58 CDataPacketPtr packet; 35 59 … … 42 66 { 43 67 usePacket = (data[0]->date >= nextSamplingDate); 44 // outputResult = (data[0]->date + samplingFreq > nextOperationDate);45 68 outputResult = (data[0]->date > initDate + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth); 46 69 copyLess = (isInstantOperation && usePacket && outputResult); … … 79 102 80 103 isFirstOperation = false; 81 // nextOperationDate = initDate + samplingFreq + nbOperationDates*opFreq - samplingFreq + offsetMonth + offsetAllButMonth; 104 if(this->tag) packet->src_filterID=this->filterID; 105 packet->fieldID = this->output_field_id; 106 if(this->tag) this->filterIDoutputs.clear(); 82 107 } 83 108 } -
XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.hpp
r1668 r1677 54 54 */ 55 55 bool virtual isDataExpected(const CDate& date) const; 56 std::vector<int> filterIDoutputs; 56 57 57 58 private: … … 72 73 // CDate nextOperationDate; //!< The date of the next operation 73 74 bool isFirstOperation; //!< True before the first operation was been computed 75 74 76 }; // class CTemporalFilter 75 77 } // namespace xios -
XIOS/dev/dev_trunk_omp/src/filter/ternary_arithmetic_filter.cpp
r1162 r1677 1 1 #include "ternary_arithmetic_filter.hpp" 2 #include "workflow_graph.hpp" 2 3 3 4 namespace xios … … 12 13 CDataPacketPtr CScalarScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 13 14 { 14 CDataPacketPtr packet(new CDataPacket); 15 packet->date = data[0]->date; 16 packet->timestamp = data[0]->timestamp; 17 packet->status = data[0]->status; 15 if(this->tag) 16 { 17 this->filterID = InvalidableObject::filterIdGenerator++; 18 19 20 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 21 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 22 23 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "SSF Filter" ; 24 std::cout<<"CScalarScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 25 26 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 27 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 28 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 29 } 30 31 CDataPacketPtr packet(new CDataPacket); 32 packet->date = data[0]->date; 33 packet->timestamp = data[0]->timestamp; 34 packet->status = data[0]->status; 35 if(this->tag) packet->src_filterID = this->filterID; 36 packet->fieldID = this->output_field_id; 18 37 19 38 if (packet->status == CDataPacket::NO_ERROR) … … 32 51 CDataPacketPtr CScalarFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 33 52 { 34 CDataPacketPtr packet(new CDataPacket); 35 packet->date = data[0]->date; 36 packet->timestamp = data[0]->timestamp; 37 packet->status = data[0]->status; 53 if(this->tag) 54 { 55 this->filterID = InvalidableObject::filterIdGenerator++; 56 57 58 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 59 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 60 61 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "SFS Filter" ; 62 std::cout<<"CScalarFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 63 64 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 65 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 66 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 67 } 68 69 CDataPacketPtr packet(new CDataPacket); 70 packet->date = data[0]->date; 71 packet->timestamp = data[0]->timestamp; 72 packet->status = data[0]->status; 73 if(this->tag) packet->src_filterID = this->filterID; 74 packet->fieldID = this->output_field_id; 38 75 39 76 if (packet->status == CDataPacket::NO_ERROR) … … 51 88 CDataPacketPtr CScalarFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 52 89 { 53 CDataPacketPtr packet(new CDataPacket); 54 packet->date = data[0]->date; 55 packet->timestamp = data[0]->timestamp; 56 packet->status = data[0]->status; 90 if(this->tag) 91 { 92 this->filterID = InvalidableObject::filterIdGenerator++; 93 94 95 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 96 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 97 98 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "SFF Filter" ; 99 std::cout<<"CScalarFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 100 101 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 102 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 103 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 104 105 str = data[1]->fieldID +" ts=" + to_string(data[0]->timestamp); 106 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[1]->src_filterID); 107 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 108 } 109 110 CDataPacketPtr packet(new CDataPacket); 111 packet->date = data[0]->date; 112 packet->timestamp = data[0]->timestamp; 113 packet->status = data[0]->status; 114 if(this->tag) packet->src_filterID = this->filterID; 115 packet->fieldID = this->output_field_id; 57 116 58 117 if (data[0]->status != CDataPacket::NO_ERROR) … … 79 138 CDataPacketPtr CFieldScalarScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 80 139 { 81 CDataPacketPtr packet(new CDataPacket); 82 packet->date = data[0]->date; 83 packet->timestamp = data[0]->timestamp; 84 packet->status = data[0]->status; 140 if(this->tag) 141 { 142 this->filterID = InvalidableObject::filterIdGenerator++; 143 144 145 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 146 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 147 148 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "FSS Filter" ; 149 std::cout<<"CFieldScalarScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 150 151 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 152 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 153 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 154 } 155 156 CDataPacketPtr packet(new CDataPacket); 157 packet->date = data[0]->date; 158 packet->timestamp = data[0]->timestamp; 159 packet->status = data[0]->status; 160 if(this->tag) packet->src_filterID = this->filterID; 161 packet->fieldID = this->output_field_id; 85 162 86 163 if (packet->status == CDataPacket::NO_ERROR) … … 99 176 CDataPacketPtr CFieldScalarFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 100 177 { 101 CDataPacketPtr packet(new CDataPacket); 102 packet->date = data[0]->date; 103 packet->timestamp = data[0]->timestamp; 104 packet->status = data[0]->status; 178 if(this->tag) 179 { 180 this->filterID = InvalidableObject::filterIdGenerator++; 181 182 183 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 184 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 185 186 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "FSF Filter" ; 187 std::cout<<"CFieldScalarFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 188 189 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 190 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 191 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 192 193 str = data[1]->fieldID +" ts=" + to_string(data[0]->timestamp); 194 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[1]->src_filterID); 195 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 196 } 197 198 CDataPacketPtr packet(new CDataPacket); 199 packet->date = data[0]->date; 200 packet->timestamp = data[0]->timestamp; 201 packet->status = data[0]->status; 202 if(this->tag) packet->src_filterID = this->filterID; 203 packet->fieldID = this->output_field_id; 105 204 106 205 if (data[0]->status != CDataPacket::NO_ERROR) … … 124 223 CDataPacketPtr CFieldFieldScalarArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 125 224 { 126 CDataPacketPtr packet(new CDataPacket); 127 packet->date = data[0]->date; 128 packet->timestamp = data[0]->timestamp; 129 packet->status = data[0]->status; 225 if(this->tag) 226 { 227 this->filterID = InvalidableObject::filterIdGenerator++; 228 229 230 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 231 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 232 233 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "FFS Filter" ; 234 std::cout<<"CFieldFieldScalarArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 235 236 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 237 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 238 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 239 240 str = data[1]->fieldID +" ts=" + to_string(data[0]->timestamp); 241 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[1]->src_filterID); 242 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 243 } 244 245 CDataPacketPtr packet(new CDataPacket); 246 packet->date = data[0]->date; 247 packet->timestamp = data[0]->timestamp; 248 packet->status = data[0]->status; 249 if(this->tag) packet->src_filterID = this->filterID; 250 packet->fieldID = this->output_field_id; 130 251 131 252 if (data[0]->status != CDataPacket::NO_ERROR) … … 149 270 CDataPacketPtr CFieldFieldFieldArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 150 271 { 151 CDataPacketPtr packet(new CDataPacket); 152 packet->date = data[0]->date; 153 packet->timestamp = data[0]->timestamp; 154 packet->status = data[0]->status; 272 if(this->tag) 273 { 274 this->filterID = InvalidableObject::filterIdGenerator++; 275 276 277 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 278 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 279 280 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = "FFF Filter" ; 281 std::cout<<"CFieldFieldFieldArithmeticFilter::apply connection = "<<data[0]->src_filterID<<" <-> "<<this->filterID<<std::endl; 282 283 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 284 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 285 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 286 287 str = data[1]->fieldID +" ts=" + to_string(data[0]->timestamp); 288 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[1]->src_filterID); 289 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 290 291 str = data[2]->fieldID +" ts=" + to_string(data[0]->timestamp); 292 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[2]->src_filterID); 293 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 294 } 295 296 297 CDataPacketPtr packet(new CDataPacket); 298 packet->date = data[0]->date; 299 packet->timestamp = data[0]->timestamp; 300 packet->status = data[0]->status; 301 if(this->tag) packet->src_filterID = this->filterID; 302 packet->fieldID = this->output_field_id; 155 303 156 304 if (data[0]->status != CDataPacket::NO_ERROR) -
XIOS/dev/dev_trunk_omp/src/filter/unary_arithmetic_filter.cpp
r643 r1677 1 1 #include "unary_arithmetic_filter.hpp" 2 2 #include "workflow_graph.hpp" 3 3 namespace xios 4 4 { … … 6 6 : CFilter(gc, 1, this) 7 7 , op(operatorExpr.getOpField(op)) 8 { /* Nothing to do */ }; 8 { 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 = " "; 28 }; 9 29 10 30 CDataPacketPtr CUnaryArithmeticFilter::apply(std::vector<CDataPacketPtr> data) 11 31 { 32 if(this->tag) 33 { 34 this->filterID = InvalidableObject::filterIdGenerator++; 35 36 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 37 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 38 39 40 (*CWorkflowGraph::mapFilters_ptr)[this->filterID] = op_expression +" F Filter" ; 41 std::cout<<"CunaryArithmeticFilter::apply filter tag = "<<this->tag<<std::endl; 42 43 StdString str = data[0]->fieldID +" ts=" + to_string(data[0]->timestamp); 44 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(data[0]->src_filterID); 45 (*CWorkflowGraph::mapFieldToFilters_ptr)[str].push_back(this->filterID); 46 47 } 48 12 49 CDataPacketPtr packet(new CDataPacket); 13 50 packet->date = data[0]->date; 14 51 packet->timestamp = data[0]->timestamp; 15 52 packet->status = data[0]->status; 53 packet->fieldID = this->output_field_id; 16 54 17 55 if (packet->status == CDataPacket::NO_ERROR) 18 56 packet->data.reference(op(data[0]->data)); 19 57 58 if(this->tag) packet->src_filterID = this->filterID; 59 20 60 return packet; 21 61 } -
XIOS/dev/dev_trunk_omp/src/interface/c/iccalendar.cpp
r1646 r1677 6 6 #include "context.hpp" 7 7 #include "context_client.hpp" 8 #include "workflow_graph.hpp" 9 #include "graphviz.hpp" 10 8 11 9 12 extern "C" … … 19 22 context->sendUpdateCalendar(step); 20 23 CTimer::get("XIOS").suspend(); 24 25 // int my_rank; 26 // MPI_Comm_rank(CXios::globalComm, &my_rank); 27 // if(my_rank==0) 28 // { 29 // // CGraphviz::showStaticWorkflowGraph(); 30 // CGraphviz::buildStaticWorkflowGraph(); 31 // StdString commande_string="dot -Tpdf graph.dot -o graph"+to_string(step-1)+".pdf"; 32 // const char* command=commande_string.c_str(); 33 // system(command); 34 // } 35 36 21 37 } 22 38 CATCH_DUMP_STACK -
XIOS/dev/dev_trunk_omp/src/node/field.cpp
r1671 r1677 70 70 71 71 //---------------------------------------------------------------- 72 72 73 73 74 const StdString& CField::getOId(void) … … 1128 1129 TRY 1129 1130 { 1130 if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform();1131 if (!isGridChecked) checkGridOfEnabledFields();1131 if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform(); 1132 if (!isGridChecked) checkGridOfEnabledFields(); 1132 1133 1133 1134 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); … … 1166 1167 { 1167 1168 fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this)); 1168 instantDataFilter->connectOutput(fileWriterFilter, 0); 1169 instantDataFilter->connectOutput(fileWriterFilter, 0); 1169 1170 } 1170 1171 } … … 1180 1181 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0')); 1181 1182 std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this); 1183 filter->output_field_id = this->getId(); 1182 1184 1183 1185 // Check if a spatial transformation is needed … … 1194 1196 1195 1197 filter->connectOutput(filters.first, 0); 1196 1197 if (buildWorkflowGraph) 1198 { 1199 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 1200 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 1201 int filterOut = filter->getFilterId(); 1202 int filterIn = (std::static_pointer_cast<COutputPin>(filters.second))->getFilterId(); 1203 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterOut); 1204 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterIn); 1205 (*CWorkflowGraph::mapFilters_ptr)[filterOut] = filter->GetName(); 1206 (*CWorkflowGraph::mapFilters_ptr)[filterIn] = filters.second->GetName(); 1207 std::cout<<"CField::buildFilterGraph (*CWorkflowGraph::mapFilters_ptr)["<<filterOut<<"] = "<<filter->GetName()<<std::endl; 1208 } 1198 filters.second->output_field_id = this->getId(); 1199 1200 1209 1201 filter = filters.second; 1202 1210 1203 } 1211 1204 } 1212 1205 1213 1206 instantDataFilter = filter; 1207 instantDataFilter->output_field_id = this->getId(); 1208 filter->output_field_id = this->getId(); 1209 filter->tag = buildWorkflowGraph; 1210 // std::cout<<"=====1============= output_field_id = "<<this->getId()<<" =========== tag="<<filter->tag<<std::endl; 1211 for(int i=0; i<filter->parent_filters.size(); i++) 1212 { 1213 // std::cout<<"transforme filter cout= "<<std::shared_ptr<COutputPin>(filter)<<" parent filter = "<<filter->parent_filters[i]<<std::endl; 1214 filter->tag = filter->tag || filter->parent_filters[i]->tag; 1215 } 1216 1217 1218 1219 1220 1214 1221 } 1215 1222 // Check if we have a reference on another field … … 1218 1225 CField::get(field_ref)->build_workflow_graph.setValue(buildWorkflowGraph); 1219 1226 instantDataFilter = getFieldReference(gc); 1227 instantDataFilter->tag = buildWorkflowGraph; 1220 1228 } 1221 1229 // Check if the data is to be read from a file … … 1225 1233 instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false, freq_offset, true, 1226 1234 detectMissingValues, defaultValue, buildWorkflowGraph)); 1235 instantDataFilter->tag = buildWorkflowGraph; 1227 1236 } 1228 1237 else // The data might be passed from the model … … 1230 1239 if (check_if_active.isEmpty()) check_if_active = false; 1231 1240 instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, true, NoneDu, false, 1232 detectMissingValues, defaultValue, buildWorkflowGraph)); 1233 if (buildWorkflowGraph) 1234 { 1235 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 1236 (*CWorkflowGraph::mapFilters_ptr)[instantDataFilter->getFilterId()] = instantDataFilter->GetName(); 1237 std::cout<<"CField::buildFilterGraph2 (*CWorkflowGraph::mapFilters_ptr)["<<instantDataFilter->getFilterId()<<"] = "<<instantDataFilter->GetName()<<std::endl; 1238 } 1241 detectMissingValues, defaultValue, buildWorkflowGraph)); 1242 instantDataFilter->tag = buildWorkflowGraph; 1243 // std::cout<<"=====4============= output_field_id = "<<this->getId()<<" =========== tag="<<instantDataFilter->tag<<std::endl; 1244 // std::cout<<"Source filter cout = "<<std::shared_ptr<COutputPin>(clientSourceFilter)<<std::endl; 1239 1245 } 1240 1246 } … … 1248 1254 detectMissingValues, defaultValue)); 1249 1255 instantDataFilter->connectOutput(storeFilter, 0); 1256 1257 storeFilter->tag = (instantDataFilter->tag || buildWorkflowGraph); 1258 instantDataFilter->setParentFiltersTag(); 1250 1259 } 1251 1260 … … 1254 1263 fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, buildWorkflowGraph)); 1255 1264 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0); 1256 if (buildWorkflowGraph) 1257 { 1258 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 1259 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 1260 int filterOut = getTemporalDataFilter(gc, file->output_freq)->getFilterId(); 1261 int filterIn = fileWriterFilter->getFilterId(); 1262 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterOut); 1263 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterIn); 1264 (*CWorkflowGraph::mapFilters_ptr)[filterOut] = "Temporal filter"; 1265 (*CWorkflowGraph::mapFilters_ptr)[filterIn] = fileWriterFilter->GetName(); 1266 } 1265 std::cout<<"=====10============= output_field_id = "<<this->name<<std::endl; 1266 // std::cout<<"CFileWriterFilter filter = "<<fileWriterFilter<<" parent filter = "<<std::shared_ptr<COutputPin>(getTemporalDataFilter(gc, file->output_freq))<<std::endl; 1267 1268 fileWriterFilter->tag = (getTemporalDataFilter(gc, file->output_freq)->tag || buildWorkflowGraph); 1269 fileWriterFilter->output_field_id = this->name; 1270 getTemporalDataFilter(gc, file->output_freq)->setParentFiltersTag(); 1267 1271 } 1268 1272 } … … 1296 1300 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 1297 1301 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue, buildWorkflowGraph); 1302 1303 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 1304 1305 filters.second->output_field_id = this->getId(); 1306 1307 1308 filters.second->parent_filters.resize(1); 1309 filters.second->parent_filters[0]= fieldRef->getInstantDataFilter(); 1310 1311 filters.second->tag = (buildWorkflowGraph || filters.second->parent_filters[0]->tag); 1312 1313 // std::cout<<"=====5============= output_field_id = "<<this->getId()<<std::endl; 1314 // std::cout<<"CSpatialTransformFilter first filter cout = "<<std::shared_ptr<COutputPin>(filters.first)<<" second filter cout = "<<std::shared_ptr<COutputPin>(filters.second)<< " parent filter = "<<fieldRef->getInstantDataFilter()<<std::endl; 1315 1298 1316 } 1299 1317 else 1300 1318 { 1301 1319 filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc, buildWorkflowGraph)); 1302 } 1303 1304 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 1305 1306 if (buildWorkflowGraph) 1307 { 1308 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 1309 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 1310 int filterOut = fieldRef->instantDataFilter->getFilterId(); 1311 int filterIn = (std::static_pointer_cast<COutputPin>(filters.first))->getFilterId(); 1312 (*CWorkflowGraph::mapFieldToFilters_ptr)[fieldRef->getOId()].push_back(filterOut); 1313 (*CWorkflowGraph::mapFieldToFilters_ptr)[fieldRef->getOId()].push_back(filterIn); 1314 (*CWorkflowGraph::mapFilters_ptr)[filterOut] = fieldRef->getInstantDataFilter()->GetName(); 1315 (*CWorkflowGraph::mapFilters_ptr)[filterIn] = filters.first->GetName(); 1316 std::cout<<"CField::getFieldReference (*CWorkflowGraph::mapFilters_ptr)["<<filterOut<<"] = "<<fieldRef->getInstantDataFilter()->GetName()<<std::endl; 1317 } 1320 1321 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 1322 filters.second->output_field_id = this->getId(); 1323 1324 1325 filters.second->parent_filters.resize(1); 1326 filters.second->parent_filters[0]= fieldRef->getInstantDataFilter(); 1327 1328 filters.second->tag = buildWorkflowGraph || filters.second->parent_filters[0]->tag; 1329 1330 // std::cout<<"=====6============= output_field_id = "<<this->getId()<<" =========== tag="<<filters.second->tag<<std::endl; 1331 // std::cout<<"Pass through filter cout = "<<std::shared_ptr<COutputPin>(filters.second)<<" parent filter = "<<filters.second->parent_filters[0]<<std::endl; 1332 1333 } 1334 1318 1335 return filters.second; 1319 1336 } … … 1335 1352 ERROR("COutputPin* CField::getSelfReference(CGarbageCollector& gc)", 1336 1353 "Impossible to add a self reference to a field which has already been parsed or which does not have an expression."); 1354 1355 bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1337 1356 1338 1357 if (!selfReferenceFilter) … … 1368 1387 1369 1388 selfReferenceFilter = clientSourceFilter; 1370 } 1371 } 1372 1389 } 1390 } 1391 1392 selfReferenceFilter->tag = buildWorkflowGraph; 1373 1393 return selfReferenceFilter; 1374 1394 } … … 1388 1408 { 1389 1409 std::map<CDuration, std::shared_ptr<COutputPin> >::iterator it = temporalDataFilters.find(outFreq); 1390 const boolbuildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);1410 bool buildWorkflowGraph = buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1391 1411 1392 1412 if (it == temporalDataFilters.end()) … … 1404 1424 1405 1425 instantDataFilter->connectOutput(temporalFilter, 0); 1406 1407 if (buildWorkflowGraph) 1408 { 1409 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 1410 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 1411 int filterOut = instantDataFilter->getFilterId(); 1412 int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId(); 1413 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterOut); 1414 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterIn); 1415 (*CWorkflowGraph::mapFilters_ptr)[filterOut] = getInstantDataFilter()->GetName(); 1416 (*CWorkflowGraph::mapFilters_ptr)[filterIn] = temporalFilter->GetName(); 1417 std::cout<<"CField::getTemporalDataFilter (*CWorkflowGraph::mapFilters_ptr)["<<filterOut<<"] = "<<getInstantDataFilter()->GetName()<<std::endl; 1418 } 1426 temporalFilter->output_field_id = this->getId(); 1427 temporalFilter->tag = buildWorkflowGraph; 1428 1429 temporalFilter->parent_filters.resize(1); 1430 temporalFilter->parent_filters[0] = instantDataFilter; 1431 1432 1433 // std::cout<<"=====8============= output_field_id = "<<this->getId()<<" =========== tag="<<temporalFilter->tag<<std::endl; 1434 // std::cout<<"Temporal filter cout = "<<std::shared_ptr<COutputPin>(temporalFilter)<<" parent filter = "<<temporalFilter->parent_filters[0]<<std::endl; 1435 if(temporalFilter->parent_filters[0]->tag) temporalFilter->tag=true; 1419 1436 1420 1437 it = temporalDataFilters.insert(std::make_pair(outFreq, temporalFilter)).first; … … 1452 1469 1453 1470 const bool detectMissingValues = (!detect_missing_value.isEmpty() && detect_missing_value == true); 1454 const boolbuildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);1471 bool buildWorkflowGraph = buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1455 1472 std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 1456 1473 CContext::getCurrent()->getCalendar()->getInitDate(), … … 1459 1476 1460 1477 selfReferenceFilter->connectOutput(temporalFilter, 0); 1461 if (buildWorkflowGraph) 1462 1463 { 1464 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <int, StdString>; 1465 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int> >; 1466 int filterOut = selfReferenceFilter->getFilterId(); 1467 int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId(); 1468 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterOut); 1469 (*CWorkflowGraph::mapFieldToFilters_ptr)[this->getOId()].push_back(filterIn); 1470 (*CWorkflowGraph::mapFilters_ptr)[filterOut] = selfReferenceFilter->GetName(); 1471 (*CWorkflowGraph::mapFilters_ptr)[filterIn] = temporalFilter->GetName(); 1472 std::cout<<"CField::getSelfTemporalDataFilter (*CWorkflowGraph::mapFilters_ptr)["<<filterOut<<"] = "<<selfReferenceFilter->GetName()<<std::endl; 1473 } 1478 temporalFilter->output_field_id = this->getId(); 1479 temporalFilter->tag = buildWorkflowGraph; 1480 // std::cout<<"=====9============= output_field_id = "<<this->getId()<<" =========== tag="<<temporalFilter->tag<<std::endl; 1474 1481 1475 1482 return temporalFilter ; -
XIOS/dev/dev_trunk_omp/src/node/field.hpp
r1671 r1677 278 278 //! The terminal filter which writes data to file 279 279 std::shared_ptr<CFileServerWriterFilter> fileServerWriterFilter; 280 280 281 }; // class CField 281 282 -
XIOS/dev/dev_trunk_omp/src/node/field_impl.hpp
r1646 r1677 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); 24 // clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 25 clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data, this->getId()); 25 26 } 26 27 else if (instantDataFilter) -
XIOS/dev/dev_trunk_omp/src/parse_expr/filter_expr_node.cpp
r1575 r1677 108 108 std::shared_ptr<CUnaryArithmeticFilter> filter(new CUnaryArithmeticFilter(gc, opId)); 109 109 child->reduce(gc, thisField)->connectOutput(filter, 0); 110 111 (filter->parent_filters).resize(1); 112 (filter->parent_filters)[0] = child->reduce(gc, thisField); 113 110 114 return filter; 111 115 } … … 125 129 std::shared_ptr<CScalarFieldArithmeticFilter> filter(new CScalarFieldArithmeticFilter(gc, opId, child1->reduce())); 126 130 child2->reduce(gc, thisField)->connectOutput(filter, 0); 131 132 (filter->parent_filters).resize(1); 133 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 134 127 135 return filter; 128 136 } … … 142 150 std::shared_ptr<CFieldScalarArithmeticFilter> filter(new CFieldScalarArithmeticFilter(gc, opId, child2->reduce())); 143 151 child1->reduce(gc, thisField)->connectOutput(filter, 0); 152 153 (filter->parent_filters).resize(1); 154 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 144 155 return filter; 145 156 } … … 159 170 std::shared_ptr<CFieldFieldArithmeticFilter> filter(new CFieldFieldArithmeticFilter(gc, opId)); 160 171 child1->reduce(gc, thisField)->connectOutput(filter, 0); 161 child2->reduce(gc, thisField)->connectOutput(filter, 1); 172 child2->reduce(gc, thisField)->connectOutput(filter, 1); 173 174 (filter->parent_filters).resize(2); 175 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 176 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 162 177 return filter; 163 178 } … … 181 196 std::shared_ptr<CScalarScalarFieldArithmeticFilter> filter(new CScalarScalarFieldArithmeticFilter(gc, opId, child1->reduce(),child2->reduce())); 182 197 child3->reduce(gc, thisField)->connectOutput(filter, 0); 198 199 (filter->parent_filters).resize(1); 200 (filter->parent_filters)[0] = child3->reduce(gc, thisField); 201 183 202 return filter; 184 203 } … … 200 219 std::shared_ptr<CScalarFieldScalarArithmeticFilter> filter(new CScalarFieldScalarArithmeticFilter(gc, opId, child1->reduce(),child3->reduce())); 201 220 child2->reduce(gc, thisField)->connectOutput(filter, 0); 221 222 (filter->parent_filters).resize(1); 223 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 202 224 return filter; 203 225 } … … 220 242 child2->reduce(gc, thisField)->connectOutput(filter, 0); 221 243 child3->reduce(gc, thisField)->connectOutput(filter, 1); 244 245 (filter->parent_filters).resize(2); 246 (filter->parent_filters)[0] = child2->reduce(gc, thisField); 247 (filter->parent_filters)[1] = child3->reduce(gc, thisField); 248 222 249 return filter; 223 250 } … … 240 267 std::shared_ptr<CFieldScalarScalarArithmeticFilter> filter(new CFieldScalarScalarArithmeticFilter(gc, opId, child2->reduce(),child3->reduce())); 241 268 child1->reduce(gc, thisField)->connectOutput(filter, 0); 269 270 (filter->parent_filters).resize(1); 271 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 242 272 return filter; 243 273 } … … 261 291 child1->reduce(gc, thisField)->connectOutput(filter, 0); 262 292 child3->reduce(gc, thisField)->connectOutput(filter, 1); 293 294 (filter->parent_filters).resize(2); 295 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 296 (filter->parent_filters)[1] = child3->reduce(gc, thisField); 297 263 298 return filter; 264 299 } … … 282 317 child1->reduce(gc, thisField)->connectOutput(filter, 0); 283 318 child2->reduce(gc, thisField)->connectOutput(filter, 1); 319 320 (filter->parent_filters).resize(2); 321 (filter->parent_filters)[0] = child1->reduce(gc, thisField); 322 (filter->parent_filters)[1] = child2->reduce(gc, thisField); 284 323 return filter; 285 324 } … … 303 342 child2->reduce(gc, thisField)->connectOutput(filter, 1); 304 343 child3->reduce(gc, thisField)->connectOutput(filter, 2); 344 345 (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); 349 305 350 return filter; 306 351 } -
XIOS/dev/dev_trunk_omp/src/test/test_complete_omp.f90
r1665 r1677 29 29 INTEGER, ALLOCATABLE :: kindex(:) 30 30 INTEGER :: ni,ibegin,iend,nj,jbegin,jend 31 INTEGER :: i,j,l,ts,n, nb_pt, provided 31 INTEGER :: i,j,l,ts,n, nb_pt, provided, ts_max 32 32 33 33 integer :: num_args, ix, nb_servers … … 48 48 49 49 READ(args(1),*) nb_servers 50 READ(args(2),*) ts_max 50 51 51 52 !!! MPI Initialization … … 123 124 CALL xios_define_calendar(type="Gregorian", & 124 125 start_date=xios_date(2000, 01, 01, 00, 00, 00), & 125 time_origin=xios_date(1999, 01, 01, 15, 00, 00)) 126 time_origin=xios_date(2000, 01, 01, 00, 00, 00)) 127 !time_origin=xios_date(1999, 01, 01, 15, 00, 00)) 126 128 127 129 CALL xios_set_axis_attr("axis_atm",n_glo=llm ,value=lval) ; … … 216 218 CALL xios_define_calendar(type="Gregorian", & 217 219 start_date=xios_date(2000, 01, 01, 00, 00, 00), & 218 time_origin=xios_date(1999, 01, 01, 15, 00, 00)) 220 time_origin=xios_date(2000, 01, 01, 00, 00, 00)) 221 !time_origin=xios_date(1999, 01, 01, 15, 00, 00)) 219 222 220 223 CALL xios_set_axis_attr("axis_srf",n_glo=llm ,value=lval) … … 236 239 237 240 CALL xios_get_handle("output_surface",file_hdl) 238 CALL xios_add_child(file_hdl,field_hdl)239 CALL xios_set_attr(field_hdl,field_ref="field_B_srf",name="field_C_srf")241 ! CALL xios_add_child(file_hdl,field_hdl) 242 ! CALL xios_set_attr(field_hdl,field_ref="field_B_srf",name="field_C_srf") 240 243 241 244 !!! Definition du timestep … … 248 251 ni=0 ; lonvalue(:,:)=0 249 252 CALL xios_get_domain_attr("domain_srf",ni=ni,lonvalue_2D=lonvalue) 250 253 251 254 !PRINT *,"ni",ni 252 255 !PRINT *,"lonvalue",lonvalue ; … … 267 270 !#################################################################################### 268 271 269 DO ts=1, 24*10270 !DO ts=1,24 272 DO ts=1,ts_max 273 !DO ts=1,24*10 271 274 272 275 CALL xios_get_handle("atmosphere",ctx_hdl) … … 334 337 DEALLOCATE(kindex, field_A_srf) 335 338 336 print *, "Client : xios_finalize "339 print *, "Client : xios_finalize ts_max=", ts_max 337 340 338 341 !$omp barrier -
XIOS/dev/dev_trunk_omp/src/test/test_omp.f90
r1671 r1677 169 169 PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 170 170 171 DO ts=1, 4171 DO ts=1,2 172 172 CALL xios_update_calendar(ts) 173 173 CALL xios_send_field("field_A",field_A) 174 CALL xios_send_field("field_Axis",axisValue) 174 CALL xios_send_field("field_B",field_A) 175 CALL xios_send_field("field_C",field_A) 176 !CALL xios_send_field("field_Axis",axisValue) 175 177 ! CALL xios_send_field("field_Axis",lval) 176 CALL xios_send_field("field_Domain",field_domain)177 CALL xios_send_field("field_Scalar",scalar)178 !CALL xios_send_field("field_Domain",field_domain) 179 !CALL xios_send_field("field_Scalar",scalar) 178 180 CALL wait_us(5000) 179 181 ENDDO -
XIOS/dev/dev_trunk_omp/src/transformation/Functions/average_reduction.cpp
r1474 r1677 33 33 bool ignoreMissingValue, bool firstPass) 34 34 { 35 std::cout<<"================================ CAverageReductionAlgorithm::apply"<<std::endl; 35 36 if (resetWeight_) { weights_.resize(flagInitial.size()); weights_ = 1.0; resetWeight_ = false; } 36 37 -
XIOS/dev/dev_trunk_omp/src/transformation/Functions/extract.cpp
r1260 r1677 32 32 bool ignoreMissingValue, bool firstPass) 33 33 { 34 std::cout<<"================================ CExtractReductionAlgorithm::apply"<<std::endl; 34 35 int nbLocalIndex = localIndex.size(); 35 36 int currentlocalIndex = 0; -
XIOS/dev/dev_trunk_omp/src/transformation/Functions/max_reduction.cpp
r1474 r1677 33 33 bool ignoreMissingValue, bool firstPass) 34 34 { 35 std::cout<<"================================ CMaxReductionAlgorithm::apply"<<std::endl; 35 36 if (ignoreMissingValue) 36 37 { -
XIOS/dev/dev_trunk_omp/src/transformation/Functions/min_reduction.cpp
r1474 r1677 33 33 bool ignoreMissingValue, bool firstPass) 34 34 { 35 std::cout<<"================================ CMinReductionAlgorithm::apply"<<std::endl; 35 36 if (ignoreMissingValue) 36 37 { -
XIOS/dev/dev_trunk_omp/src/transformation/Functions/sum_reduction.cpp
r1474 r1677 33 33 bool ignoreMissingValue, bool firstPass) 34 34 { 35 std::cout<<"================================ CSumReductionAlgorithm::apply"<<std::endl; 35 36 if (ignoreMissingValue) 36 37 { -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_extract_domain.cpp
r1646 r1677 81 81 TRY 82 82 { 83 std::cout<<"================================ CAxisAlgorithmExtractDomain::apply"<<std::endl; 83 84 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 84 85 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_axis.cpp
r1646 r1677 88 88 TRY 89 89 { 90 std::cout<<"================================ CAxisAlgorithmReduceAxis::apply"<<std::endl; 90 91 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 91 92 } -
XIOS/dev/dev_trunk_omp/src/transformation/axis_algorithm_reduce_domain.cpp
r1646 r1677 91 91 TRY 92 92 { 93 std::cout<<"================================ CAxisAlgorithmReduceDomain::apply"<<std::endl; 93 94 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 94 95 } -
XIOS/dev/dev_trunk_omp/src/transformation/domain_algorithm_interpolate.cpp
r1665 r1677 1052 1052 TRY 1053 1053 { 1054 std::cout<<"================================ CDomainAlgorithmInterpolate::apply"<<std::endl; 1054 1055 int nbLocalIndex = localIndex.size(); 1055 1056 double defaultValue = std::numeric_limits<double>::quiet_NaN(); -
XIOS/dev/dev_trunk_omp/src/transformation/generic_algorithm_transformation.cpp
r1661 r1677 36 36 TRY 37 37 { 38 // std::cout<<"================================ CGenericAlgorithmTransformation::apply"<<std::endl; 39 38 40 int nbLocalIndex = localIndex.size(); 39 41 double defaultValue = std::numeric_limits<double>::quiet_NaN(); -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_extract_axis.cpp
r1646 r1677 69 69 TRY 70 70 { 71 std::cout<<"================================ CScalarAlgorithmExtractAxis::apply"<<std::endl; 71 72 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 72 73 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_axis.cpp
r1646 r1677 98 98 TRY 99 99 { 100 std::cout<<"================================ CScalarAlgorithmTransformation::apply"<<std::endl; 100 101 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 101 102 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_domain.cpp
r1646 r1677 97 97 TRY 98 98 { 99 std::cout<<"================================ CScalarAlgorithmReduceDomain::apply"<<std::endl; 99 100 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 100 101 } -
XIOS/dev/dev_trunk_omp/src/transformation/scalar_algorithm_reduce_scalar.cpp
r1646 r1677 95 95 TRY 96 96 { 97 std::cout<<"================================ CScalarAlgorithmReduceScalar::apply"<<std::endl; 97 98 reduction_->apply(localIndex, dataInput, dataOut, flagInitial, ignoreMissingValue, firstPass); 98 99 } -
XIOS/dev/dev_trunk_omp/src/workflow_graph.cpp
r1671 r1677 29 29 TRY 30 30 { 31 // Create a list of filters (graph nodes) 32 if(mapFilters_ptr==0) mapFilters_ptr = new std::unordered_map <int, StdString>; 33 if(mapFieldToFilters_ptr==0) mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int > >; 34 size_t filterIdx = 0; 35 filters.resize(mapFilters_ptr->size()); 36 for (auto it=mapFilters_ptr->begin(); it != mapFilters_ptr->end(); it++) 31 32 if(mapFilters_ptr==0 || mapFieldToFilters_ptr==0) 33 std::cout<<"No graph information provided"<<std::endl; 34 35 else // Create a list of filters (graph nodes) 37 36 { 38 filters[it->first]=it->second; 39 } 37 size_t filterIdx = 0; 38 filters.resize(mapFilters_ptr->size()); 39 fieldsToFilters.clear(); 40 fields.clear(); 41 for (auto it=mapFilters_ptr->begin(); it != mapFilters_ptr->end(); it++) 42 { 43 filters[it->first]=it->second; 44 } 40 45 41 // Create a list of fields and their filter connectivity (graph edges and edge-to-node connectivity) 42 for (auto it=mapFieldToFilters_ptr->begin(); it != mapFieldToFilters_ptr->end(); it++) 43 { 44 for (size_t i = 0; i < (it->second.size() - 1); i+=2) 46 // Create a list of fields and their filter connectivity (graph edges and edge-to-node connectivity) 47 for (auto it=mapFieldToFilters_ptr->begin(); it != mapFieldToFilters_ptr->end(); it++) 45 48 { 46 fieldsToFilters.push_back(make_pair(it->second[i],it->second[i+1])); 47 fields.push_back(it->first); 49 for (size_t i = 0; i < (it->second.size() - 1); i+=2) 50 { 51 fieldsToFilters.push_back(make_pair(it->second[i],it->second[i+1])); 52 fields.push_back(it->first); 53 } 48 54 } 49 55 }
Note: See TracChangeset
for help on using the changeset viewer.