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>
39 SSTPythonModelDefinition(
const std::string script_file,
int verbosity,
Config* config,
int argc,
char **argv);
40 SSTPythonModelDefinition(
const std::string script_file,
int verbosity,
Config* config);
41 virtual ~SSTPythonModelDefinition();
46 void initModel(
const std::string script_file,
int verbosity,
Config* config,
int argc,
char** argv);
47 std::string scriptName;
53 std::vector<size_t> nameStack;
54 std::map<std::string, ComponentId_t> compNameMap;
57 std::vector<std::string> statParamKeyArray;
58 std::vector<std::string> statParamValueArray;
61 Config* getConfig(
void)
const {
return config; }
63 Output* getOutput()
const {
return output; }
64 ComponentId_t addComponent(
const char *name,
const char *type) {
66 compNameMap[std::string(name)] = id;
69 ComponentId_t findComponentByName(
const char *name)
const {
70 auto itr = compNameMap.find(name);
71 return ( itr != compNameMap.end() ) ? itr->second : UNSET_COMPONENT_ID;
73 void addParameter(ComponentId_t
id,
const char *name,
const char *value)
const { graph->
addParameter(
id, name, value,
true); }
75 void setComponentRank(ComponentId_t
id, uint32_t rank, uint32_t thread)
const { graph->
setComponentRank(
id,
RankInfo(rank, thread)); }
76 void setComponentWeight(ComponentId_t
id,
float weight)
const { graph->
setComponentWeight(
id, weight); }
77 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); }
79 void pushNamePrefix(
const char *name);
80 void popNamePrefix(
void);
81 char* addNamePrefix(
const char *name)
const;
87 void enableComponentStatistic(ComponentId_t compid,
const char* statname)
const { graph->
enableComponentStatistic(compid, statname); }
88 void enableStatisticForComponentName(
const char* compname,
const char* statname)
const { graph->enableStatisticForComponentName(compname, statname); }
89 void enableStatisticForComponentType(
const char* comptype,
const char* statname)
const { graph->enableStatisticForComponentType(comptype, statname); }
91 void addComponentStatisticParameter(ComponentId_t compid,
const char* statname,
const char* param,
const char* value) { graph->
addComponentStatisticParameter(compid, statname, param, value); }
92 void addStatisticParameterForComponentName(
const char* compname,
const char* statname,
const char* param,
const char* value) { graph->addStatisticParameterForComponentName(compname, statname, param, value); }
93 void addStatisticParameterForComponentType(
const char* comptype,
const char* statname,
const char* param,
const char* value) { graph->addStatisticParameterForComponentType(comptype, statname, param, value); }
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:312
Class to contain SST Simulation Configuration variables.
Definition: config.h:31
A Configuration Graph A graph representing Components and Links.
Definition: configGraph.h:202
void setStatisticOutput(const char *name)
Set the statistic ouput module.
Definition: configGraph.cc:293
void addParameter(ComponentId_t comp_id, std::string key, std::string value, bool overwrite=false)
Add a single parameter to a component.
Definition: configGraph.cc:279
void addComponentStatisticParameter(ComponentId_t comp_id, std::string statisticName, const char *param, const char *value)
Add Parameters for a Statistic.
Definition: configGraph.cc:388
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:436
ComponentId_t addComponent(std::string name, std::string type, float weight, RankInfo rank)
Create a new component with weight and rank.
Definition: configGraph.cc:244
Definition: rankInfo.h:21
void setComponentWeight(ComponentId_t comp_id, float weight)
Set the weight of a Component (partitioning)
Definition: configGraph.cc:264
void addStatisticOutputParameter(const char *param, const char *value)
Add parameter to the statistic output module.
Definition: configGraph.cc:305
void enableComponentStatistic(ComponentId_t comp_id, std::string statisticName)
Enable a Statistics assigned to a component.
Definition: configGraph.cc:318
Base class for Model Generation.
Definition: sstmodel.h:22
void setComponentRank(ComponentId_t comp_id, RankInfo rank)
Set on which rank a Component will exist (partitioning)
Definition: configGraph.cc:258