25 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
26 #include <boost/program_options.hpp>
27 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
29 #include <queso/EnvironmentOptions.h>
30 #include <queso/Miscellaneous.h>
32 #include <queso/asserts.h>
58 m_debugParams(m_numDebugParams,0.),
60 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
63 m_option_help(m_prefix +
"help"),
64 m_option_numSubEnvironments(m_prefix +
"numSubEnvironments"),
65 m_option_subDisplayFileName(m_prefix +
"subDisplayFileName"),
66 m_option_subDisplayAllowAll(m_prefix +
"subDisplayAllowAll"),
67 m_option_subDisplayAllowInter0(m_prefix +
"subDisplayAllowInter0"),
68 m_option_subDisplayAllowedSet(m_prefix +
"subDisplayAllowedSet"),
69 m_option_displayVerbosity(m_prefix +
"displayVerbosity"),
70 m_option_syncVerbosity(m_prefix +
"syncVerbosity"),
71 m_option_checkingLevel(m_prefix +
"checkingLevel"),
72 m_option_rngType(m_prefix +
"rngType"),
73 m_option_seed(m_prefix +
"seed"),
74 m_option_platformName(m_prefix +
"platformName"),
75 m_option_identifyingString(m_prefix +
"identifyingString")
82 m_prefix((std::string) +
"env_"),
97 m_debugParams(m_numDebugParams,0.),
99 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
102 m_option_help(m_prefix +
"help"),
103 m_option_numSubEnvironments(m_prefix +
"numSubEnvironments"),
104 m_option_subDisplayFileName(m_prefix +
"subDisplayFileName"),
105 m_option_subDisplayAllowAll(m_prefix +
"subDisplayAllowAll"),
106 m_option_subDisplayAllowInter0(m_prefix +
"subDisplayAllowInter0"),
107 m_option_subDisplayAllowedSet(m_prefix +
"subDisplayAllowedSet"),
108 m_option_displayVerbosity(m_prefix +
"displayVerbosity"),
109 m_option_syncVerbosity(m_prefix +
"syncVerbosity"),
110 m_option_checkingLevel(m_prefix +
"checkingLevel"),
111 m_option_rngType(m_prefix +
"rngType"),
112 m_option_seed(m_prefix +
"seed"),
113 m_option_platformName(m_prefix +
"platformName"),
114 m_option_identifyingString(m_prefix +
"identifyingString")
116 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
157 for (
unsigned int i = 0; i < size; i++) {
171 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
200 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
204 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
239 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
240 os << (*(obj.
m_parser)) << std::endl;
243 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
277 m_prefix ((std::string)(prefix) +
"env_"),
278 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
279 m_optionsDesc (new boost::program_options::options_description(
"Environment options")),
281 m_option_help (m_prefix +
"help" ),
282 m_option_numSubEnvironments (m_prefix +
"numSubEnvironments" ),
283 m_option_subDisplayFileName (m_prefix +
"subDisplayFileName" ),
284 m_option_subDisplayAllowAll (m_prefix +
"subDisplayAllowAll" ),
285 m_option_subDisplayAllowInter0(m_prefix +
"subDisplayAllowInter0"),
286 m_option_subDisplayAllowedSet (m_prefix +
"subDisplayAllowedSet" ),
287 m_option_displayVerbosity (m_prefix +
"displayVerbosity" ),
288 m_option_syncVerbosity (m_prefix +
"syncVerbosity" ),
289 m_option_checkingLevel (m_prefix +
"checkingLevel" ),
290 m_option_rngType (m_prefix +
"rngType" ),
291 m_option_seed (m_prefix +
"seed" ),
292 m_option_platformName (m_prefix +
"platformName" ),
293 m_option_identifyingString (m_prefix +
"identifyingString" )
304 m_ov (alternativeOptionsValues),
306 m_prefix ((std::string)(prefix) +
"env_"),
307 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
308 m_optionsDesc (NULL),
310 m_option_help (m_prefix +
"help" ),
311 m_option_numSubEnvironments (m_prefix +
"numSubEnvironments" ),
312 m_option_subDisplayFileName (m_prefix +
"subDisplayFileName" ),
313 m_option_subDisplayAllowAll (m_prefix +
"subDisplayAllowAll" ),
314 m_option_subDisplayAllowInter0(m_prefix +
"subDisplayAllowInter0"),
315 m_option_subDisplayAllowedSet (m_prefix +
"subDisplayAllowedSet" ),
316 m_option_displayVerbosity (m_prefix +
"displayVerbosity" ),
317 m_option_syncVerbosity (m_prefix +
"syncVerbosity" ),
318 m_option_checkingLevel (m_prefix +
"checkingLevel" ),
319 m_option_rngType (m_prefix +
"rngType" ),
320 m_option_seed (m_prefix +
"seed" ),
321 m_option_platformName (m_prefix +
"platformName" ),
322 m_option_identifyingString (m_prefix +
"identifyingString" )
329 <<
": after setting values of options with prefix '" <<
m_prefix
330 <<
"', state of object is:"
340 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
342 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
350 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
352 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
354 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
358 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
364 std::cout <<
"In EnvironmentOptions::scanOptionsValues()"
365 <<
": after reading values of options with prefix '" <<
m_prefix
366 <<
"', state of object is:"
399 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
406 #ifdef QUESO_MEMORY_DEBUGGING
407 std::cout <<
"In EnvOptions::defineMyOptions(), before add_options()" << std::endl;
409 optionsDesc.add_options()
410 (
m_option_help.c_str(),
"produce help message for environment" )
425 #ifdef QUESO_MEMORY_DEBUGGING
426 std::cout <<
"In EnvOptions::defineMyOptions(), after add_options()" << std::endl;
437 #ifdef QUESO_MEMORY_DEBUGGING
438 std::cout <<
"Entering EnvOptions::getMyOptionsValues()" << std::endl;
450 std::cerr <<
"In BaseEnvironment::getMyOptionValues()"
479 std::vector<double> tmpAllow(0,0.);
490 if (tmpAllow.size() > 0) {
491 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
529 #ifdef QUESO_MEMORY_DEBUGGING
530 std::cout <<
"Leaving EnvOptions::getMyOptionsValues()" << std::endl;
535 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
int NumProc() const
Returns total number of processes.
std::string m_option_syncVerbosity
Input file option name for m_syncVerbosity.
#define UQ_ENV_IDENTIFYING_STRING_ODV
std::string m_option_subDisplayAllowAll
Input file option name for m_subDisplayAllowAll.
const GetPot & input() const
The GetPot input file parser.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
void copy(const EnvOptionsValues &src)
Makes an exact copy of an existing EnvOptionsValues instance.
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
virtual ~EnvOptionsValues()
Destructor.
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
BoostInputOptionsParser * m_parser
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
This class provides a suite options one can pass to a QUESO environment.
boost::program_options::options_description * m_optionsDesc
Environment options description.
void defineMyOptions(boost::program_options::options_description &optionsDesc) const
Define my environment options as the default options.
std::string m_option_subDisplayAllowedSet
Input file option name for m_subDisplayAllowedSet.
#define UQ_ENV_CHECKING_LEVEL_ODV
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
std::string m_option_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
#define UQ_ENV_RNG_TYPE_ODV
unsigned int m_syncVerbosity
Synchronized verbosity.
std::string m_platformName
Platform name.
std::string m_option_help
Input file option name for flagging helpful printing output.
std::string m_option_identifyingString
Input file option name for m_identifyingString.
unsigned vector_variable_size(const char *VarName) const
void getOption(std::string &name, T &value)
Get option name from the parser and set value to the parsed value.
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
#define queso_require_equal_to_msg(expr1, expr2, msg)
EnvOptionsValues()
Default constructor.
#define UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV
boost::program_options::variables_map & allOptionsMap() const
std::string m_option_numSubEnvironments
My number of sub-environments.
const BaseEnvironment & m_env
Environment.
void scanOptionsValues()
Scans option values from input file.
std::string m_option_checkingLevel
Checking level.
std::string m_option_displayVerbosity
Input file option name for m_displayVerbosity.
#define UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV
#define UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV
std::string m_option_checkingLevel
Input file option name for m_checkingLevel.
This class reads options one can pass to a QUESO environment through an input file.
#define queso_deprecated()
std::string m_prefix
Options prefix.
unsigned int m_displayVerbosity
Verbosity.
void getMyOptionValues(boost::program_options::options_description &optionsDesc)
Gets the option values of the environment.
unsigned int m_numDebugParams
Number of debug parameters. Unused?
std::string m_subDisplayFileName
Output filename for sub-screen writing.
std::string m_option_rngType
Input file option name for m_rngType.
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
void scanInputFile()
This is the method that parses the input file.
unsigned int m_numSubEnvironments
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
int print(std::ostream &out_stream=std::cout) const
std::string m_option_help
std::string m_option_platformName
Platform name.
int fullRank() const
Returns the process full rank.
std::string m_option_rngType
Type of the random number generator.
EnvironmentOptions(const BaseEnvironment &env, const char *prefix)
Default constructor.
std::string m_option_subDisplayAllowInter0
Input file option name for m_subDisplayAllowInter0.
#define UQ_ENV_NUM_DEBUG_PARAMS_ODV
~EnvironmentOptions()
Destructor.
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
std::string m_option_seed
Input file option name for m_seed.
#define UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV
std::string m_rngType
Type of the random number generator.
unsigned int displayVerbosity() const
void print(std::ostream &os) const
Print values of the options chosen.
unsigned int m_checkingLevel
Checking level.
void registerOption(std::string name, T defaultValue, std::string description)
Call this to register an option with the parser.
#define queso_require_msg(asserted, msg)
const MpiComm & fullComm() const
Access function for MpiComm full communicator.
std::string m_identifyingString
Identifying string.
std::string m_option_subDisplayFileName
Input file option name for m_subDisplayFileName.
int m_seed
Seed of the random number generator.
std::string m_option_subDisplayAllowedSet
Sub-environments that will write to output.
std::vector< double > m_debugParams
Debug parameters. Unused?
std::string m_option_seed
Seed of the random number generator.
void checkOptions()
Sorts out any inter-option conflicts.
#define UQ_ENV_DISPLAY_VERBOSITY_ODV
#define UQ_ENV_SYNC_VERBOSITY_ODV
std::string m_option_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
std::string m_option_numSubEnvironments
Input file option name for m_numSubEnvironments.
const BaseEnvironment * m_env
std::string m_option_identifyingString
Identifying string.
std::string m_option_platformName
Input file option name for m_platformName.
std::string m_option_subDisplayFileName
My output filename for sub-screen writing.
EnvOptionsValues & operator=(const EnvOptionsValues &rhs)
Operator for copying the options of an environment.
#define UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV
#define UQ_ENV_PLATFORM_NAME_ODV
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
EnvOptionsValues m_ov
Instance of EnvOptionsValues, a class with default values for QUESO environment.
std::string m_option_syncVerbosity
Synchronized verbosity.
std::string m_option_displayVerbosity
Verbosity.