25 #include <queso/EnvironmentOptions.h>
26 #include <queso/Miscellaneous.h>
28 #include <queso/asserts.h>
52 m_debugParams (m_numDebugParams,0.)
107 m_prefix ((std::string)(prefix) +
"env_"),
108 m_optionsDesc (new po::options_description(
"Environment options")),
109 m_option_help (m_prefix +
"help" ),
110 m_option_numSubEnvironments (m_prefix +
"numSubEnvironments" ),
111 m_option_subDisplayFileName (m_prefix +
"subDisplayFileName" ),
112 m_option_subDisplayAllowAll (m_prefix +
"subDisplayAllowAll" ),
113 m_option_subDisplayAllowInter0(m_prefix +
"subDisplayAllowInter0"),
114 m_option_subDisplayAllowedSet (m_prefix +
"subDisplayAllowedSet" ),
115 m_option_displayVerbosity (m_prefix +
"displayVerbosity" ),
116 m_option_syncVerbosity (m_prefix +
"syncVerbosity" ),
117 m_option_checkingLevel (m_prefix +
"checkingLevel" ),
118 m_option_rngType (m_prefix +
"rngType" ),
119 m_option_seed (m_prefix +
"seed" ),
120 m_option_platformName (m_prefix +
"platformName" ),
121 m_option_identifyingString (m_prefix +
"identifyingString" )
125 "EnvironmentOptions::constructor(1)",
126 "this constructor is incompatible with the abscense of an options input file");
134 m_ov (alternativeOptionsValues),
136 m_prefix ((std::string)(prefix) +
"env_"),
137 m_optionsDesc (NULL),
138 m_option_help (m_prefix +
"help" ),
139 m_option_numSubEnvironments (m_prefix +
"numSubEnvironments" ),
140 m_option_subDisplayFileName (m_prefix +
"subDisplayFileName" ),
141 m_option_subDisplayAllowAll (m_prefix +
"subDisplayAllowAll" ),
142 m_option_subDisplayAllowInter0(m_prefix +
"subDisplayAllowInter0"),
143 m_option_subDisplayAllowedSet (m_prefix +
"subDisplayAllowedSet" ),
144 m_option_displayVerbosity (m_prefix +
"displayVerbosity" ),
145 m_option_syncVerbosity (m_prefix +
"syncVerbosity" ),
146 m_option_checkingLevel (m_prefix +
"checkingLevel" ),
147 m_option_rngType (m_prefix +
"rngType" ),
148 m_option_seed (m_prefix +
"seed" ),
149 m_option_platformName (m_prefix +
"platformName" ),
150 m_option_identifyingString (m_prefix +
"identifyingString" )
154 "EnvironmentOptions::constructor(2)",
155 "this constructor is incompatible with the existence of an options input file");
159 <<
": after setting values of options with prefix '" <<
m_prefix
160 <<
"', state of object is:"
177 "EnvironmentOptions::scanOptionsValues()",
178 "m_optionsDesc variable is NULL");
187 std::cout <<
"In EnvironmentOptions::scanOptionsValues()"
188 <<
": after reading values of options with prefix '" <<
m_prefix
189 <<
"', state of object is:"
224 #ifdef QUESO_MEMORY_DEBUGGING
225 std::cout <<
"In EnvOptions::defineMyOptions(), before add_options()" << std::endl;
227 optionsDesc.add_options()
228 (
m_option_help.c_str(),
"produce help message for environment" )
243 #ifdef QUESO_MEMORY_DEBUGGING
244 std::cout <<
"In EnvOptions::defineMyOptions(), after add_options()" << std::endl;
253 #ifdef QUESO_MEMORY_DEBUGGING
254 std::cout <<
"Entering EnvOptions::getMyOptionsValues()" << std::endl;
266 std::cerr <<
"In BaseEnvironment::getMyOptionValues()"
273 "BaseEnvironment::getMyOptionValues()",
274 "total number of processors in environment must be multiple of the specified number of subEnvironments");
298 std::vector<double> tmpAllow(0,0.);
309 if (tmpAllow.size() > 0) {
310 for (
unsigned int i = 0; i < tmpAllow.size(); ++i) {
348 #ifdef QUESO_MEMORY_DEBUGGING
349 std::cout <<
"Leaving EnvOptions::getMyOptionsValues()" << std::endl;
std::string m_option_seed
Seed of the random number generator.
unsigned int m_checkingLevel
Checking level.
void copy(const EnvOptionsValues &src)
Makes an exact copy of an existing EnvOptionsValues instance.
EnvironmentOptions(const BaseEnvironment &env, const char *prefix)
Default constructor.
int NumProc() const
Returns total number of processes.
EnvOptionsValues()
Default constructor.
std::string m_option_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
std::string m_option_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
void MiscReadDoublesFromString(const std::string &inputString, std::vector< double > &outputDoubles)
const BaseEnvironment & m_env
Environment.
std::string m_option_subDisplayAllowedSet
Sub-environments that will write to output.
void getMyOptionValues(po::options_description &optionsDesc)
Gets the option values of the environment.
std::string m_option_numSubEnvironments
My number of sub-environments.
std::string m_option_checkingLevel
Checking level.
#define UQ_ENV_SYNC_VERBOSITY_ODV
unsigned int m_displayVerbosity
Verbosity.
unsigned int m_numDebugParams
Number of debug parameters.
std::string m_option_platformName
Platform name.
std::string m_subDisplayFileName
Output filename for sub-screen writing.
int worldRank() const
Returns the process world rank.
std::string m_option_displayVerbosity
Verbosity.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
std::string m_prefix
Options prefix.
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
#define UQ_ENV_CHECKING_LEVEL_ODV
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
const MpiComm & fullComm() const
Access function for MpiComm full communicator.
EnvOptionsValues & operator=(const EnvOptionsValues &rhs)
Operator for copying the options of an environment.
po::variables_map & allOptionsMap() const
#define UQ_ENV_IDENTIFYING_STRING_ODV
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
#define UQ_ENV_RNG_TYPE_ODV
unsigned int m_syncVerbosity
Synchronized verbosity.
std::string m_option_subDisplayFileName
My output filename for sub-screen writing.
void print(std::ostream &os) const
Print values of the options chosen.
std::string m_rngType
Type of the random number generator.
#define UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
std::string m_option_rngType
Type of the random number generator.
#define UQ_ENV_NUM_DEBUG_PARAMS_ODV
void defineMyOptions(po::options_description &optionsDesc) const
Define my environment options as the default options.
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
#define UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV
std::vector< double > m_debugParams
Debug parameters.
std::string m_option_help
void scanOptionsValues()
Scans option values from input file.
std::string m_option_syncVerbosity
Synchronized verbosity.
#define UQ_ENV_DISPLAY_VERBOSITY_ODV
std::string m_platformName
Platform name.
#define UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV
std::string m_identifyingString
Identifying string.
int fullRank() const
Returns the process full rank.
This class reads options one can pass to a QUESO environment through an input file.
#define UQ_ENV_PLATFORM_NAME_ODV
EnvOptionsValues m_ov
Instance of EnvOptionsValues, a class with default values for QUESO environment.
unsigned int displayVerbosity() const
std::string m_option_identifyingString
Identifying string.
#define UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
~EnvOptionsValues()
Destructor.
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
~EnvironmentOptions()
Destructor.
This class provides a suite options one can pass to a QUESO environment.
int m_seed
Seed of the random number generator.
po::options_description * m_optionsDesc
Environment options description.
#define UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV
void scanInputFileForMyOptions(const po::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
unsigned int m_numSubEnvironments
Number of sub-environments.