12#ifndef SST_CORE_CONFIG_H
13#define SST_CORE_CONFIG_H
15#include "sst/core/configShared.h"
16#include "sst/core/serialization/serializable.h"
17#include "sst/core/sst_types.h"
20#include <patchlevel.h>
24extern int main(
int argc,
char** argv);
45 friend int ::main(
int argc,
char** argv);
46 friend class ConfigHelper;
47 friend class SSTModelDescription;
52 Config(uint32_t
num_ranks,
bool first_rank);
70 bool checkConfigFile();
75 bool setOptionFromModel(
const std::string& entryName,
const std::string& value);
112 const std::string&
configFile()
const {
return configFile_; }
127 const std::string&
stop_at()
const {
return stop_at_; }
187 const std::string&
output_dot()
const {
return output_dot_; }
211 const std::string&
timeBase()
const {
return timeBase_; }
234 if ( !parallel_load_ )
return "NONE";
235 if ( parallel_load_mode_multi_ )
return "MULTI";
266 const std::string&
timeVortex()
const {
return timeVortex_; }
278 bool cache_align_mempools()
const {
return cache_align_mempools_; }
283 const std::string&
debugFile()
const {
return debugFile_; }
302#if PY_MINOR_VERSION >= 9
306 bool enablePythonCoverage()
const {
return enable_python_coverage_; }
328 SimulationRunMode
runMode()
const {
return runMode_; }
335 switch ( runMode_ ) {
336 case SimulationRunMode::INIT:
338 case SimulationRunMode::RUN:
340 case SimulationRunMode::BOTH:
342 case SimulationRunMode::UNKNOWN:
367 const std::string& event_dump_file()
const {
return event_dump_file_; }
401 const std::string&
sigusr1()
const {
return sigusr1_; }
406 const std::string&
sigusr2()
const {
return sigusr2_; }
411 const std::string&
sigalrm()
const {
return sigalrm_; }
427 SST_SER(configFile_);
428 SST_SER(model_options_);
429 SST_SER(print_timing_);
431 SST_SER(exit_after_);
432 SST_SER(partitioner_);
433 SST_SER(heartbeat_wall_period_);
434 SST_SER(heartbeat_sim_period_);
435 SST_SER(output_directory_);
436 SST_SER(output_core_prefix_);
438 SST_SER(output_config_graph_);
439 SST_SER(output_json_);
440 SST_SER(parallel_output_);
442 SST_SER(output_dot_);
443 SST_SER(dot_verbosity_);
444 SST_SER(component_partition_file_);
445 SST_SER(output_partition_);
448 SST_SER(parallel_load_);
449 SST_SER(parallel_load_mode_multi_);
450 SST_SER(timeVortex_);
451 SST_SER(interthread_links_);
453 SST_SER(cache_align_mempools_);
457 SST_SER(addlibpath_);
458#if PY_MINOR_VERSION >= 9
459 SST_SER(enable_python_coverage_);
461 SST_SER(enabled_profiling_);
462 SST_SER(profiling_output_);
464 SST_SER(interactive_console_);
465 SST_SER(interactive_start_time_);
467 SST_SER(event_dump_file_);
469 SST_SER(load_from_checkpoint_);
470 SST_SER(checkpoint_wall_period_);
471 SST_SER(checkpoint_sim_period_);
472 SST_SER(checkpoint_prefix_);
473 SST_SER(checkpoint_name_format_);
475 SST_SER(enable_sig_handling_);
480 SST_SER(no_env_config_);
486 int checkArgsAfterParsing()
override;
487 int positionalCallback(
int num,
const std::string& arg);
492 std::string run_name;
497 void insertOptions();
499 bool isFileNameOnly(
const std::string& name)
501 bool nameOnly =
true;
503 for (
size_t i = 0; i < name.size(); ++i ) {
504 if (
'/' == name[i] ) {
524 uint32_t num_threads_;
525 std::string configFile_;
526 std::string model_options_;
528 std::string stop_at_;
529 uint32_t exit_after_;
530 std::string partitioner_;
531 std::string heartbeat_sim_period_;
532 uint32_t heartbeat_wall_period_;
533 std::string output_directory_;
534 std::string output_core_prefix_;
537 std::string output_config_graph_;
538 std::string output_json_;
539 bool parallel_output_;
542 std::string output_dot_;
543 uint32_t dot_verbosity_;
544 std::string component_partition_file_;
545 bool output_partition_;
548 std::string timeBase_;
550 bool parallel_load_mode_multi_;
551 std::string timeVortex_;
552 bool interthread_links_;
554 bool cache_align_mempools_;
556 std::string debugFile_;
559#if PY_MINOR_VERSION >= 9
560 bool enable_python_coverage_;
564 std::string enabled_profiling_;
565 std::string profiling_output_;
568 SimulationRunMode runMode_;
569 std::string interactive_console_;
570 std::string interactive_start_time_;
572 std::string event_dump_file_;
574 bool rank_seq_startup_;
577 bool load_from_checkpoint_;
578 std::string checkpoint_sim_period_;
580 checkpoint_wall_period_;
581 std::string checkpoint_prefix_;
582 std::string checkpoint_name_format_;
585 bool enable_sig_handling_;
586 std::string sigusr1_;
587 std::string sigusr2_;
588 std::string sigalrm_;
ConfigShared(bool suppress_print, bool include_libpath, bool include_env, bool include_verbose)
ConfigShared constructor that it meant to be used when needing a stand alone ConfigShared (i....
Definition configShared.cc:23
ConfigShared()
Default constructor used for serialization.
Definition configShared.h:59
Class to contain SST Simulation Configuration variables.
Definition config.h:41
const std::string & output_json() const
File to output json formatted config graph to (empty string means no output)
Definition config.h:171
const std::string & output_directory() const
The directory to be used for writting output files.
Definition config.h:152
const std::string & timeVortex() const
TimeVortex implementation to use.
Definition config.h:266
const std::string & configFile() const
Name of the SDL file to use to genearte the simulation.
Definition config.h:112
uint32_t checkpoint_wall_period() const
Interval at which to create a checkpoint in wall time.
Definition config.h:242
uint32_t dot_verbosity() const
Level of verbosity to use for the dot output.
Definition config.h:192
bool rank_seq_startup() const
Run simulation initialization stages one rank at a time for debug purposes.
Definition config.h:374
bool print_timing() const
Print SST timing information after the run.
Definition config.h:122
bool interthread_links() const
Use links that connect directly to ActivityQueue in receiving thread.
Definition config.h:271
bool output_partition() const
Controls whether partition info is output as part of configuration output.
Definition config.h:202
uint32_t exit_after() const
Wall clock time (approximiate) in seconds to stop the simulation at.
Definition config.h:132
const std::string & component_partition_file() const
File to output component partition info to (empty string means no output)
Definition config.h:197
uint32_t num_threads() const
Level of verbosity to use in the core prints using Output.verbose or Output.debug.
Definition config.h:102
SimulationRunMode runMode() const
Run mode to use (Init, Both, Run-only).
Definition config.h:328
const std::string & checkpoint_prefix() const
Prefix for checkpoint filenames and directory.
Definition config.h:256
const std::string & timeBase() const
Core timebase to use as the atomic time unit for the simulation.
Definition config.h:211
const std::string & enabledProfiling() const
Library path to use for finding element libraries (will replace the libpath in the sstsimulator....
Definition config.h:314
const std::string & sigalrm() const
SIGALRM handler(s)
Definition config.h:411
const std::string & partitioner() const
Partitioner to use for parallel simulations.
Definition config.h:137
bool enable_sig_handling() const
Controls whether the environment variables that SST sees are printed out.
Definition config.h:396
uint32_t num_ranks() const
Number of ranks in the simulation.
Definition config.h:107
bool load_from_checkpoint() const
Returns whether the simulation will begin from a checkpoint (true) or not (false).
Definition config.h:251
const std::string & sigusr1() const
SIGUSR1 handler.
Definition config.h:401
bool canInitiateCheckpoint()
Get whether or not any of the checkpoint options were turned on.
Definition config.cc:1255
std::string parallel_load_str() const
Returns the string equivalent for parallel-load: NONE (if parallel load is off), SINGLE or MULTI.
Definition config.h:232
bool parallel_output() const
If true, and a config graph output option is specified, write each ranks graph separately.
Definition config.h:177
std::string runMode_str() const
Get string version of runmode.
Definition config.h:333
const std::string & heartbeat_sim_period() const
Simulation period at which to print out a "heartbeat" message.
Definition config.h:142
const std::string & profilingOutput() const
Profiling points to turn on.
Definition config.h:319
const std::string & model_options() const
Model options to pass to the SDL file.
Definition config.h:117
const std::string & output_config_graph() const
File to output python formatted config graph to (empty string means no output)
Definition config.h:165
const std::string & stop_at() const
Simulated cycle to stop the simulation at.
Definition config.h:127
const std::string & sigusr2() const
SIGUSR2 handler.
Definition config.h:406
std::string interactive_console() const
Get the InteractiveAction to use for interactive mode.
Definition config.h:351
void print()
Print to stdout the current configuration.
Definition config.cc:814
bool parallel_load() const
Controls whether graph constuction will be done in parallel.
Definition config.h:219
const std::string & output_dot() const
File to output dot formatted config graph to (empty string means no output).
Definition config.h:187
std::string getUsagePrelude() override
Called to get the prelude for the help/usage message.
Definition config.cc:1200
bool parallel_load_mode_multi() const
If graph constuction will be done in parallel, will use a file per rank if true, and the same file fo...
Definition config.h:226
uint32_t heartbeat_wall_period() const
Wall-clock period at which to print out a "heartbeat" message.
Definition config.h:147
const std::string & checkpoint_name_format() const
Format for checkout filenames.
Definition config.h:261
std::string interactive_start_time() const
Get the time to start interactive mode.
Definition config.h:356
const std::string output_core_prefix() const
Prefix to use for the default SST::Output object in core.
Definition config.h:157
const std::string & debugFile() const
File to which core debug information should be written.
Definition config.h:283
const std::string & checkpoint_sim_period() const
Interval at which to create a checkpoint in simulated time.
Definition config.h:246
Definition serializable.h:24
This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition serializer.h:45
Base class for Model Generation.
Definition sstmodel.h:30