source: XIOS/trunk/src/workflow_graph.hpp @ 1704

Last change on this file since 1704 was 1704, checked in by yushan, 2 years ago

Introducing the new graph functionality. Attribute build_workflow_graph=.TRUE. is used in the field definition section in the xml file to enable the workflow graph of the field and other fields referecing to it. A more detailed document will be available soon on the graph fuctionality.

File size: 2.2 KB
Line 
1#ifndef __WORKFLOW_GRAPH_HPP__
2#define __WORKFLOW_GRAPH_HPP__
3
4#include "xios_spl.hpp"
5#include "field.hpp"
6#include "grid.hpp"
7#include "garbage_collector.hpp"
8#include "date.hpp"
9#include "duration.hpp"
10
11
12namespace xios
13{
14  class CField;
15
16  struct graph_info_box_node
17  {
18
19    StdString filter_name;
20    int filter_class;
21    bool filter_filled;
22    int expected_entry_nb;
23    CDate date;
24    Time timestamp;
25    StdString transform_type;
26    StdString attributes;
27    StdString field_id;
28    bool inputs_complete;
29    int filter_tag;
30    int clusterID;
31    int distance;
32  };
33
34  struct graph_info_box_edge
35  {
36    int from;
37    int to;
38    StdString field_id;
39    StdString field_name;
40    StdString grid_id;
41    CDate date;
42    Time timestamp;
43    CField *field;
44    StdString attributes;
45   
46  };
47
48  class CWorkflowGraph
49  {
50
51    friend class CGraphviz;
52
53    public:
54
55      CWorkflowGraph();
56
57      /*! Map between fields identified by its id and their filters identified by an integer.
58       * It is filled up during reconstruction of a workflow (in function CField::buildFilterGraph()).
59      */
60      // static std::unordered_map <StdString, vector <int> > *mapFieldToFilters_ptr;
61      // #pragma omp threadprivate(mapFieldToFilters_ptr)
62
63
64
65      static std::unordered_map <int, graph_info_box_node> *mapFilters_ptr_with_info;
66
67      static std::unordered_map <int, graph_info_box_edge> *mapFieldToFilters_ptr_with_info;
68
69      static std::unordered_map <size_t, int> *mapHashFilterID_ptr;
70
71
72      static bool build_begin;
73
74      static void addNode(int nodeID, StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet);
75      static void addEdge(int edgeID, int toID, CDataPacketPtr packet);
76      static void allocNodeEdge();
77
78    private:
79
80      //! List of fields marked for visualizing of their workflow
81      static vector <StdString> fields;
82
83      //! List of connected filters for fields for visualizing of their workflow
84      static vector <StdString> filters;
85
86      //! Fields to filters connectivity
87      static vector <pair<int, int> > fieldsToFilters;
88
89      static void buildStaticWorkflow();
90      static void buildStaticWorkflow_with_info();
91      static void showStaticWorkflow();
92
93     
94
95
96  };
97}
98
99#endif
Note: See TracBrowser for help on using the repository browser.