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

Last change on this file since 2330 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
RevLine 
[1668]1#ifndef __WORKFLOW_GRAPH_HPP__
2#define __WORKFLOW_GRAPH_HPP__
3
4#include "xios_spl.hpp"
5#include "field.hpp"
[1679]6#include "grid.hpp"
[1668]7#include "garbage_collector.hpp"
[1679]8#include "date.hpp"
9#include "duration.hpp"
[1668]10
[1679]11
[1668]12namespace xios
13{
[1680]14  class CField;
[1668]15
[1679]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;
[1680]26    StdString attributes;
27    StdString field_id;
28    bool inputs_complete;
29    int filter_tag;
30    int clusterID;
[1681]31    int distance;
[1679]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;
[1680]43    CField *field;
44    StdString attributes;
[1679]45   
46  };
47
[1668]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      */
[1679]60      // static std::unordered_map <StdString, vector <int> > *mapFieldToFilters_ptr;
61      // #pragma omp threadprivate(mapFieldToFilters_ptr)
[1668]62
63
64
[1679]65      static std::unordered_map <int, graph_info_box_node> *mapFilters_ptr_with_info;
66      #pragma omp threadprivate(mapFilters_ptr_with_info)
[1668]67
[1679]68      static std::unordered_map <int, graph_info_box_edge> *mapFieldToFilters_ptr_with_info;
69      #pragma omp threadprivate(mapFieldToFilters_ptr_with_info)
70
[1680]71      static std::unordered_map <size_t, int> *mapHashFilterID_ptr;
72      #pragma omp threadprivate(mapHashFilterID_ptr)
[1679]73
[1680]74
[1679]75      static bool build_begin;
76      #pragma omp threadprivate(build_begin)
77
[1680]78      static void addNode(int nodeID, StdString filterName, int filter_class, bool filter_filled, int entry_nb, CDataPacketPtr packet);
[1679]79      static void addEdge(int edgeID, int toID, CDataPacketPtr packet);
[1680]80      static void allocNodeEdge();
[1679]81
[1668]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();
[1679]94      static void buildStaticWorkflow_with_info();
[1669]95      static void showStaticWorkflow();
[1668]96
[1679]97     
[1668]98
[1679]99
[1668]100  };
101}
102
103#endif
Note: See TracBrowser for help on using the repository browser.