14 #ifndef SST_CORE_MODEL_JSON_JSONMODEL_H 15 #define SST_CORE_MODEL_JSON_JSONMODEL_H 17 #include "sst/core/component.h" 18 #include "sst/core/config.h" 19 #include "sst/core/configGraph.h" 20 #include "sst/core/cputimer.h" 21 #include "sst/core/factory.h" 22 #include "sst/core/memuse.h" 23 #include "sst/core/model/sstmodel.h" 24 #include "sst/core/output.h" 25 #include "sst/core/rankInfo.h" 26 #include "sst/core/sst_types.h" 27 #include "sst/core/warnmacros.h" 29 #include "nlohmann/json.hpp" 40 using json = nlohmann::json;
49 bool boolean(
bool val);
50 bool number_integer(json::number_integer_t val);
51 bool number_unsigned(json::number_unsigned_t val);
52 bool number_float(json::number_float_t val,
const std::string& str);
53 bool string(std::string& val);
54 bool binary(json::binary_t& val);
55 bool start_object(std::size_t elements);
57 bool start_array(std::size_t elements);
59 bool key(std::string& val);
61 bool parse_error(std::size_t position,
const std::string& lastToken,
const json::exception& ex);
63 const std::map<std::string, std::string> getProgramOptions();
79 } current_state = ROOT;
83 std::vector<std::string> path_stack;
84 std::stack<json::value_t> context_stack;
85 std::stack<ConfigComponent*> Parents;
86 std::map<std::string, std::string> ProgramOptions;
88 std::string current_key;
89 std::string current_shared_name;
90 std::string current_comp_name;
91 std::string current_comp_stat_name;
92 std::string current_subcomp_name;
93 std::string current_subcomp_type;
94 std::string current_grp_stat_name;
95 std::string link_name;
96 std::string left_comp;
97 std::string left_port;
98 std::string left_latency;
99 std::string right_comp;
100 std::string right_port;
101 std::string right_latency;
103 bool nonlocal =
false;
104 uint32_t current_comp_rank;
105 int subcomp_slot = -1;
107 int right_thread = -1;
110 bool foundComponents =
false;
111 bool in_shared_params_object =
false;
112 bool in_comp_params =
false;
113 bool in_comp_stats =
false;
114 bool in_comp_stats_params =
false;
115 bool in_comp_subcomp =
false;
116 bool in_comp_subsubcomp =
false;
117 bool in_comp_subcomp_params =
false;
118 bool in_grp_stats_output =
false;
119 bool in_grp_stats_output_params =
false;
120 bool in_grp_stats_def =
false;
121 bool in_grp_stats_def_params =
false;
122 bool in_grp_stats_comps =
false;
123 bool in_left_link =
false;
124 bool in_right_link =
false;
128 ComponentId_t current_comp_id;
132 Params current_stat_params;
135 std::string getCurrentPath()
const;
136 void processValue(
const json& value);
137 ComponentId_t findComponentIdByName(
const std::string& Name,
bool& success);
143 SST_ELI_REGISTER_MODEL_DESCRIPTION(
147 SST_ELI_ELEMENT_VERSION(1,0,0),
148 "JSON model for building SST simulation graphs",
151 SST_ELI_DOCUMENT_MODEL_SUPPORTED_EXTENSIONS(
".json")
159 std::string scriptName;
163 ComponentId_t nextComponentId;
169 #endif // SST_CORE_MODEL_JSON_JSONMODEL_H Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:57
ConfigGraph * createConfigGraph() override
Create the ConfigGraph.
Definition: jsonmodel.cc:588
Class to contain SST Simulation Configuration variables.
Definition: config.h:51
Represents the configuration of a generic component.
Definition: configGraph.h:381
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:585
Definition: jsonmodel.h:140
Definition: jsonmodel.h:44
Parameter store.
Definition: params.h:63
Base class for Model Generation.
Definition: sstmodel.h:29
Definition: configGraph.h:282