Changeset 1671 for XIOS


Ignore:
Timestamp:
06/04/19 10:00:52 (5 years ago)
Author:
yushan
Message:

MARK: branch merged with trunk @1663. One output graph file with output file names in file writer filter.

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  
    33<context id="atmosphere"> 
    44 
    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" /> 
    88  </field_definition> 
    99 
    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."> 
    1111    <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."/> 
    1314    </file> 
    1415    <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."/> 
    1617    </file> 
    1718  </file_definition> 
  • XIOS/dev/dev_trunk_omp/inputs/COMPLETE/context_surface.xml

    r1668 r1671  
    1212  </field_definition> 
    1313 
    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."> 
    1515    <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.">  
    1717        <variable id="my_attribute1" type="string">surf_att</variable> 
    1818        <variable id="my_attribute2" type="int"> 10 </variable> 
     
    2020        <variable id="my_attribute5" type="double">100.201</variable> 
    2121      </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> 
    3131      <variable id="my_global_attribute" type="string">file_6h</variable> 
    3232    </file> 
    3333 
    3434    <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."> 
    3636        <variable id="my_attribute1" type="string">surf_att</variable> 
    3737        <variable id="my_attribute2" type="int">10</variable> 
     
    3939        <variable id="my_attribute4" type="double">100.201</variable> 
    4040      </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> 
    4646      <variable id="my_global_attribute" type="string" >file_1d</variable> 
    4747    </file> 
  • XIOS/dev/dev_trunk_omp/inputs/REMAP/iodef.xml

    r1669 r1671  
    66   <field_definition level="1" > 
    77    <field_group id="fields_src" operation="instant"> 
    8        <field id="src_field_2D"  domain_ref="src_domain"/> 
     8       <field id="src_field_2D" domain_ref="src_domain"/> 
    99       <field id="src_field_2D_clone" domain_ref="src_domain_clone"/> 
    1010       <field id="src_field_3D" domain_ref="src_domain" axis_ref="src_axis"/>        
     
    3535        <file id="output_2D" name="output_2D" > 
    3636          <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"/> 
    3838          <field field_ref="dst_field_2D" name="field_dst_regular_1" build_workflow_graph=".TRUE."/> 
    3939          <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  
    1919        <!-- <field field_ref="field_Domain" name="field_A" /> --> 
    2020        <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."/> 
    2222     </file> 
    2323     <file id="output1" name="output1" enabled=".TRUE."> 
    2424        <!-- <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."/>         
    2626     </file>   
    27      <file id="output2" name="output2" enabled=".FALSE."> 
     27     <file id="output2" name="output2" enabled=".TRUE."> 
    2828        <!-- <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."/>         
    3030     </file> 
    3131 <!--     <file id="output_s" name="output_s" mode="read" > 
  • XIOS/dev/dev_trunk_omp/src/cxios.cpp

    r1670 r1671  
    357357  } 
    358358} 
    359  
  • XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp

    r1670 r1671  
    1616    if (buildWorkflowGraph) 
    1717    { 
    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++; 
    2820    } 
    2921  } 
  • XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.hpp

    r1668 r1671  
    33 
    44#include "input_pin.hpp" 
     5#include "file.hpp" 
    56 
    67namespace xios 
     
    2425      CFileWriterFilter(CGarbageCollector& gc, CField* field, bool buildWorkflowGraph = false); 
    2526 
    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 
    2730 
    2831      /*! 
  • XIOS/dev/dev_trunk_omp/src/filter/garbage_collector.hpp

    r1670 r1671  
    2020     */ 
    2121    void virtual invalidate(Time timestamp) = 0; 
    22  
    23     static std::map<StdString, int> *count_ptr; 
    24     #pragma omp threadprivate(count_ptr) 
    2522   
    2623    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  
    1212    if (buildWorkflowGraph) 
    1313    { 
    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++; 
    2616    } 
    2717  } 
     
    5242    if (buildWorkflowGraph) 
    5343    { 
    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 std::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); 
    5848    } 
    5949 
  • XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp

    r1670 r1671  
    5656        if (buildWorkflowGraph) 
    5757        { 
    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> >; 
    6060          int filterOut = (std::static_pointer_cast<COutputPin>(filter))->getFilterId(); 
    6161          int filterIn = (std::static_pointer_cast<COutputPin>(firstFilter))->getFilterId(); 
    6262          // 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; 
    6868        } 
    6969      } 
  • XIOS/dev/dev_trunk_omp/src/graphviz.cpp

    r1670 r1671  
    1111   * 
    1212   */ 
    13    
    14  
    1513  void CGraphviz::buildStaticWorkflowGraph() 
    1614  TRY 
     
    1816    if (CWorkflowGraph::mapFieldToFilters_ptr !=0 && !CWorkflowGraph::mapFieldToFilters_ptr->empty()) 
    1917    { 
    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) 
    2337      { 
    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      } 
    2842 
    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)); 
    3244 
    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"; 
    3552 
    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()); 
    3955 
    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, 
    6357          boost::make_label_writer(&nodes[0]), 
    6458          boost::make_label_writer(get(edge_name, g)), 
    6559          boost::make_graph_attributes_writer(graph_attr, vertex_attr, edge_attr)); 
    66       } 
     60          
    6761    } 
    6862  } 
     
    7872  CATCH 
    7973} 
    80  
  • XIOS/dev/dev_trunk_omp/src/graphviz.hpp

    r1670 r1671  
    3333 
    3434#endif 
    35  
  • XIOS/dev/dev_trunk_omp/src/node/field.cpp

    r1670 r1671  
    11971197               if (buildWorkflowGraph) 
    11981198               { 
    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> >; 
    12011201                 int filterOut = filter->getFilterId(); 
    12021202                 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; 
    12091208               } 
    12101209               filter = filters.second; 
     
    12341233            if (buildWorkflowGraph)  
    12351234            { 
    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; 
    12401238            }   
    12411239         } 
     
    12581256           if (buildWorkflowGraph) 
    12591257           { 
    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> >; 
    12631260             int filterOut = getTemporalDataFilter(gc, file->output_freq)->getFilterId(); 
    12641261             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(); 
    12711266           } 
    12721267         } 
     
    12761271   CATCH_DUMP_ATTR 
    12771272 
    1278    void CField::buildFilterGraph(CGarbageCollector& gc, bool enableOutput, StdString output_filename) 
    1279    TRY 
    1280    {      
    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 file 
    1300        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 file 
    1315        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      else 
    1325      { 
    1326        // Start by building a filter which can provide the field's instant data 
    1327        if (!instantDataFilter) 
    1328        { 
    1329          // Check if we have an expression to parse 
    1330          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 needed 
    1336            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 field 
    1370          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 file 
    1377          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 model 
    1384          { 
    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 file 
    1400        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_ATTR 
    14321273   /*! 
    14331274    * Returns the filter needed to handle the field reference. 
     
    14651306     if (buildWorkflowGraph) 
    14661307     { 
    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> >; 
    14701310       int filterOut = fieldRef->instantDataFilter->getFilterId(); 
    14711311       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; 
    14781317     } 
    14791318     return filters.second; 
    14801319   } 
    14811320   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 
    15281322   /*! 
    15291323    * Returns the filter needed to handle a self reference in the field's expression. 
     
    16131407       if (buildWorkflowGraph) 
    16141408       { 
    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> >; 
    16171411         int filterOut = instantDataFilter->getFilterId(); 
    16181412         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; 
    16251418       } 
    16261419 
     
    16691462 
    16701463       { 
    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> >; 
    16731466         int filterOut = selfReferenceFilter->getFilterId(); 
    16741467         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; 
    16811473       } 
    16821474 
     
    22051997   DEFINE_REF_FUNC(Field,field) 
    22061998} // namespace xios 
    2207  
  • XIOS/dev/dev_trunk_omp/src/node/field.hpp

    r1670 r1671  
    143143 
    144144         void buildFilterGraph(CGarbageCollector& gc, bool enableOutput); 
    145          void buildFilterGraph(CGarbageCollector& gc, bool enableOutput, StdString out_filename); 
    146145         size_t getGlobalWrittenSize(void) ; 
    147146          
    148147          
    149148         std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc); 
    150          std::shared_ptr<COutputPin> getFieldReference(CGarbageCollector& gc, StdString out_filename); 
    151149         std::shared_ptr<COutputPin> getSelfReference(CGarbageCollector& gc); 
    152150         std::shared_ptr<COutputPin> getTemporalDataFilter(CGarbageCollector& gc, CDuration outFreq); 
     
    297295 
    298296#endif // __XIOS_CField__ 
    299  
  • XIOS/dev/dev_trunk_omp/src/node/file.cpp

    r1670 r1671  
    983983     for (int i = 0; i < size; ++i) 
    984984     { 
    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); 
    988986     } 
    989987   } 
  • XIOS/dev/dev_trunk_omp/src/test/test_omp.f90

    r1670 r1671  
    169169   PRINT*,"field field_A is active ? ",xios_field_is_active("field_A") 
    170170 
    171    DO ts=1,1 
     171   DO ts=1,4 
    172172    CALL xios_update_calendar(ts) 
    173173    CALL xios_send_field("field_A",field_A) 
  • XIOS/dev/dev_trunk_omp/src/workflow_graph.cpp

    r1670 r1671  
    44{ 
    55 
    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; 
    77  #pragma omp threadprivate(CWorkflowGraph::mapFieldToFilters_ptr) 
    88 
    9   std::unordered_map < StdString, std::unordered_map <int, StdString>  > *CWorkflowGraph::mapFilters_ptr = 0; 
     9  std::unordered_map <int, StdString> *CWorkflowGraph::mapFilters_ptr = 0; 
    1010  #pragma omp threadprivate(CWorkflowGraph::mapFilters_ptr) 
    1111 
    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; 
    1313  #pragma omp threadprivate(CWorkflowGraph::mapFilterTimestamps_ptr) 
    1414 
    15   std::unordered_map< StdString, set<Time> >  *CWorkflowGraph::timestamps_ptr = 0; 
     15  set<Time>  *CWorkflowGraph::timestamps_ptr = 0; 
    1616  #pragma omp threadprivate(CWorkflowGraph::timestamps_ptr) 
    1717 
     
    1919  vector <StdString> CWorkflowGraph::fields; 
    2020  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) 
    2721 
    2822  CWorkflowGraph::CWorkflowGraph() 
     
    3226   * Reorganize information collected by XIOS for visualization. 
    3327   */ 
    34   /* 
    35  
    3628  void CWorkflowGraph::buildStaticWorkflow() 
    3729  TRY 
     
    5850  } 
    5951  CATCH 
    60 */ 
    61  
    62   void CWorkflowGraph::buildStaticWorkflow_forfile(StdString filename) 
    63   TRY 
    64   { 
    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   CATCH 
    9052 
    9153 
     
    9658    for (auto it=mapFilters_ptr->begin(); it != mapFilters_ptr->end(); it++) 
    9759    { 
    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; 
    10061    } 
    10162    else std::cout<<"mapFilters_ptr empty"<<std::endl; 
     
    10465    for (auto it=mapFieldToFilters_ptr->begin(); it != mapFieldToFilters_ptr->end(); it++) 
    10566    { 
    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++) 
    10768      { 
    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; 
    11070      } 
    11171    } 
    11272    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()) 
    11575    for (auto it=mapFilterTimestamps_ptr->begin(); it != mapFilterTimestamps_ptr->end(); it++) 
    11676    { 
     
    13393 
    13494} 
    135  
  • XIOS/dev/dev_trunk_omp/src/workflow_graph.hpp

    r1670 r1671  
    2121       * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()). 
    2222      */ 
    23       static std::unordered_map < StdString, std::unordered_map <StdString, vector <int> >    > *mapFieldToFilters_ptr; 
     23      static std::unordered_map <StdString, vector <int> > *mapFieldToFilters_ptr; 
    2424      #pragma omp threadprivate(mapFieldToFilters_ptr) 
    2525 
     
    2727       * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()). 
    2828       */ 
    29       static std::unordered_map < StdString, std::unordered_map <int, StdString>  >  *mapFilters_ptr; 
     29      static std::unordered_map <int, StdString> *mapFilters_ptr; 
    3030      #pragma omp threadprivate(mapFilters_ptr) 
    3131 
     
    3333       * Timestamps are added into the map at the exit of a filter (in function COutputPin::onOutputReady) 
    3434       */ 
    35       static std::unordered_map < StdString, std::unordered_map <int, vector<Time> > > *mapFilterTimestamps_ptr; 
     35      static std::unordered_map <int, vector<Time> > *mapFilterTimestamps_ptr; 
    3636      #pragma omp threadprivate(mapFilterTimestamps_ptr) 
    3737 
     
    3939       * Timestamps are added at the exit of a filter (in function COutputPin::onOutputReady) 
    4040       */ 
    41       static std::unordered_map< StdString, set<Time> > *timestamps_ptr; 
     41      static set<Time> *timestamps_ptr; 
    4242      #pragma omp threadprivate(timestamps_ptr) 
    43  
    44       static StdString my_filename; 
    45       #pragma omp threadprivate(my_filename) 
    4643 
    4744    private: 
     
    5754 
    5855      static void buildStaticWorkflow(); 
    59       static void buildStaticWorkflow_forfile(StdString filename); 
    6056      static void showStaticWorkflow(); 
    6157 
     
    6561 
    6662#endif 
    67  
Note: See TracChangeset for help on using the changeset viewer.