25 #include <boost/program_options.hpp>
27 #include <queso/MLSamplingOptions.h>
28 #include <queso/Miscellaneous.h>
34 m_prefix ((std::string)(prefix) +
"ml_" ),
35 m_help (UQ_ML_SAMPLING_HELP),
37 m_restartOutput_levelPeriod (UQ_ML_SAMPLING_RESTART_OUTPUT_LEVEL_PERIOD_ODV ),
38 m_restartOutput_baseNameForFiles (UQ_ML_SAMPLING_RESTART_OUTPUT_BASE_NAME_FOR_FILES_ODV),
39 m_restartOutput_fileType (UQ_ML_SAMPLING_RESTART_OUTPUT_FILE_TYPE_ODV ),
40 m_restartInput_baseNameForFiles (UQ_ML_SAMPLING_RESTART_INPUT_BASE_NAME_FOR_FILES_ODV ),
51 m_option_help (m_prefix +
"help" ),
53 m_option_restartOutput_levelPeriod (m_prefix +
"restartOutput_levelPeriod" ),
54 m_option_restartOutput_baseNameForFiles(m_prefix +
"restartOutput_baseNameForFiles"),
55 m_option_restartOutput_fileType (m_prefix +
"restartOutput_fileType" ),
56 m_option_restartInput_baseNameForFiles (m_prefix +
"restartInput_baseNameForFiles" ),
57 m_option_restartInput_fileType (m_prefix +
"restartInput_fileType" ),
59 m_option_restartInputFileName (m_prefix +
"restartInputFileName"),
60 m_option_restartInputFileType (m_prefix +
"restartInputFileType"),
61 m_option_restartChainSize (m_prefix +
"restartChainSize" ),
63 m_option_dataOutputFileName (m_prefix +
"dataOutputFileName" ),
64 m_option_dataOutputAllowedSet (m_prefix +
"dataOutputAllowedSet")
67 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
68 m_parser->
registerOption<
unsigned int>(m_option_restartOutput_levelPeriod, UQ_ML_SAMPLING_RESTART_OUTPUT_LEVEL_PERIOD_ODV,
"restartOutput_levelPeriod" );
69 m_parser->
registerOption<std::string >(m_option_restartOutput_baseNameForFiles, UQ_ML_SAMPLING_RESTART_OUTPUT_BASE_NAME_FOR_FILES_ODV,
"restartOutput_baseNameForFiles" );
70 m_parser->
registerOption<std::string >(m_option_restartOutput_fileType, UQ_ML_SAMPLING_RESTART_OUTPUT_FILE_TYPE_ODV,
"restartOutput_fileType" );
71 m_parser->
registerOption<std::string >(m_option_restartInput_baseNameForFiles, UQ_ML_SAMPLING_RESTART_INPUT_BASE_NAME_FOR_FILES_ODV,
"restartInput_baseNameForFiles" );
84 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
85 m_parser->
getOption<
unsigned int>(m_option_restartOutput_levelPeriod, m_restartOutput_levelPeriod);
86 m_parser->
getOption<std::string >(m_option_restartOutput_baseNameForFiles, m_restartOutput_baseNameForFiles);
87 m_parser->
getOption<std::string >(m_option_restartOutput_fileType, m_restartOutput_fileType);
88 m_parser->
getOption<std::string >(m_option_restartInput_baseNameForFiles, m_restartInput_baseNameForFiles);
89 m_parser->
getOption<std::string >(m_option_restartInput_fileType, m_restartInput_fileType);
116 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
117 if ((m_restartOutput_levelPeriod > 0))
queso_require_not_equal_to_msg(m_restartOutput_baseNameForFiles,
".",
"Option 'restartOutput_levelPeriod' is > 0, but 'restartOutput_baseNameForFiles' is not specified...");
124 #ifdef ML_CODE_HAS_NEW_RESTART_CAPABILITY
125 os << m_option_restartOutput_levelPeriod <<
" = " << m_restartOutput_levelPeriod
126 <<
"\n" << m_option_restartOutput_baseNameForFiles <<
" = " << m_restartOutput_baseNameForFiles
127 <<
"\n" << m_option_restartOutput_fileType <<
" = " << m_restartOutput_fileType
128 <<
"\n" << m_option_restartInput_baseNameForFiles <<
" = " << m_restartInput_baseNameForFiles
129 <<
"\n" << m_option_restartInput_fileType <<
" = " << m_restartInput_fileType
147 os << (*(obj.
m_parser)) << std::endl;
#define UQ_ML_SAMPLING_RESTART_INPUT_FILE_NAME_ODV
void print(std::ostream &os) const
It prints the option values.
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
#define UQ_ML_SAMPLING_DATA_OUTPUT_ALLOWED_SET_ODV
#define ML_CODE_HAS_NEW_RESTART_CAPABILITY
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
std::set< unsigned int > m_dataOutputAllowedSet
std::string m_option_help
std::string m_dataOutputFileName
Name of generic output file.
unsigned int m_restartChainSize
Size of restart chain.
void scanInputFile()
This is the method that parses the input file.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
std::string m_option_restartInputFileType
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
std::string m_restartInputFileType
Type of restart input file.
std::string m_option_dataOutputAllowedSet
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
virtual ~MLSamplingOptions()
Destructor.
std::string m_option_restartInputFileName
MLSamplingOptions(const BaseEnvironment &env, const char *prefix)
Default constructor.
std::string m_help
If non-empty string, options and values are printed to the output file.
void checkOptions(const BaseEnvironment *env)
#define UQ_ML_SAMPLING_DATA_OUTPUT_FILE_NAME_ODV
std::string m_option_dataOutputFileName
std::string m_option_restartChainSize
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
#define UQ_ML_SAMPLING_RESTART_INPUT_FILE_TYPE_ODV
std::string m_restartInputFileName
Name of restart input file.
BoostInputOptionsParser * m_parser
#define UQ_ML_SAMPLING_RESTART_CHAIN_SIZE_ODV
This class provides options for the Multilevel sequence generator if no input file is available...