12 #ifndef SST_CORE_CONFIG_H
13 #define SST_CORE_CONFIG_H
15 #include <sst/core/sst_types.h>
16 #include <sst/core/simulation.h>
17 #include <sst/core/rankInfo.h>
18 #include <sst/core/env/envquery.h>
19 #include <sst/core/env/envconfig.h>
21 #include <sst/core/serialization/serializable.h>
26 namespace program_options {
28 class options_description;
29 class positional_options_description;
92 std::string event_dump_file;
112 std::cout <<
"debugFile = " << debugFile << std::endl;
113 std::cout <<
"runMode = " << runMode << std::endl;
114 std::cout <<
"libpath = " <<
getLibPath() << std::endl;
115 std::cout <<
"sdlfile = " << sdlfile << std::endl;
116 std::cout <<
"stopAtCycle = " << stopAtCycle << std::endl;
117 std::cout <<
"timeBase = " << timeBase << std::endl;
118 std::cout <<
"partitioner = " << partitioner << std::endl;
119 std::cout <<
"generator = " << generator << std::endl;
120 std::cout <<
"gen_options = " << generator_options << std::endl;
121 std::cout <<
"output_config_graph = " << output_config_graph << std::endl;
122 std::cout <<
"output_xml = " << output_xml << std::endl;
123 std::cout <<
"no_env_config = " << no_env_config << std::endl;
124 std::cout <<
"output_directory = " << output_directory << std::endl;
125 std::cout <<
"output_json = " << output_json << std::endl;
126 std::cout <<
"model_options = " << model_options << std::endl;
127 std::cout <<
"num_threads = " << world_size.thread << std::endl;
128 std::cout <<
"enable_sig_handling = " << enable_sig_handling << std::endl;
129 std::cout <<
"output_core_prefix = " << output_core_prefix << std::endl;
130 std::cout <<
"print_timing=" << print_timing << std::endl;
135 char *envpath = getenv(
"SST_LIB_PATH");
138 std::vector<std::string> overrideConfigPaths;
140 SST::Core::Environment::getSSTEnvironmentConfiguration(overrideConfigPaths);
142 std::string fullLibPath = libpath;
143 std::set<std::string> configGroups = envConfig->getGroupNames();
146 for(
auto groupItr = configGroups.begin(); groupItr != configGroups.end(); groupItr++) {
148 envConfig->getGroupByName(*groupItr);
149 std::set<std::string> groupKeys = currentGroup->getKeys();
153 for(
auto keyItr = groupKeys.begin(); keyItr != groupKeys.end(); keyItr++) {
154 const std::string key = *keyItr;
155 const std::string value = currentGroup->getValue(key);
157 if(
"BOOST_LIBDIR" != key) {
159 if(
"LIBDIR" == key.substr(key.size() - 6)) {
160 fullLibPath.append(
":");
161 fullLibPath.append(value);
171 if(NULL != envpath) {
173 fullLibPath.append(envpath);
176 if ( !addlLibPath.empty() ) {
177 fullLibPath.append(
":");
178 fullLibPath.append(addlLibPath);
182 std::cout <<
"SST-Core: Configuration Library Path will read from: " << fullLibPath << std::endl;
188 uint32_t getNumRanks() {
return world_size.rank; }
189 uint32_t getNumThreads() {
return world_size.thread; }
190 uint32_t setNumThreads(uint32_t nthr) {
191 uint32_t old = world_size.thread;
192 world_size.thread = nthr;
221 boost::program_options::options_description* visNoConfigDesc;
222 boost::program_options::options_description* hiddenNoConfigDesc;
223 boost::program_options::options_description* legacyDesc;
224 boost::program_options::options_description* mainDesc;
225 boost::program_options::positional_options_description* posDesc;
226 boost::program_options::variables_map* var_map;
227 std::string run_name;
229 std::string addlLibPath;
239 #endif // SST_CORE_CONFIG_H
RankInfo world_size
Definition: config.h:85
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:35
std::string generator_options
Definition: config.h:75
std::string sdlfile
Definition: config.h:69
Definition: envconfig.h:51
std::string partitioner
Definition: config.h:73
Class to contain SST Simulation Configuration variables.
Definition: config.h:39
Definition: envconfig.h:97
std::string heartbeatPeriod
Definition: config.h:71
std::string output_core_prefix
Definition: config.h:83
int parseCmdLine(int argc, char *argv[])
Parse command-line arguments to update configuration values.
Definition: config.cc:193
Simulation::Mode_t runMode
Definition: config.h:68
Definition: simulation.h:80
int parseConfigFile(std::string config_string)
Parse a configuration string to update configuration values.
Definition: config.cc:277
Definition: simulation.h:79
std::string output_config_graph
Definition: config.h:76
uint32_t getVerboseLevel()
Return the current Verbosity level.
Definition: config.cc:180
std::string output_dot
Definition: config.h:77
Definition: serializable.h:108
void setTimeBase(std::string timeBase)
Sets the default timebase of the simulation.
Definition: config.cc:184
uint32_t verbose
Definition: config.h:86
std::string timeBase
Definition: config.h:72
bool no_env_config
Definition: config.h:87
Simulation::Mode_t setRunMode(std::string mode)
Set the run-mode.
Definition: config.h:98
std::string model_options
Definition: config.h:81
std::string output_xml
Definition: config.h:78
std::string output_directory
Definition: config.h:80
Definition: rankInfo.h:21
std::string output_json
Definition: config.h:79
void print()
Print to stdout the current configuration.
Definition: config.h:111
bool printTimingInfo()
Print the SST core timing information.
Definition: config.cc:176
std::string debugFile
Definition: config.h:67
std::string generator
Definition: config.h:74
std::string getLibPath(void) const
Return the library search path.
Definition: config.h:134
std::string dump_component_graph_file
Definition: config.h:82
Definition: simulation.h:81
void setStopAt(std::string stopAtStr)
Set the cycle at which to stop the simulation.
Definition: config.cc:188
std::string stopAtCycle
Definition: config.h:70
Definition: simulation.h:82
bool enable_sig_handling
Definition: config.h:88
Mode_t
Type of Run Modes.
Definition: simulation.h:78
void Print()
Print the current configuration to stdout.
bool print_timing
Definition: config.h:89