SST  14.0.0
StructuralSimulationToolkit
pythonConfigOutput.h
1 // Copyright 2009-2024 NTESS. Under the terms
2 // of Contract DE-NA0003525 with NTESS, the U.S.
3 // Government retains certain rights in this software.
4 //
5 // Copyright (c) 2009-2024, NTESS
6 // All rights reserved.
7 //
8 // This file is part of the SST software package. For license
9 // information, see the LICENSE file in the top level directory of the
10 // distribution.
11 //
12 
13 #ifndef SST_CORE_PYTHON_CONFIG_OUTPUT_H
14 #define SST_CORE_PYTHON_CONFIG_OUTPUT_H
15 
16 #include "sst/core/configGraph.h"
17 #include "sst/core/configGraphOutput.h"
18 
19 #include <map>
20 
21 namespace SST {
22 namespace Core {
23 
25 {
26 public:
27  PythonConfigGraphOutput(const char* path);
28 
29  virtual void generate(const Config* cfg, ConfigGraph* graph) override;
30 
31 protected:
32  ConfigGraph* getGraph() { return graph; }
33  void generateParams(const Params& params);
34  void generateCommonComponent(const char* objName, const ConfigComponent* comp);
35  void generateSubComponent(const char* owner, const ConfigComponent* comp);
36  void generateComponent(const ConfigComponent* comp, bool output_parition_info);
37  void generateStatGroup(const ConfigGraph* graph, const ConfigStatGroup& grp);
38 
39  const std::string& getLinkObject(LinkId_t id, const std::string& name, bool no_cut);
40 
41  char* makePythonSafeWithPrefix(const std::string& name, const std::string& prefix) const;
42  void makeBufferPythonSafe(char* buffer) const;
43  char* makeEscapeSafe(const std::string& input) const;
44  bool strncmp(const char* a, const char* b, const size_t n) const;
45  bool isMultiLine(const char* check) const;
46  bool isMultiLine(const std::string& check) const;
47 
48 private:
49  ConfigGraph* graph;
50  RankInfo myRank;
51  std::map<LinkId_t, std::string> linkMap;
52 };
53 
54 } // namespace Core
55 } // namespace SST
56 
57 #endif // SST_CORE_PYTHON_CONFIG_OUTPUT_H
virtual void generate(const Config *cfg, ConfigGraph *graph) override
Definition: pythonConfigOutput.cc:208
Outputs configuration data to a specified file path.
Definition: configGraphOutput.h:54
Class to contain SST Simulation Configuration variables.
Definition: config.h:38
Represents the configuration of a generic component.
Definition: configGraph.h:217
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:389
Definition: pythonConfigOutput.h:24
Definition: action.cc:18
Definition: rankInfo.h:21
Parameter store.
Definition: params.h:55
Definition: configGraph.h:158