Changeset 1685 for XIOS


Ignore:
Timestamp:
07/31/19 13:34:37 (5 years ago)
Author:
yushan
Message:

dev for graph

Location:
XIOS/dev/dev_trunk_omp
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/context_atm.xml

    r1680 r1685  
    289289   
    290290  <field_definition level="1" prec="8" operation="instant" freq_op="1ts" enabled=".true." default_value="1.e+20" detect_missing_value="true"> 
    291     <field id="field2D" grid_ref="grid2D" /> 
    292     <field id="field3D" grid_ref="grid3D" build_workflow_graph=".TRUE." /> 
     291    <field id="field2D" grid_ref="grid2D" build_workflow_graph="false" /> 
     292    <field id="field3D" grid_ref="grid3D" build_workflow_graph="true" /> 
    293293    <field id="pressure" grid_ref="grid3D"  /> 
    294294    <field id="field3D_recv" read_access="true" grid_ref="grid3D"  field_ref="field3D" /> 
    295295    <field id="field3D_resend" grid_ref="grid3D" /> 
    296296 
    297     <field id="field_X" grid_ref="grid_X" /> 
    298     <field id="field_Y" grid_ref="grid_Y" /> 
    299     <field id="field_Z" grid_ref="grid1D" /> 
     297    <field id="field_X" grid_ref="grid_X" build_workflow_graph="false" /> 
     298    <field id="field_Y" grid_ref="grid_Y" build_workflow_graph="false" /> 
     299    <field id="field_Z" grid_ref="grid1D" build_workflow_graph="false" /> 
    300300    <field id="field_XY" grid_ref="grid_XY" /> 
    301301    <field id="field_XYZ" grid_ref="grid_XYZ" /> 
  • XIOS/dev/dev_trunk_omp/GENERIC_TESTCASE/iodef.xml

    r1679 r1685  
    66 
    77      <variable id="timestep"> 1h </variable> 
    8       <variable id="domain"> gaussian </variable> 
     8      <variable id="domain"> lmdz </variable> 
    99      <variable id="domain_mask"> true </variable> 
    1010      <variable id="axis_mask"> true </variable> 
     
    5454        <variable id="info_level" type="int">100</variable> 
    5555        <variable id="print_file" type="bool">true</variable> 
    56         <variable id="using_server2" type="bool">true</variable> 
     56        <variable id="using_server2" type="bool">false</variable> 
    5757        <variable id="ratio_server2" type="int">50</variable> 
    5858        <variable id="pure_one_sided" type="bool">false</variable> 
  • XIOS/dev/dev_trunk_omp/inputs/vis.html

    r1683 r1685  
    4242        /* /!\ Use border-top-color not border-color for firefox compatibility */ 
    4343 
    44         /*  Source Filter */ 
    45         #class_1 { 
    46             background-color: LightSlateGray; 
    47             border: 2px solid SlateGray; 
    48             border-top-color: SlateGray; 
    49         } 
    50  
    51         /* Arithmetic Filter */ 
    52         #class_2 { 
    53             background-color: Khaki; 
    54             border: 2px solid DarkKhaki; 
    55             border-top-color: DarkKhaki; 
    56         } 
    57  
    58         /* Axis Trans. Filter */ 
    59         #class_3 { 
    60             background-color: Orchid; 
    61             border: 2px solid DarkOrchid; 
    62             border-top-color: DarkOrchid; 
    63         } 
    64  
    65         /* Temporal Filter */ 
    66         #class_4 { 
    67             background-color: Orange; 
    68             border: 2px solid DarkOrange; 
    69             border-top-color: DarkOrange; 
    70         } 
    71  
    72         /* Pass Through Filter */ 
    73         #class_5 { 
    74             background-color: YellowGreen; 
    75             border: 2px solid OliveDrab; 
    76             border-top-color: OliveDrab; 
    77         } 
    78  
    79         /* File Writer Filter */ 
    80         #class_6 { 
    81             background-color: LightGray; 
    82             border: 2px solid Gray; 
    83             border-top-color: Gray; 
    84         } 
     44  
     45         
    8546    </style> 
    8647 
     
    11273 
    11374 
    114             //=========================================================== 
    115             $('#clusteringcid2').on('click', function()  
    116             { 
    117                 network.setData(data); 
    118                 var clusterOptionsByData =  
    119                 { 
    120                     joinCondition:function(childOptions)  
    121                     { 
    122                         return childOptions.cid === 2; 
    123                     }, 
    124                     clusterNodeProperties: {id:'cidCluster', borderWidth:3, shape:'database'} 
    125                 }; 
    126                 network.clustering.cluster(clusterOptionsByData); 
    127                 var allNode = nodes.get(); 
    128                 nodes.update(allNode); 
    129             }); 
    130  
    131  
    13275 
    13376            //=========================================================== 
     
    165108 
    166109                } 
     110 
     111 
     112            });  
     113 
     114 
     115            //=========================================================== 
     116            $('#showGraph').on('click', function()  
     117            { 
     118                //===== hide all except selected 
     119                var allNode = nodes.get(); 
     120 
     121                for(i=0; i<allNode.length; i++) 
     122                { 
     123                    var node = allNode[i]; 
     124 
     125                    if(node.hidden != true) 
     126                    { 
     127                        node.hidden = true; 
     128                    } 
     129                } 
     130 
     131                nodes.update(allNode); 
     132 
     133                var node = nodes.get(nodeSelected); 
     134                node.hidden = false; 
     135                nodes.update(node); 
     136 
     137                //===== enable all parents 
     138                console.log("showAllParents: allParentsNode = ", allParentsNode); 
     139                allNode = nodes.get(allParentsNode); 
     140 
     141                for (i = 0; i < allNode.length; i++) { 
     142                    node = allNode[i]; 
     143                    node.font = { 
     144                        color:'black' 
     145                    } 
     146                    node.hidden = false; 
     147                    if(node.filled == 1) 
     148                    {                 
     149                        node.color = { 
     150                            background: redNode.background, 
     151                            border: redNode.border, 
     152                            hover: redNode.background, 
     153                            highlight: { 
     154                               background: redNode.background, 
     155                               border: 'blue' 
     156                            } 
     157                        } 
     158                    }  
     159                    else 
     160                    { 
     161                        node.color = { 
     162                            background: styleArr[node.class].background, 
     163                            border: styleArr[node.class].border, 
     164                            highlight: { 
     165                                background: styleArr[node.class].background, 
     166                                border: 'blue' 
     167                            } 
     168                        } 
     169                    }    
     170                } 
     171 
     172                nodes.update(allNode); 
     173 
     174                node = nodes.get(nodeSelected); 
     175                var connectedEdgeArray = edges.get(network.getConnectedEdges(node.id)); 
     176                for (j = 0; j < connectedEdgeArray.length; j++) 
     177                {                         
     178                    var edge = connectedEdgeArray[j]; 
     179                    if(edge.to == node.id) 
     180                    { 
     181                        edge.hidden = false; 
     182                    } 
     183                     
     184                } 
     185                edges.update(connectedEdgeArray); 
     186 
     187                allNode = nodes.get(); 
     188                nodes.update(allNode); 
     189 
     190                //===== enable all children 
     191                allNode = nodes.get(allChildNode); 
     192 
     193                for (i = 0; i < allNode.length; i++) { 
     194                    node = allNode[i]; 
     195                    node.font = { 
     196                        color:'black' 
     197                    } 
     198                    node.hidden = false; 
     199                    if(node.filled == 1) 
     200                    {                 
     201                        node.color = { 
     202                            background: redNode.background, 
     203                            border: redNode.border, 
     204                            hover: redNode.background, 
     205                            highlight: { 
     206                                background: redNode.background, 
     207                                border: 'blue' 
     208                            } 
     209                        } 
     210                    }  
     211                    else 
     212                    { 
     213                        node.color = { 
     214                            background: styleArr[node.class].background, 
     215                            border: styleArr[node.class].border, 
     216                            highlight: { 
     217                                background: styleArr[node.class].background, 
     218                                border: 'blue' 
     219                            } 
     220                        } 
     221                    }            
     222                } 
     223 
     224                nodes.update(allNode); 
     225 
     226                allNode = nodes.get(); 
     227                nodes.update(allNode); 
    167228 
    168229 
     
    698759                }, 
    699760                7: { 
    700                     background: 'LightGray', 
     761                    background: 'LightBlue', 
    701762                    border: 'Gray', 
    702763                    shape: 'ellipse' 
     
    851912                                }, 
    852913                                physics: { 
    853                                     enabled: false, 
    854                                     stabilization: false 
     914                                    enabled: false 
    855915                                }, 
    856916                                nodes: { 
     
    867927                                        levelSeparation: 300, 
    868928                                        nodeSpacing: 80, 
    869                                         treeSpacing: 200, 
     929                                        treeSpacing: 100, 
     930                                        blockShifting: true, 
     931                                        edgeMinimization: true 
    870932                                    } 
    871933                                }, 
     
    10101072            <button type="button" class="btn btn-default" id="disableAllChild">Disable all children</button> 
    10111073            <button type="button" class="btn btn-default" id="lastTemporal">Enable last temporal input</button> 
    1012  
    1013  
    1014             <button type="button" class="btn btn-default" id="clusteringcid2">Clustering cid=2</button> 
     1074            <button type="button" class="btn btn-default" id="showGraph">Show subgraph (and hide other)</button> 
     1075 
     1076 
    10151077        </div> 
    10161078 
  • XIOS/dev/dev_trunk_omp/src/filter/binary_arithmetic_filter.hpp

    r1681 r1685  
    4040      std::tuple<int, int, int> virtual buildGraph(std::vector<CDataPacketPtr> data); 
    4141       
    42       // CDataPacketPtr virtual buildGraph_post(CDataPacketPtr packet, std::vector<CDataPacketPtr> data); 
     42 
    4343  }; // class CScalarFieldArithmeticFilter 
    4444 
  • XIOS/dev/dev_trunk_omp/src/filter/file_writer_filter.cpp

    r1681 r1685  
    3838      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes += "</br>file attributes : </br>" +this->field->file->record4graphXiosAttributes(); 
    3939      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].clusterID =1; 
    40       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance); 
     40      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 
    4141 
    4242      if(CXios::isClient && CWorkflowGraph::build_begin)  
  • XIOS/dev/dev_trunk_omp/src/filter/output_pin.cpp

    r1681 r1685  
    129129  } 
    130130 
    131   int COutputPin::getDistance() 
    132   { 
    133     int distance = 0; 
    134     // for(int i=0; i<parent_filters.size(); i++) 
    135     // { 
    136     //   distance = max(distance, parent_filters[i]->getDistance()+1); 
    137     // } 
    138     return distance; 
    139   } 
     131 
    140132 
    141133 
  • XIOS/dev/dev_trunk_omp/src/filter/output_pin.hpp

    r1681 r1685  
    1818  { 
    1919    public: 
    20       // StdString output_field_id; 
    2120      int tag; 
    2221      Time start_graph; 
     
    8685 
    8786      void virtual setParentFiltersTag(); 
    88       int virtual getDistance(); 
    8987 
    9088 
  • XIOS/dev/dev_trunk_omp/src/filter/pass_through_filter.cpp

    r1681 r1685  
    1818    if(building_graph) 
    1919    { 
     20      std::cout<<"pass through packet->distance = "<<data[0]->distance<<std::endl; 
    2021      // std::cout<<"CPassThroughFilter::apply field_id = "<<this->field->getId()<<" start = "<<start_graph<<" end = "<<end_graph<<std::endl; 
    2122      this->filterID = InvalidableObject::filterIdGenerator++; 
     
    2526 
    2627      CWorkflowGraph::addNode(this->filterID, "Pass Through Filter\\n("+data[0]->field->getId()+")", 2, 1, 1, data[0]); 
    27       (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance); 
     28      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = data[0]->distance+1; 
    2829 
    2930      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 
     
    3940       
    4041      data[0]->src_filterID=this->filterID; 
     42      data[0]->distance++; 
    4143 
    4244    } 
    4345 
    4446    data[0]->field = this->field; 
     47 
    4548  } 
    4649 
  • XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.cpp

    r1681 r1685  
    7575 
    7676    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 
    77     CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field, this->getDistance()); 
     77    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field); 
    7878    if (outputPacket) 
    7979    { 
     
    112112 
    113113    CSpatialTransformFilterEngine* spaceFilter = static_cast<CSpatialTransformFilterEngine*>(engine); 
    114     CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field, this->getDistance()); 
     114    CDataPacketPtr outputPacket = spaceFilter->applyFilter(data, outputDefaultValue, this->tag, this->start_graph, this->end_graph, this->field); 
    115115 
    116116    if (outputPacket) 
     
    179179  } 
    180180 
    181   bool CSpatialTransformFilterEngine::buildGraph(std::vector<CDataPacketPtr> data, int tag, Time start_graph, Time end_graph, CField *field, int distance) 
     181  bool CSpatialTransformFilterEngine::buildGraph(std::vector<CDataPacketPtr> data, int tag, Time start_graph, Time end_graph, CField *field) 
    182182  { 
    183183    bool building_graph = tag ? data[0]->timestamp >= start_graph && data[0]->timestamp <= end_graph : false; 
     
    207207  } 
    208208 
    209   CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue, int tag, Time start_graph, Time end_graph, CField *field, int distance) 
     209  CDataPacketPtr CSpatialTransformFilterEngine::applyFilter(std::vector<CDataPacketPtr> data, double defaultValue, int tag, Time start_graph, Time end_graph, CField *field) 
    210210  { 
    211211     
    212     bool BG = buildGraph(data, tag, start_graph, end_graph, field, distance); 
     212    bool BG = buildGraph(data, tag, start_graph, end_graph, field); 
    213213 
    214214    CDataPacketPtr packet(new CDataPacket); 
  • XIOS/dev/dev_trunk_omp/src/filter/spatial_transform_filter.hpp

    r1681 r1685  
    121121       * \return the result of the grid transformation 
    122122       */ 
    123       CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0, int distance=1); 
    124       bool buildGraph(std::vector<CDataPacketPtr> data, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0, int distance=1); 
     123      CDataPacketPtr applyFilter(std::vector<CDataPacketPtr> data, double defaultValue = 0, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0); 
     124      bool buildGraph(std::vector<CDataPacketPtr> data, int tag=0, Time start_graph=0, Time end_graph=-1, CField *field=0); 
    125125 
    126126       /*! 
  • XIOS/dev/dev_trunk_omp/src/filter/store_filter.cpp

    r1681 r1685  
    100100      CWorkflowGraph::allocNodeEdge(); 
    101101  
    102       CWorkflowGraph::addNode(this->filterID, "Store Filter", 7, 1, 1, data[0]); 
     102      CWorkflowGraph::addNode(this->filterID, "Store Filter", 7, 0, 1, data[0]); 
    103103      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].distance = ++(data[0]->distance); 
    104104      (*CWorkflowGraph::mapFilters_ptr_with_info)[this->filterID].attributes = this->field->record4graphXiosAttributes(); 
  • XIOS/dev/dev_trunk_omp/src/filter/temporal_filter.cpp

    r1681 r1685  
    139139          packet->src_filterID=this->filterID; 
    140140          packet->distance = data[0]->distance+1; 
     141          std::cout<<"temporal packet->distance = "<<packet->distance<<std::endl; 
    141142          this->filterIDoutputs.clear(); 
    142143          CWorkflowGraph::build_begin=true; 
  • XIOS/dev/dev_trunk_omp/src/node/field.cpp

    r1681 r1685  
    13191319           storeFilter->end_graph = filter_end; 
    13201320           storeFilter->field = this; 
    1321            storeFilter->distance = instantDataFilter->getDistance()+1; 
     1321           storeFilter->distance = instantDataFilter->distance+1; 
    13221322         } 
    13231323 
     
    13341334           fileWriterFilter->start_graph = filter_start; 
    13351335           fileWriterFilter->end_graph = filter_end; 
    1336            fileWriterFilter->distance = getTemporalDataFilter(gc, file->output_freq)->getDistance()+1; 
     1336           fileWriterFilter->distance = getTemporalDataFilter(gc, file->output_freq)->distance+1; 
    13371337 
    13381338           // std::cout<<"CFileWriterFilter filter start = "<<filter_start<<" end = "<<filter_end<<" field = "<<this->getId()<<std::endl; 
     
    15601560 
    15611561       const bool detectMissingValues = (!detect_missing_value.isEmpty()  && detect_missing_value == true); 
    1562        std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, CContext::getCurrent()->getCalendar()->getInitDate(), 
    1563                                                                              freq_op, freq_offset, outFreq, 
    1564                                                                              detectMissingValues)); 
     1562       std::shared_ptr<CTemporalFilter> temporalFilter(new CTemporalFilter(gc, operation, 
     1563                                                                             CContext::getCurrent()->getCalendar()->getInitDate(), 
     1564                                                                             freq_op, freq_offset, outFreq, detectMissingValues)); 
    15651565 
    15661566       instantDataFilter->connectOutput(temporalFilter, 0); 
  • XIOS/dev/dev_trunk_omp/src/node/field_impl.hpp

    r1681 r1685  
    2323      if (check_if_active.isEmpty() || (!check_if_active.isEmpty() && (!check_if_active) || isActive(true))) 
    2424        clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data); 
    25         // clientSourceFilter->streamData(CContext::getCurrent()->getCalendar()->getCurrentDate(), _data, this->getId()); 
    2625    } 
    2726    else if (instantDataFilter) 
Note: See TracChangeset for help on using the changeset viewer.