- Timestamp:
- 06/04/19 10:00:52 (5 years ago)
- Location:
- XIOS/dev/dev_trunk_omp
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_trunk_omp/inputs/COMPLETE/context_atmosphere.xml
r1661 r1671 3 3 <context id="atmosphere"> 4 4 5 <field_definition level="1" enabled=". FALSE." default_value="9.96921e+36">6 <field id="field_A_atm" name="field_A_atm _origin" operation="average" freq_op="1ts" grid_ref="grid_A_atm" />7 <field id="field_A_atm_zoom" name="field_A_atm"operation="average" freq_op="1ts" field_ref="field_A_atm" grid_ref="grid_A_atm_zoom" />5 <field_definition level="1" enabled=".TRUE." default_value="9.96921e+36"> 6 <field id="field_A_atm" name="field_A_atm" operation="average" freq_op="1ts" grid_ref="grid_A_atm" /> 7 <field id="field_A_atm_zoom" operation="average" freq_op="1ts" field_ref="field_A_atm" grid_ref="grid_A_atm_zoom" /> 8 8 </field_definition> 9 9 10 <file_definition type=" multiple_file" par_access="collective" output_freq="6h" sync_freq="6h" output_level="10" enabled=".TRUE.">10 <file_definition type="one_file" par_access="collective" output_freq="6h" sync_freq="6h" output_level="10" enabled=".TRUE."> 11 11 <file id="output_atmosphere" name="output_atmosphere"> 12 <field field_ref="field_A_atm" /> 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."/> 13 14 </file> 14 15 <file id="output_atmosphere_zoom" name="output_atmosphere_zoom"> 15 <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom" />16 <field field_ref="field_A_atm_zoom" name="field_A_atm_zoom" build_workflow_graph=".FALSE."/> 16 17 </file> 17 18 </file_definition> -
XIOS/dev/dev_trunk_omp/inputs/COMPLETE/context_surface.xml
r1668 r1671 12 12 </field_definition> 13 13 14 <file_definition type=" multiple_file" par_access="collective" output_level="10" enabled=".TRUE.">14 <file_definition type="one_file" par_access="collective" output_level="10" enabled=".TRUE."> 15 15 <file id="output_surface" name="output_surface_6h" output_freq="6h"> 16 <field field_ref="field_A_srf" >16 <field field_ref="field_A_srf" build_workflow_graph=".FALSE."> 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=". TRUE." />23 <field field_ref="field_A_srf_K_2" name="field_A_srf_K_2" /> <!-- Should be identical to field_A_srf_K -->24 <field field_ref="field_A_srf_K" name="field_A_srf_K_3" >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" 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" /> <!-- Should be identical to field_A_srf_min -->28 <field field_ref="field_A_srf" 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>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 31 <variable id="my_global_attribute" type="string">file_6h</variable> 32 32 </file> 33 33 34 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" >35 <field field_ref="field_A_srf" indexed_output="TRUE" build_workflow_graph=".FALSE."> 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" />42 <field field_ref="field_A_srf" name="field_A_srf_min" operation="minimum" />43 <field field_ref="field_A_srf" name="field_A_srf_max" operation="maximum" />44 <field field_ref="field_A_srf" name="field_A_srf_prec4" prec="8" />45 <field field_ref="field_A_srf_max" name="field_A_srf_mean_max" long_name="Average of hourly maximum over 1d" operation="average" freq_op="1h"> @field_A_srf_max </field>41 <field field_ref="field_A_srf_K" build_workflow_graph=".FALSE."/> 42 <field field_ref="field_A_srf" name="field_A_srf_min" operation="minimum" build_workflow_graph=".FALSE." /> 43 <field field_ref="field_A_srf" name="field_A_srf_max" operation="maximum" build_workflow_graph=".FALSE."/> 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> 46 46 <variable id="my_global_attribute" type="string" >file_1d</variable> 47 47 </file> -
XIOS/dev/dev_trunk_omp/inputs/REMAP/iodef.xml
r1669 r1671 6 6 <field_definition level="1" > 7 7 <field_group id="fields_src" operation="instant"> 8 <field id="src_field_2D" 8 <field id="src_field_2D" domain_ref="src_domain"/> 9 9 <field id="src_field_2D_clone" domain_ref="src_domain_clone"/> 10 10 <field id="src_field_3D" domain_ref="src_domain" axis_ref="src_axis"/> … … 35 35 <file id="output_2D" name="output_2D" > 36 36 <field field_ref="src_field_2D" name="field_src" build_workflow_graph=".TRUE."/> 37 <field field_ref="src_field_2D" name="field_dst_regular_0" domain_ref="dst_domain_regular_pole" default_value="10.e+5" build_workflow_graph=".TRUE."/>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 39 <field field_ref="dst_field_2D_regular_pole" name="field_dst_regular_2" build_workflow_graph=".TRUE."/> -
XIOS/dev/dev_trunk_omp/inputs/iodef.xml
r1668 r1671 19 19 <!-- <field field_ref="field_Domain" name="field_A" /> --> 20 20 <field field_ref="field_A" name="field_A" build_workflow_graph=".TRUE." /> 21 <field field_ref="field_A_zoom" name="field_B" />21 <field field_ref="field_A_zoom" name="field_B" build_workflow_graph=".TRUE."/> 22 22 </file> 23 23 <file id="output1" name="output1" enabled=".TRUE."> 24 24 <!-- <field field_ref="field_Domain" name="field_A" /> --> 25 <field field_ref="field_A" name="field_A "/>25 <field field_ref="field_A" name="field_A_dup" build_workflow_graph=".TRUE."/> 26 26 </file> 27 <file id="output2" name="output2" enabled=". FALSE.">27 <file id="output2" name="output2" enabled=".TRUE."> 28 28 <!-- <field field_ref="field_Domain" name="field_A" /> --> 29 <field field_ref="field_Scalar" name="field_A "/>29 <field field_ref="field_Scalar" name="field_A_scalar" build_workflow_graph=".TRUE."/> 30 30 </file> 31 31 <!-- <file id="output_s" name="output_s" mode="read" > -
XIOS/dev/dev_trunk_omp/src/cxios.cpp
r1670 r1671 357 357 } 358 358 } 359 -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp
r1670 r1671 16 16 if (buildWorkflowGraph) 17 17 { 18 if(InvalidableObject::count_ptr == 0) InvalidableObject::count_ptr = new std::map< StdString, int>; 19 if(InvalidableObject::count_ptr->find(CWorkflowGraph::my_filename) == InvalidableObject::count_ptr->end()) 20 { 21 (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename] = 0; 22 } 23 //filterId = InvalidableObject::count; 24 filterId = (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename]; 25 printf("file_writer_filter ================ filterId = %d\n", (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename]); 26 (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename]++; 27 //InvalidableObject::count++; 18 filterId = InvalidableObject::count; 19 InvalidableObject::count++; 28 20 } 29 21 } -
XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.hpp
r1668 r1671 3 3 4 4 #include "input_pin.hpp" 5 #include "file.hpp" 5 6 6 7 namespace xios … … 24 25 CFileWriterFilter(CGarbageCollector& gc, CField* field, bool buildWorkflowGraph = false); 25 26 26 inline StdString GetName(void) {return StdString("File writer filter");}; 27 //inline StdString GetName(void) {return StdString("File writer filter");}; 28 inline StdString GetName(void) {return StdString("File writer filter : ") + StdString(this->field->file->name);}; 29 27 30 28 31 /*! -
XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.hpp
r1670 r1671 20 20 */ 21 21 void virtual invalidate(Time timestamp) = 0; 22 23 static std::map<StdString, int> *count_ptr;24 #pragma omp threadprivate(count_ptr)25 22 26 23 static int count; //!< Counter used to identify a filter in case building workflow graph -
XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp
r1670 r1671 12 12 if (buildWorkflowGraph) 13 13 { 14 if(InvalidableObject::count_ptr == 0) InvalidableObject::count_ptr = new std::map< StdString, int>; 15 if(InvalidableObject::count_ptr->find(CWorkflowGraph::my_filename) == InvalidableObject::count_ptr->end()) 16 { 17 (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename] = 0; 18 } 19 20 filterId = (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename]; 21 printf("output_pin ================ filterId = %d, CWorkflowGraph::my_filename = %s\n", (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename], CWorkflowGraph::my_filename.c_str()); 22 (*InvalidableObject::count_ptr)[CWorkflowGraph::my_filename]++; 23 24 //filterId = InvalidableObject::count; 25 //InvalidableObject::count++; 14 filterId = InvalidableObject::count; 15 InvalidableObject::count++; 26 16 } 27 17 } … … 52 42 if (buildWorkflowGraph) 53 43 { 54 if(CWorkflowGraph::mapFilterTimestamps_ptr==0) CWorkflowGraph::mapFilterTimestamps_ptr = new std::unordered_map <StdString, std::unordered_map <int, vector<Time> > >;55 if(CWorkflowGraph::timestamps_ptr==0) CWorkflowGraph::timestamps_ptr = new s td::unordered_map< StdString, set<Time>>;56 (*CWorkflowGraph::mapFilterTimestamps_ptr)[ CWorkflowGraph::my_filename][this->getFilterId()].push_back(packet->timestamp);57 (*CWorkflowGraph::timestamps_ptr)[CWorkflowGraph::my_filename].insert(packet->timestamp);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); 58 48 } 59 49 -
XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp
r1670 r1671 56 56 if (buildWorkflowGraph) 57 57 { 58 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map < StdString, std::unordered_map <int, StdString>>;59 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map < StdString, std::unordered_map <StdString, vector <int>> >;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 60 int filterOut = (std::static_pointer_cast<COutputPin>(filter))->getFilterId(); 61 61 int filterIn = (std::static_pointer_cast<COutputPin>(firstFilter))->getFilterId(); 62 62 // PASS field's id here 63 (*CWorkflowGraph::mapFieldToFilters_ptr)[ CWorkflowGraph::my_filename]["XXX"].push_back(filterOut);64 (*CWorkflowGraph::mapFieldToFilters_ptr)[ CWorkflowGraph::my_filename]["XXX"].push_back(filterIn);65 (*CWorkflowGraph::mapFilters_ptr)[ CWorkflowGraph::my_filename][filterOut] = "Spatial transform filter";66 (*CWorkflowGraph::mapFilters_ptr)[ CWorkflowGraph::my_filename][filterIn] = "Spatial transform filter";67 //std::cout<<"CSpatialTransformFilter::CSpatialTransformFilter CWorkflowGraph::mapFieldToFilters_ptr->size = "<<CWorkflowGraph::mapFieldToFilters_ptr->size()<<std::endl;63 (*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 68 } 69 69 } -
XIOS/dev/dev_trunk_omp/src/graphviz.cpp
r1670 r1671 11 11 * 12 12 */ 13 14 15 13 void CGraphviz::buildStaticWorkflowGraph() 16 14 TRY … … 18 16 if (CWorkflowGraph::mapFieldToFilters_ptr !=0 && !CWorkflowGraph::mapFieldToFilters_ptr->empty()) 19 17 { 20 int NB_graph_files = CWorkflowGraph::mapFieldToFilters_ptr->size(); 21 std::unordered_map < StdString, std::unordered_map <StdString, vector <int> > >::iterator it; 22 for(it=CWorkflowGraph::mapFieldToFilters_ptr->begin(); it!=CWorkflowGraph::mapFieldToFilters_ptr->end(); it++) 18 CWorkflowGraph::buildStaticWorkflow(); 19 20 typedef boost::property<boost::edge_name_t, std::string> EdgeProperty; 21 typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, EdgeProperty> Graph; 22 23 // Input 1: nodes (=filters) 24 vector<StdString>& nodes = CWorkflowGraph::filters; 25 const int nbNodes = nodes.size(); 26 27 // Input 2: edges (=fields) 28 vector<StdString>& edges = CWorkflowGraph::fields; 29 30 // Input 3: nodes to edges connectivity 31 vector<pair<int, int> >& nodesToEdges = CWorkflowGraph::fieldsToFilters; 32 const int nbEdges = nodesToEdges.size(); 33 34 // Declare a graph object, adding the edges and edge properties 35 Graph g(nbNodes); 36 for (int j = 0; j < nbEdges; ++j) 23 37 { 24 CWorkflowGraph::buildStaticWorkflow_forfile(it->first);25 26 typedef boost::property<boost::edge_name_t, std::string> EdgeProperty;27 typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, boost::no_property, EdgeProperty> Graph;38 graph_traits<Graph>::edge_descriptor e; 39 bool inserted; 40 boost::tie(e, inserted) = boost::add_edge(nodesToEdges[j].first, nodesToEdges[j].second, edges[j], g); 41 } 28 42 29 // Input 1: nodes (=filters) 30 vector<StdString>& nodes = CWorkflowGraph::filters; 31 const int nbNodes = nodes.size(); 43 std::for_each(vertices(g).first, vertices(g).second, exercise_vertex<Graph>(g)); 32 44 33 // Input 2: edges (=fields) 34 vector<StdString>& edges = CWorkflowGraph::fields; 45 std::map<std::string,std::string> graph_attr, vertex_attr, edge_attr; 46 graph_attr["size"] = "5,5"; 47 graph_attr["rankdir"] = "LR"; 48 graph_attr["ratio"] = "fill"; 49 vertex_attr["shape"] = "record"; 50 vertex_attr["width"] = "2.2"; 51 vertex_attr["fontsize"] = "16"; 35 52 36 // Input 3: nodes to edges connectivity 37 vector<pair<int, int> >& nodesToEdges = CWorkflowGraph::fieldsToFilters; 38 const int nbEdges = nodesToEdges.size(); 53 const std::string filename = "graph.dot"; 54 std::ofstream file (filename.c_str()); 39 55 40 // Declare a graph object, adding the edges and edge properties 41 Graph g(nbNodes); 42 for (int j = 0; j < nbEdges; ++j) 43 { 44 graph_traits<Graph>::edge_descriptor e; 45 bool inserted; 46 boost::tie(e, inserted) = boost::add_edge(nodesToEdges[j].first, nodesToEdges[j].second, edges[j], g); 47 } 48 49 std::for_each(vertices(g).first, vertices(g).second, exercise_vertex<Graph>(g)); 50 51 std::map<std::string,std::string> graph_attr, vertex_attr, edge_attr; 52 graph_attr["size"] = "5,5"; 53 graph_attr["rankdir"] = "LR"; 54 graph_attr["ratio"] = "fill"; 55 vertex_attr["shape"] = "record"; 56 vertex_attr["width"] = "2.2"; 57 vertex_attr["fontsize"] = "16"; 58 59 const std::string filename = it->first + ".static_graph.dot"; 60 std::ofstream file (filename.c_str()); 61 62 boost::write_graphviz(file, g, 56 boost::write_graphviz(file, g, 63 57 boost::make_label_writer(&nodes[0]), 64 58 boost::make_label_writer(get(edge_name, g)), 65 59 boost::make_graph_attributes_writer(graph_attr, vertex_attr, edge_attr)); 66 }60 67 61 } 68 62 } … … 78 72 CATCH 79 73 } 80 -
XIOS/dev/dev_trunk_omp/src/graphviz.hpp
r1670 r1671 33 33 34 34 #endif 35 -
XIOS/dev/dev_trunk_omp/src/node/field.cpp
r1670 r1671 1197 1197 if (buildWorkflowGraph) 1198 1198 { 1199 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map < StdString, std::unordered_map <int, StdString>>;1200 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map < StdString, std::unordered_map <StdString, vector <int>> >;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 1201 int filterOut = filter->getFilterId(); 1202 1202 int filterIn = (std::static_pointer_cast<COutputPin>(filters.second))->getFilterId(); 1203 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterOut); 1204 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterIn); 1205 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = filter->GetName(); 1206 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = filters.second->GetName(); 1207 std::cout<<"CField::buildFilterGraph1 filterIn["<<filterIn<< "] = "<<filters.second->GetName()<< std::endl; 1208 std::cout<<"CField::buildFilterGraph1 filterOut["<<filterOut<< "] = "<<filter->GetName()<< std::endl; 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; 1209 1208 } 1210 1209 filter = filters.second; … … 1234 1233 if (buildWorkflowGraph) 1235 1234 { 1236 //CWorkflowGraph::my_filename = file->name; 1237 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map< StdString, std::unordered_map <int, StdString> >; 1238 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][instantDataFilter->getFilterId()] = instantDataFilter->GetName(); 1239 std::cout<<"CField::buildFilterGraph1.else filter["<<instantDataFilter->getFilterId()<< "] = "<<instantDataFilter->GetName()<< std::endl; 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; 1240 1238 } 1241 1239 } … … 1258 1256 if (buildWorkflowGraph) 1259 1257 { 1260 CWorkflowGraph::my_filename = file->name; 1261 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map< StdString, std::unordered_map <int, StdString> >; 1262 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map< StdString, std::unordered_map <StdString, vector <int> > >; 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> >; 1263 1260 int filterOut = getTemporalDataFilter(gc, file->output_freq)->getFilterId(); 1264 1261 int filterIn = fileWriterFilter->getFilterId(); 1265 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterOut); 1266 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterIn); 1267 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = "Temporal filter"; 1268 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = fileWriterFilter->GetName(); 1269 std::cout<<"CField::buildFilterGraph2 filterIn["<<filterIn<< "] = "<<fileWriterFilter->GetName()<< std::endl; 1270 std::cout<<"CField::buildFilterGraph2 filterOut["<<filterOut<< "] = "<<"Temporal filter"<< std::endl; 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(); 1271 1266 } 1272 1267 } … … 1276 1271 CATCH_DUMP_ATTR 1277 1272 1278 void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput, StdString output_filename)1279 TRY1280 {1281 CWorkflowGraph::my_filename = output_filename;1282 if (!isReferenceSolvedAndTransformed) solveAllEnabledFieldsAndTransform();1283 if (!isGridChecked) checkGridOfEnabledFields();1284 1285 const bool detectMissingValues = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true);1286 const bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true);1287 const double defaultValue = detectMissingValues ? default_value : (!default_value.isEmpty() ? default_value : 0.0);1288 1289 CContext* context = CContext::getCurrent();1290 bool hasWriterServer = context->hasServer && !context->hasClient;1291 bool hasIntermediateServer = context->hasServer && context->hasClient;1292 1293 if (hasWriterServer)1294 {1295 if (!instantDataFilter)1296 instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false));1297 1298 1299 // If the field data is to be read by the client or/and written to a file1300 if (enableOutput && !storeFilter && !fileWriterFilter)1301 {1302 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))1303 {1304 fileServerWriterFilter = std::shared_ptr<CFileServerWriterFilter>(new CFileServerWriterFilter(gc, this));1305 instantDataFilter->connectOutput(fileServerWriterFilter, 0);1306 }1307 }1308 }1309 else if (hasIntermediateServer)1310 {1311 if (!instantDataFilter)1312 instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, false));1313 1314 // If the field data is to be read by the client or/and written to a file1315 if (enableOutput && !storeFilter && !fileWriterFilter)1316 {1317 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))1318 {1319 fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this));1320 instantDataFilter->connectOutput(fileWriterFilter, 0);1321 }1322 }1323 }1324 else1325 {1326 // Start by building a filter which can provide the field's instant data1327 if (!instantDataFilter)1328 {1329 // Check if we have an expression to parse1330 if (hasExpression())1331 {1332 boost::scoped_ptr<IFilterExprNode> expr(parseExpr(getExpression() + '\0'));1333 std::shared_ptr<COutputPin> filter = expr->reduce(gc, *this);1334 1335 // Check if a spatial transformation is needed1336 if (!field_ref.isEmpty())1337 {1338 CField* fieldRef = CField::get(field_ref);1339 fieldRef->build_workflow_graph.setValue(buildWorkflowGraph);1340 CGrid* gridRef = fieldRef->grid;1341 1342 if (grid && grid != gridRef && grid->hasTransform())1343 {1344 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters = CSpatialTransformFilter::buildFilterGraph(gc, gridRef, grid,1345 detectMissingValues, defaultValue, buildWorkflowGraph);1346 1347 filter->connectOutput(filters.first, 0);1348 1349 if (buildWorkflowGraph)1350 {1351 CWorkflowGraph::my_filename = output_filename;1352 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map< StdString, std::unordered_map <int, StdString> >;1353 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map< StdString, std::unordered_map <StdString, vector <int> > >;1354 int filterOut = filter->getFilterId();1355 int filterIn = (std::static_pointer_cast<COutputPin>(filters.second))->getFilterId();1356 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterOut);1357 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterIn);1358 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = filter->GetName();1359 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = filters.second->GetName();1360 std::cout<<"***CField::buildFilterGraph1 filterIn["<<filterIn<< "] = "<<filters.second->GetName()<< std::endl;1361 std::cout<<"***CField::buildFilterGraph1 filterOut["<<filterOut<< "] = "<<filter->GetName()<< std::endl;1362 }1363 filter = filters.second;1364 }1365 }1366 1367 instantDataFilter = filter;1368 }1369 // Check if we have a reference on another field1370 else if (!field_ref.isEmpty())1371 {1372 CField::get(field_ref)->build_workflow_graph.setValue(buildWorkflowGraph);1373 //instantDataFilter = getFieldReference2(gc, output_filename);1374 instantDataFilter = getFieldReference(gc, output_filename);1375 }1376 // Check if the data is to be read from a file1377 else if (file && !file->mode.isEmpty() && file->mode == CFile::mode_attr::read)1378 {1379 checkTimeAttributes();1380 instantDataFilter = serverSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, true, false, freq_offset, true,1381 detectMissingValues, defaultValue, buildWorkflowGraph));1382 }1383 else // The data might be passed from the model1384 {1385 if (check_if_active.isEmpty()) check_if_active = false;1386 instantDataFilter = clientSourceFilter = std::shared_ptr<CSourceFilter>(new CSourceFilter(gc, grid, false, true, NoneDu, false,1387 detectMissingValues, defaultValue, buildWorkflowGraph));1388 if (buildWorkflowGraph)1389 {1390 CWorkflowGraph::my_filename = output_filename;//CWorkflowGraph::my_filename = file->name;1391 printf("*** *** my_filename = %s\n", CWorkflowGraph::my_filename.c_str());1392 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map< StdString, std::unordered_map <int, StdString> >;1393 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][instantDataFilter->getFilterId()] = instantDataFilter->GetName();1394 std::cout<<"***CField::buildFilterGraph1.else filter["<<instantDataFilter->getFilterId()<< "] = "<<instantDataFilter->GetName()<< std::endl;1395 }1396 }1397 }1398 1399 // If the field data is to be read by the client or/and written to a file1400 if (enableOutput && !storeFilter && !fileWriterFilter)1401 {1402 if (!read_access.isEmpty() && read_access)1403 {1404 storeFilter = std::shared_ptr<CStoreFilter>(new CStoreFilter(gc, CContext::getCurrent(), grid,1405 detectMissingValues, defaultValue));1406 instantDataFilter->connectOutput(storeFilter, 0);1407 }1408 1409 if (file && (file->mode.isEmpty() || file->mode == CFile::mode_attr::write))1410 {1411 fileWriterFilter = std::shared_ptr<CFileWriterFilter>(new CFileWriterFilter(gc, this, buildWorkflowGraph));1412 getTemporalDataFilter(gc, file->output_freq)->connectOutput(fileWriterFilter, 0);1413 if (buildWorkflowGraph)1414 {1415 CWorkflowGraph::my_filename = output_filename;//CWorkflowGraph::my_filename = file->name;1416 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map< StdString, std::unordered_map <int, StdString> >;1417 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map< StdString, std::unordered_map <StdString, vector <int> > >;1418 int filterOut = getTemporalDataFilter(gc, file->output_freq)->getFilterId();1419 int filterIn = fileWriterFilter->getFilterId();1420 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterOut);1421 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterIn);1422 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = "Temporal filter";1423 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = fileWriterFilter->GetName();1424 std::cout<<"***CField::buildFilterGraph2 filterIn["<<filterIn<< "] = "<<fileWriterFilter->GetName()<< std::endl;1425 std::cout<<"***CField::buildFilterGraph2 filterOut["<<filterOut<< "] = "<<"Temporal filter"<< std::endl;1426 }1427 }1428 }1429 }1430 }1431 CATCH_DUMP_ATTR1432 1273 /*! 1433 1274 * Returns the filter needed to handle the field reference. … … 1465 1306 if (buildWorkflowGraph) 1466 1307 { 1467 CWorkflowGraph::my_filename = file->name; 1468 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map<StdString, std::unordered_map <int, StdString> >; 1469 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map< StdString, std::unordered_map <StdString, vector <int> > >; 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> >; 1470 1310 int filterOut = fieldRef->instantDataFilter->getFilterId(); 1471 1311 int filterIn = (std::static_pointer_cast<COutputPin>(filters.first))->getFilterId(); 1472 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][fieldRef->getOId()].push_back(filterOut); 1473 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][fieldRef->getOId()].push_back(filterIn); 1474 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = fieldRef->getInstantDataFilter()->GetName(); 1475 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = filters.first->GetName(); 1476 std::cout<<"CField::getFieldReference filterIn["<<filterIn<< "] = "<<filters.first->GetName()<< std::endl; 1477 std::cout<<"CField::getFieldReference filterOut["<<filterOut<< "] = "<<fieldRef->getInstantDataFilter()->GetName()<< std::endl; 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; 1478 1317 } 1479 1318 return filters.second; 1480 1319 } 1481 1320 CATCH_DUMP_ATTR 1482 1483 std::shared_ptr<COutputPin> CField::getFieldReference(CGarbageCollector& gc, StdString output_filename) 1484 TRY 1485 { 1486 CWorkflowGraph::my_filename = output_filename; 1487 if (instantDataFilter || field_ref.isEmpty()) 1488 ERROR("COutputPin* CField::getFieldReference(CGarbageCollector& gc)", 1489 "Impossible to get the field reference for a field which has already been parsed or which does not have a field_ref."); 1490 1491 CField* fieldRef = CField::get(field_ref); 1492 //fieldRef->buildFilterGraph2(gc, false, output_filename); 1493 fieldRef->buildFilterGraph(gc, false, output_filename); 1494 bool buildWorkflowGraph = (!build_workflow_graph.isEmpty() && build_workflow_graph == true); 1495 1496 std::pair<std::shared_ptr<CFilter>, std::shared_ptr<CFilter> > filters; 1497 // Check if a spatial transformation is needed 1498 if (grid && grid != fieldRef->grid && grid->hasTransform()) 1499 { 1500 bool hasMissingValue = (!detect_missing_value.isEmpty() && !default_value.isEmpty() && detect_missing_value == true); 1501 double defaultValue = hasMissingValue ? default_value : (!default_value.isEmpty() ? default_value : 0.0); 1502 filters = CSpatialTransformFilter::buildFilterGraph(gc, fieldRef->grid, grid, hasMissingValue, defaultValue, buildWorkflowGraph); 1503 } 1504 else 1505 { 1506 filters.first = filters.second = std::shared_ptr<CFilter>(new CPassThroughFilter(gc, buildWorkflowGraph)); 1507 } 1508 1509 fieldRef->getInstantDataFilter()->connectOutput(filters.first, 0); 1510 1511 if (buildWorkflowGraph) 1512 { 1513 CWorkflowGraph::my_filename = output_filename; 1514 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map<StdString, std::unordered_map <int, StdString> >; 1515 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map< StdString, std::unordered_map <StdString, vector <int> > >; 1516 int filterOut = fieldRef->instantDataFilter->getFilterId(); 1517 int filterIn = (std::static_pointer_cast<COutputPin>(filters.first))->getFilterId(); 1518 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][fieldRef->getOId()].push_back(filterOut); 1519 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][fieldRef->getOId()].push_back(filterIn); 1520 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = fieldRef->getInstantDataFilter()->GetName(); 1521 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = filters.first->GetName(); 1522 std::cout<<"CField::getFieldReference filterIn["<<filterIn<< "] = "<<filters.first->GetName()<< std::endl; 1523 std::cout<<"CField::getFieldReference filterOut["<<filterOut<< "] = "<<fieldRef->getInstantDataFilter()->GetName()<< std::endl; 1524 } 1525 return filters.second; 1526 } 1527 CATCH_DUMP_ATTR 1321 1528 1322 /*! 1529 1323 * Returns the filter needed to handle a self reference in the field's expression. … … 1613 1407 if (buildWorkflowGraph) 1614 1408 { 1615 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map < StdString, std::unordered_map <int, StdString>>;1616 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map <StdString, std::unordered_map <StdString, vector <int>> >;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> >; 1617 1411 int filterOut = instantDataFilter->getFilterId(); 1618 1412 int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId(); 1619 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterOut); 1620 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterIn); 1621 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = getInstantDataFilter()->GetName(); 1622 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = temporalFilter->GetName(); 1623 std::cout<<"CField::getTemporalDataFilter filterIn["<<filterIn<< "] = "<<temporalFilter->GetName()<< std::endl; 1624 std::cout<<"CField::getTemporalDataFilter filterOut["<<filterOut<< "] = "<<getInstantDataFilter()->GetName()<< std::endl; 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; 1625 1418 } 1626 1419 … … 1669 1462 1670 1463 { 1671 if(CWorkflowGraph::mapFilters_ptr==0) CWorkflowGraph::mapFilters_ptr = new std::unordered_map <StdString, std::unordered_map <int, StdString>>;1672 if(CWorkflowGraph::mapFieldToFilters_ptr==0) CWorkflowGraph::mapFieldToFilters_ptr = new std::unordered_map < StdString, std::unordered_map <StdString, vector <int>> >;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> >; 1673 1466 int filterOut = selfReferenceFilter->getFilterId(); 1674 1467 int filterIn = (std::static_pointer_cast<COutputPin>(temporalFilter))->getFilterId(); 1675 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterOut); 1676 (*CWorkflowGraph::mapFieldToFilters_ptr)[CWorkflowGraph::my_filename][this->getOId()].push_back(filterIn); 1677 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterOut] = selfReferenceFilter->GetName(); 1678 (*CWorkflowGraph::mapFilters_ptr)[CWorkflowGraph::my_filename][filterIn] = temporalFilter->GetName(); 1679 std::cout<<"CField::getSelfTemporalDataFilter filterIn["<<filterIn<< "] = "<<temporalFilter->GetName()<< std::endl; 1680 std::cout<<"CField::getSelfTemporalDataFilter filterOut["<<filterOut<< "] = "<<selfReferenceFilter->GetName()<< std::endl; 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; 1681 1473 } 1682 1474 … … 2205 1997 DEFINE_REF_FUNC(Field,field) 2206 1998 } // namespace xios 2207 -
XIOS/dev/dev_trunk_omp/src/node/field.hpp
r1670 r1671 143 143 144 144 void buildFilterGraph(CGarbageCollector& gc, bool enableOutput); 145 void buildFilterGraph(CGarbageCollector& gc, bool enableOutput, StdString out_filename);146 145 size_t getGlobalWrittenSize(void) ; 147 146 148 147 149 148 std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc); 150 std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc, StdString out_filename);151 149 std::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc); 152 150 std::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); … … 297 295 298 296 #endif // __XIOS_CField__ 299 -
XIOS/dev/dev_trunk_omp/src/node/file.cpp
r1670 r1671 983 983 for (int i = 0; i < size; ++i) 984 984 { 985 //this->enabledFields[i]->buildFilterGraph(gc, true); 986 //this->enabledFields[i]->buildFilterGraph2(gc, true, this->name); 987 this->enabledFields[i]->buildFilterGraph(gc, true, this->name); 985 this->enabledFields[i]->buildFilterGraph(gc, true); 988 986 } 989 987 } -
XIOS/dev/dev_trunk_omp/src/test/test_omp.f90
r1670 r1671 169 169 PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 170 170 171 DO ts=1, 1171 DO ts=1,4 172 172 CALL xios_update_calendar(ts) 173 173 CALL xios_send_field("field_A",field_A) -
XIOS/dev/dev_trunk_omp/src/workflow_graph.cpp
r1670 r1671 4 4 { 5 5 6 std::unordered_map < StdString, std::unordered_map <StdString, vector <int> >> *CWorkflowGraph::mapFieldToFilters_ptr = 0;6 std::unordered_map <StdString, vector <int > > *CWorkflowGraph::mapFieldToFilters_ptr = 0; 7 7 #pragma omp threadprivate(CWorkflowGraph::mapFieldToFilters_ptr) 8 8 9 std::unordered_map < StdString, std::unordered_map <int, StdString>> *CWorkflowGraph::mapFilters_ptr = 0;9 std::unordered_map <int, StdString> *CWorkflowGraph::mapFilters_ptr = 0; 10 10 #pragma omp threadprivate(CWorkflowGraph::mapFilters_ptr) 11 11 12 std::unordered_map < StdString, std::unordered_map <int, vector<Time> >> *CWorkflowGraph::mapFilterTimestamps_ptr = 0;12 std::unordered_map <int,vector<Time> > *CWorkflowGraph::mapFilterTimestamps_ptr = 0; 13 13 #pragma omp threadprivate(CWorkflowGraph::mapFilterTimestamps_ptr) 14 14 15 s td::unordered_map< StdString, set<Time>> *CWorkflowGraph::timestamps_ptr = 0;15 set<Time> *CWorkflowGraph::timestamps_ptr = 0; 16 16 #pragma omp threadprivate(CWorkflowGraph::timestamps_ptr) 17 17 … … 19 19 vector <StdString> CWorkflowGraph::fields; 20 20 vector <pair<int, int> > CWorkflowGraph::fieldsToFilters; 21 22 StdString CWorkflowGraph::my_filename = "my_filename";23 #pragma omp threadprivate(CWorkflowGraph::my_filename)24 25 std::map< StdString, int> *InvalidableObject::count_ptr=0;26 #pragma omp threadprivate(InvalidableObject::count_ptr)27 21 28 22 CWorkflowGraph::CWorkflowGraph() … … 32 26 * Reorganize information collected by XIOS for visualization. 33 27 */ 34 /*35 36 28 void CWorkflowGraph::buildStaticWorkflow() 37 29 TRY … … 58 50 } 59 51 CATCH 60 */61 62 void CWorkflowGraph::buildStaticWorkflow_forfile(StdString filename)63 TRY64 {65 // Create a list of filters (graph nodes)66 //if(mapFilters_ptr==0) mapFilters_ptr = new std::unordered_map <int, StdString>;67 //if(mapFieldToFilters_ptr==0) mapFieldToFilters_ptr = new std::unordered_map <StdString, vector <int > >;68 size_t filterIdx = 0;69 filters.resize((*mapFilters_ptr)[filename].size());70 fieldsToFilters.clear();71 fields.clear();72 73 74 for (std::unordered_map <int, StdString>::iterator it=(*mapFilters_ptr)[filename].begin(); it != (*mapFilters_ptr)[filename].end(); it++)75 {76 filters[it->first]=it->second;77 }78 79 // Create a list of fields and their filter connectivity (graph edges and edge-to-node connectivity)80 for (std::unordered_map <StdString, vector <int > >::iterator it=(*mapFieldToFilters_ptr)[filename].begin(); it != (*mapFieldToFilters_ptr)[filename].end(); it++)81 {82 for (size_t i = 0; i < (it->second.size() - 1); i+=2)83 {84 fieldsToFilters.push_back(make_pair(it->second[i],it->second[i+1]));85 fields.push_back(it->first);86 }87 }88 }89 CATCH90 52 91 53 … … 96 58 for (auto it=mapFilters_ptr->begin(); it != mapFilters_ptr->end(); it++) 97 59 { 98 for (auto it2=mapFilters_ptr->at(it->first).begin(); it2 != mapFilters_ptr->at(it->first).end(); it2++) 99 std::cout<<"mapFilters_ptr["<<it->first<<"]="<<it2->first<<" "<<it2->second<<std::endl; 60 std::cout<<"mapFilters_ptr["<<it->first<<"]="<<it->second<<std::endl; 100 61 } 101 62 else std::cout<<"mapFilters_ptr empty"<<std::endl; … … 104 65 for (auto it=mapFieldToFilters_ptr->begin(); it != mapFieldToFilters_ptr->end(); it++) 105 66 { 106 for ( auto it2=mapFieldToFilters_ptr->at(it->first).begin(); it2 != mapFieldToFilters_ptr->at(it->first).end(); it2++)67 for (size_t i = 0; i < it->second.size(); i++) 107 68 { 108 for (size_t i = 0; i < it2->second.size(); i++) 109 std::cout<<"mapFieldToFilters_ptr["<<it->first<<"]["<<it2->first<<"]["<<i<<"] = "<<it2->second[i]<<std::endl; 69 std::cout<<"mapFieldToFilters_ptr["<<it->first<<"]["<<i<<"] = "<<it->second[i]<<std::endl; 110 70 } 111 71 } 112 72 else std::cout<<"mapFieldToFilters_ptr empty"<<mapFieldToFilters_ptr<<std::endl; 113 /* 114 if(mapFilterTimestamps_ptr!=0 && !mapFilterTimestamps_ptr->empty())73 74 /*if(mapFilterTimestamps_ptr!=0 && !mapFilterTimestamps_ptr->empty()) 115 75 for (auto it=mapFilterTimestamps_ptr->begin(); it != mapFilterTimestamps_ptr->end(); it++) 116 76 { … … 133 93 134 94 } 135 -
XIOS/dev/dev_trunk_omp/src/workflow_graph.hpp
r1670 r1671 21 21 * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()). 22 22 */ 23 static std::unordered_map < StdString, std::unordered_map <StdString, vector <int> > >*mapFieldToFilters_ptr;23 static std::unordered_map <StdString, vector <int> > *mapFieldToFilters_ptr; 24 24 #pragma omp threadprivate(mapFieldToFilters_ptr) 25 25 … … 27 27 * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()). 28 28 */ 29 static std::unordered_map < StdString, std::unordered_map <int, StdString> >*mapFilters_ptr;29 static std::unordered_map <int, StdString> *mapFilters_ptr; 30 30 #pragma omp threadprivate(mapFilters_ptr) 31 31 … … 33 33 * Timestamps are added into the map at the exit of a filter (in function COutputPin::onOutputReady) 34 34 */ 35 static std::unordered_map < StdString, std::unordered_map <int, vector<Time> >> *mapFilterTimestamps_ptr;35 static std::unordered_map <int, vector<Time> > *mapFilterTimestamps_ptr; 36 36 #pragma omp threadprivate(mapFilterTimestamps_ptr) 37 37 … … 39 39 * Timestamps are added at the exit of a filter (in function COutputPin::onOutputReady) 40 40 */ 41 static s td::unordered_map< StdString, set<Time>> *timestamps_ptr;41 static set<Time> *timestamps_ptr; 42 42 #pragma omp threadprivate(timestamps_ptr) 43 44 static StdString my_filename;45 #pragma omp threadprivate(my_filename)46 43 47 44 private: … … 57 54 58 55 static void buildStaticWorkflow(); 59 static void buildStaticWorkflow_forfile(StdString filename);60 56 static void showStaticWorkflow(); 61 57 … … 65 61 66 62 #endif 67
Note: See TracChangeset
for help on using the changeset viewer.