SST 16.0.0
Structural Simulation Toolkit
jsonConfigOutput.h
1// Copyright 2009-2026 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-2026, 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_JSON_CONFIG_OUTPUT_H
14#define SST_CORE_JSON_CONFIG_OUTPUT_H
15
16#include "sst/core/configGraphOutput.h"
17#include "sst/core/model/configGraph.h"
18#include "sst/core/util/filesystem.h"
19
20#include "nlohmann/json.hpp"
21
22#include <fstream>
23#include <map>
24#include <string>
25
26namespace SST::Core {
27
28class JSONConfigGraphOutput : public ConfigGraphOutput
29{
30
31public:
32 explicit JSONConfigGraphOutput(const char* path);
33 virtual void generate(const Config* cfg, ConfigGraph* graph) override;
34
35private:
36 std::map<SST::StatisticId_t, std::string>
37 shared_stat_map_; // Used to identify shared stat objects vs. stats that map to those objects
38
39 std::string pathStr;
40
41 void outputProgramOptions(const Config* cfg, std::ofstream& ofs);
42 void outputSharedParams(std::ofstream& ofs);
43 void outputStatisticsOptions(ConfigGraph* graph, std::ofstream& ofs);
44 void outputStatisticsGroups(ConfigGraph* graph, std::ofstream& ofs);
45 void outputComponents(const Config* cfg, ConfigGraph* graph, std::ofstream& ofs);
46 nlohmann::ordered_json outputSubComponent(ConfigComponent* sub, std::ofstream& ofs);
47 void outputLinks(ConfigGraph* graph, std::ofstream& ofs);
48};
49
50} // namespace SST::Core
51
52#endif // SST_CORE_JSON_CONFIG_OUTPUT_H
Represents the configuration of a generic component.
Definition configComponent.h:83
A Configuration Graph A graph representing Components and Links.
Definition configGraph.h:76
Class to contain SST Simulation Configuration variables.
Definition config.h:52
virtual void generate(const Config *cfg, ConfigGraph *graph) override
Definition jsonConfigOutput.cc:455