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();
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 *name,
const char *port,
const char *latency,
bool no_cut)
const {graph->
addLink(
id, name, port, latency, no_cut); }
78 void pushNamePrefix(
const char *name);
79 void popNamePrefix(
void);
80 char* addNamePrefix(
const char *name)
const;
83 void addStatisticOutputParameter(
const std::string ¶m,
const std::string &value) { graph->
addStatisticOutputParameter(param, value); }
86 void enableStatisticForComponentName(
const std::string &compname,
const std::string &statname)
const { graph->
enableStatisticForComponentName(compname, statname); }
87 void enableStatisticForComponentType(
const std::string &comptype,
const std::string &statname)
const { graph->enableStatisticForComponentType(comptype, statname); }
89 void addStatisticParameterForComponentName(
const std::string &compname,
const std::string &statname,
const std::string ¶m,
const std::string &value) { graph->
addStatisticParameterForComponentName(compname, statname, param, value); }
90 void addStatisticParameterForComponentType(
const std::string &comptype,
const std::string &statname,
const std::string ¶m,
const std::string &value) { graph->addStatisticParameterForComponentType(comptype, statname, param, value); }
93 std::map<std::string,std::string> generateStatisticParameters(PyObject* statParamDict);
Output object provides consistant method for outputing data to stdout, stderr and/or sst debug file...
Definition: output.h:54
void setStatisticLoadLevel(uint8_t loadLevel)
Set the statistic system load level.
Definition: configGraph.cc:497
Class to contain SST Simulation Configuration variables.
Definition: config.h:31
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:337
void enableStatisticForComponentName(std::string ComponentName, std::string statisticName)
Enable a Statistics assigned to a component.
Definition: configGraph.cc:504
void addStatisticOutputParameter(const std::string ¶m, const std::string &value)
Add parameter to the statistic output module.
Definition: configGraph.cc:491
void addLink(ComponentId_t comp_id, std::string link_name, std::string port, std::string latency_str, bool no_cut=false)
Add a Link to a Component on a given Port.
Definition: configGraph.cc:564
ComponentId_t addComponent(ComponentId_t id, std::string name, std::string type, float weight, RankInfo rank)
Create a new component with weight and rank.
Definition: configGraph.cc:462
Base class for Model Generation.
Definition: sstmodel.h:22
void setStatisticOutput(const std::string &name)
Set the statistic ouput module.
Definition: configGraph.cc:479
void addStatisticParameterForComponentName(const std::string &ComponentName, const std::string &statisticName, const std::string ¶m, const std::string &value)
Add Parameters for a Statistic.
Definition: configGraph.cc:534