source: XIOS/dev/dev_olga/src/workflow_graph.cpp @ 1654

Last change on this file since 1654 was 1654, checked in by oabramkina, 3 years ago

Corrections for workflow visualization.

File size: 1.2 KB
Line 
1#include "workflow_graph.hpp"
2
3namespace xios
4{
5
6  std::unordered_map <StdString, vector <int > > CWorkflowGraph::mapFieldToFilters;
7  std::unordered_map <int, StdString> CWorkflowGraph::mapFilters;
8  std::unordered_map <int,vector<Time> > CWorkflowGraph::mapFilterTimestamps;
9  set<Time>  CWorkflowGraph::timestamps;
10
11  vector <StdString> CWorkflowGraph::filters;
12  vector <StdString> CWorkflowGraph::fields;
13  vector <pair<int, int> > CWorkflowGraph::fieldsToFilters;
14
15  CWorkflowGraph::CWorkflowGraph()
16  { }
17
18  /*!
19   * Reorganize information collected by XIOS for visualization.
20   */
21  void CWorkflowGraph::buildStaticWorkflow()
22  TRY
23  {
24    // Create a list of filters (graph nodes)
25    size_t filterIdx = 0;
26    filters.resize(mapFilters.size());
27    for (auto it=mapFilters.begin(); it != mapFilters.end(); it++)
28    {
29      filters[it->first]=it->second;
30    }
31
32    // Create a list of fields and their filter connectivity (graph edges and edge-to-node connectivity)
33    for (auto it=mapFieldToFilters.begin(); it != mapFieldToFilters.end(); it++)
34    {
35      for (size_t i = 0; i < (it->second.size() - 1); i+=2)
36      {
37        fieldsToFilters.push_back(make_pair(it->second[i],it->second[i+1]));
38        fields.push_back(it->first);
39      }
40    }
41  }
42  CATCH
43
44}
Note: See TracBrowser for help on using the repository browser.