14 #ifndef SST_CORE_MODEL_PYTHON_PYMODEL_H
15 #define SST_CORE_MODEL_PYTHON_PYMODEL_H
21 #include "sst/core/config.h"
22 #include "sst/core/configGraph.h"
23 #include "sst/core/model/sstmodel.h"
24 #include "sst/core/output.h"
25 #include "sst/core/rankInfo.h"
26 #include "sst/core/warnmacros.h"
28 DISABLE_WARN_DEPRECATED_REGISTER
44 SST_ELI_REGISTER_MODEL_DESCRIPTION(
48 SST_ELI_ELEMENT_VERSION(1,0,0),
49 "Python model for building SST simulation graphs",
52 SST_ELI_DOCUMENT_MODEL_SUPPORTED_EXTENSIONS(
".py")
63 void initModel(
const std::string& script_file,
int verbosity,
Config* config,
int argc,
char** argv);
64 std::string scriptName;
70 std::vector<size_t> nameStack;
71 std::map<std::string, ComponentId_t> compNameMap;
72 ComponentId_t nextComponentId;
76 Config* getConfig(
void)
const {
return config; }
80 Output* getOutput()
const {
return output; }
82 ComponentId_t getNextComponentId() {
return nextComponentId++; }
84 ComponentId_t addComponent(
const char* name,
const char* type)
86 auto id = graph->addComponent(name, type);
92 return graph->findComponentByName(std::string(name));
97 void addLink(ComponentId_t
id,
const char* link_name,
const char* port,
const char* latency,
bool no_cut)
const
99 graph->addLink(
id, link_name, port, latency, no_cut);
101 void setLinkNoCut(
const char* link_name)
const { graph->setLinkNoCut(link_name); }
103 void pushNamePrefix(
const char* name);
104 void popNamePrefix(
void);
105 char* addNamePrefix(
const char* name)
const;
107 void setStatisticOutput(
const char* Name) { graph->setStatisticOutput(Name); }
108 void addStatisticOutputParameter(
const std::string& param,
const std::string& value)
110 graph->addStatisticOutputParameter(param, value);
112 void setStatisticLoadLevel(uint8_t loadLevel) { graph->setStatisticLoadLevel(loadLevel); }
114 void addGlobalParameter(
const char* set,
const char* key,
const char* value,
bool overwrite)
129 SST_ELI_REGISTER_MODEL_DESCRIPTION(
133 SST_ELI_ELEMENT_VERSION(1,0,0),
134 "XML model for building SST simulation graphs",
137 SST_ELI_DOCUMENT_MODEL_SUPPORTED_EXTENSIONS(
".xml",
".sdl")
153 SSTPythonModelDefinition* actual_model_;
156 std::map<std::string, std::string> generateStatisticParameters(PyObject* statParamDict);
157 SST::Params pythonToCppParams(PyObject* statParamDict);
158 PyObject* buildStatisticObject(StatisticId_t
id);
160 buildEnabledStatistic(
ConfigComponent* cc,
const char* statName, PyObject* statParamDict,
bool apply_to_children);
161 PyObject* buildEnabledStatistics(
ConfigComponent* cc, PyObject* statList, PyObject* paramDict,
bool apply_to_children);
166 #endif // SST_CORE_MODEL_PYTHON_PYMODEL_H
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:51
Class to contain SST Simulation Configuration variables.
Definition: config.h:29
Represents the configuration of a generic component.
Definition: configGraph.h:213
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:375
Definition: pymodel.h:126
std::string model_options
Definition: config.h:75
ConfigGraph * createConfigGraph() override
Create the ConfigGraph.
Definition: pymodel.h:148
Parameter store.
Definition: params.h:43
static void insert_global(const std::string &set, const key_type &key, const key_type &value, bool overwrite=true)
Adds a key/value pair to the specified global set.
Definition: params.cc:331
Base class for Model Generation.
Definition: sstmodel.h:25
Performs Unit math in full precision.
Definition: unitAlgebra.h:106