15 #ifndef SST_CORE_MODEL_PYTHON
16 #define SST_CORE_MODEL_PYTHON
26 #include "sst/core/model/sstmodel.h"
27 #include "sst/core/config.h"
28 #include "sst/core/rankInfo.h"
29 #include "sst/core/output.h"
30 #include "sst/core/configGraph.h"
47 void initModel(
const std::string& script_file,
int verbosity,
Config* config,
int argc,
char** argv);
48 std::string scriptName;
54 std::vector<size_t> nameStack;
55 std::map<std::string, ComponentId_t> compNameMap;
56 ComponentId_t nextComponentId;
60 Config* getConfig(
void)
const {
return config; }
64 Output* getOutput()
const {
return output; }
66 ComponentId_t getNextComponentId() {
return nextComponentId++; }
68 ComponentId_t addComponent(
const char *name,
const char *type) {
69 auto id = graph->addComponent(name, type);
74 return graph->findComponentByName(std::string(name));
79 void addLink(ComponentId_t
id,
const char *link_name,
const char *port,
const char *latency,
bool no_cut)
const {graph->addLink(
id, link_name, port, latency, no_cut); }
80 void setLinkNoCut(
const char *link_name)
const {graph->setLinkNoCut(link_name); }
82 void pushNamePrefix(
const char *name);
83 void popNamePrefix(
void);
84 char* addNamePrefix(
const char *name)
const;
86 void setStatisticOutput(
const char* Name) { graph->setStatisticOutput(Name); }
87 void addStatisticOutputParameter(
const std::string& param,
const std::string& value) { graph->addStatisticOutputParameter(param, value); }
88 void setStatisticLoadLevel(uint8_t loadLevel) { graph->setStatisticLoadLevel(loadLevel); }
90 void addGlobalParameter(
const char* set,
const char* key,
const char* value,
bool overwrite) {
98 std::map<std::string,std::string> generateStatisticParameters(PyObject* statParamDict);
99 SST::Params pythonToCppParams(PyObject* statParamDict);
100 PyObject* buildStatisticObject(StatisticId_t
id);
101 PyObject* buildEnabledStatistic(
ConfigComponent* cc,
const char* statName, PyObject* statParamDict,
102 bool apply_to_children);
103 PyObject* buildEnabledStatistics(
ConfigComponent* cc, PyObject* statList, PyObject* paramDict,
bool apply_to_children);
Output object provides consistent method for outputting data to stdout, stderr and/or sst debug file...
Definition: output.h:54
Class to contain SST Simulation Configuration variables.
Definition: config.h:31
Represents the configuration of a generic component.
Definition: configGraph.h:219
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:358
Parameter store.
Definition: params.h:44
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:342
Base class for Model Generation.
Definition: sstmodel.h:22
Performs Unit math in full precision.
Definition: unitAlgebra.h:107