source: XIOS/dev/dev_trunk_omp/src/workflow_graph.hpp @ 1683

Last change on this file since 1683 was 1681, checked in by yushan, 5 years ago

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1676. Bug fixed

File size: 2.4 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      #pragma omp threadprivate(mapFilters_ptr_with_info)
67
68      static std::unordered_map <int, graph_info_box_edge> *mapFieldToFilters_ptr_with_info;
69      #pragma omp threadprivate(mapFieldToFilters_ptr_with_info)
70
71      static std::unordered_map <size_t, int> *mapHashFilterID_ptr;
72      #pragma omp threadprivate(mapHashFilterID_ptr)
73
74
75      static bool build_begin;
76      #pragma omp threadprivate(build_begin)
77
78      static void addNode(int nodeID, StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet);
79      static void addEdge(int edgeID, int toID, CDataPacketPtr packet);
80      static void allocNodeEdge();
81
82    private:
83
84      //! List of fields marked for visualizing of their workflow
85      static vector <StdString> fields;
86
87      //! List of connected filters for fields for visualizing of their workflow
88      static vector <StdString> filters;
89
90      //! Fields to filters connectivity
91      static vector <pair<int, int> > fieldsToFilters;
92
93      static void buildStaticWorkflow();
94      static void buildStaticWorkflow_with_info();
95      static void showStaticWorkflow();
96
97     
98
99
100  };
101}
102
103#endif
Note: See TracBrowser for help on using the repository browser.