15 #ifndef SST_CORE_MODEL_PYTHON
16 #define SST_CORE_MODEL_PYTHON
20 #ifdef SST_CONFIG_HAVE_PYTHON
27 #include <sst/core/model/sstmodel.h>
28 #include <sst/core/config.h>
29 #include <sst/core/rankInfo.h>
30 #include <sst/core/output.h>
31 #include <sst/core/configGraph.h>
41 SSTPythonModelDefinition(
const std::string script_file,
int verbosity,
Config* config,
int argc,
char **argv);
42 SSTPythonModelDefinition(
const std::string script_file,
int verbosity,
Config* config);
43 virtual ~SSTPythonModelDefinition();
48 void initModel(
const std::string script_file,
int verbosity,
Config* config,
int argc,
char** argv);
49 std::string scriptName;
55 std::vector<size_t> nameStack;
56 std::map<std::string, ComponentId_t> compNameMap;
57 ComponentId_t nextComponentId;
61 Config* getConfig(
void)
const {
return config; }
63 Output* getOutput()
const {
return output; }
64 ComponentId_t getNextComponentId() {
return nextComponentId++; }
65 ComponentId_t addComponent(
const char *name,
const char *type) {
66 ComponentId_t
id = getNextComponentId();
67 graph->addComponent(
id, name, type);
68 compNameMap[std::string(name)] = id;
71 ComponentId_t findComponentByName(
const char *name)
const {
72 auto itr = compNameMap.find(name);
73 return ( itr != compNameMap.end() ) ? itr->second : UNSET_COMPONENT_ID;
76 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); }
77 void setLinkNoCut(
const char *link_name)
const {graph->setLinkNoCut(link_name); }
79 void pushNamePrefix(
const char *name);
80 void popNamePrefix(
void);
81 char* addNamePrefix(
const char *name)
const;
83 void setStatisticOutput(
const char* Name) { graph->setStatisticOutput(Name); }
84 void addStatisticOutputParameter(
const std::string ¶m,
const std::string &value) { graph->addStatisticOutputParameter(param, value); }
85 void setStatisticLoadLevel(uint8_t loadLevel) { graph->setStatisticLoadLevel(loadLevel); }
87 void enableStatisticForComponentName(
const std::string &compname,
const std::string &statname)
const { graph->enableStatisticForComponentName(compname, statname); }
88 void enableStatisticForComponentType(
const std::string &comptype,
const std::string &statname)
const { graph->enableStatisticForComponentType(comptype, statname); }
90 void addStatisticParameterForComponentName(
const std::string &compname,
const std::string &statname,
const std::string ¶m,
const std::string &value) { graph->addStatisticParameterForComponentName(compname, statname, param, value); }
91 void addStatisticParameterForComponentType(
const std::string &comptype,
const std::string &statname,
const std::string ¶m,
const std::string &value) { graph->addStatisticParameterForComponentType(comptype, statname, param, value); }
94 std::map<std::string,std::string> generateStatisticParameters(PyObject* statParamDict);
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
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:294
Base class for Model Generation.
Definition: sstmodel.h:22