queso-0.56.0
EnvironmentOptions.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
26 #include <boost/program_options.hpp>
27 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
28 
29 #include <queso/EnvironmentOptions.h>
30 #include <queso/Miscellaneous.h>
31 
32 #include <queso/asserts.h>
33 
34 namespace QUESO {
35 
36 // --------------------------------------------------
37 // EnvOptionsValues --------------------------
38 // --------------------------------------------------
39 
40 // Default constructor ------------------------------
42  :
43  m_prefix("env_"),
44  m_help(UQ_ENV_HELP),
45  m_numSubEnvironments(UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV),
46  m_subDisplayFileName(UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV),
47  m_subDisplayAllowAll(UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV),
48  m_subDisplayAllowInter0(UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV),
49  //m_subDisplayAllowedSet (),
50  m_displayVerbosity(UQ_ENV_DISPLAY_VERBOSITY_ODV),
51  m_syncVerbosity(UQ_ENV_SYNC_VERBOSITY_ODV),
52  m_checkingLevel(UQ_ENV_CHECKING_LEVEL_ODV),
53  m_rngType(UQ_ENV_RNG_TYPE_ODV),
54  m_seed(UQ_ENV_SEED_ODV),
55  m_platformName(UQ_ENV_PLATFORM_NAME_ODV),
56  m_identifyingString(UQ_ENV_IDENTIFYING_STRING_ODV),
57  m_numDebugParams(UQ_ENV_NUM_DEBUG_PARAMS_ODV),
58  m_debugParams(m_numDebugParams,0.),
59  m_env(NULL),
60 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
61  m_parser(NULL),
62 #endif // 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")
76 {
77 }
78 
80  prefix)
81  :
82  m_prefix((std::string) + "env_"),
83  m_help(UQ_ENV_HELP),
84  m_numSubEnvironments(UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV),
85  m_subDisplayFileName(UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV),
86  m_subDisplayAllowAll(UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV),
87  m_subDisplayAllowInter0(UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV),
88  //m_subDisplayAllowedSet (),
89  m_displayVerbosity(UQ_ENV_DISPLAY_VERBOSITY_ODV),
90  m_syncVerbosity(UQ_ENV_SYNC_VERBOSITY_ODV),
91  m_checkingLevel(UQ_ENV_CHECKING_LEVEL_ODV),
92  m_rngType(UQ_ENV_RNG_TYPE_ODV),
93  m_seed(UQ_ENV_SEED_ODV),
94  m_platformName(UQ_ENV_PLATFORM_NAME_ODV),
95  m_identifyingString(UQ_ENV_IDENTIFYING_STRING_ODV),
96  m_numDebugParams(UQ_ENV_NUM_DEBUG_PARAMS_ODV),
97  m_debugParams(m_numDebugParams,0.),
98  m_env(env),
99 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
100  m_parser(new BoostInputOptionsParser(env->optionsInputFileName())),
101 #endif // 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")
115 {
116 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
117  // Register all options with parser
118  m_parser->registerOption<std::string >(m_option_help, UQ_ENV_HELP, "produce help message for environment");
119  m_parser->registerOption<unsigned int>(m_option_numSubEnvironments, UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV, "number of subEnvironments");
120  m_parser->registerOption<std::string >(m_option_subDisplayFileName, UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV, "output filename for subscreen writing");
121  m_parser->registerOption<bool >(m_option_subDisplayAllowAll, UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV, "Allow all processors to write to output file");
122  m_parser->registerOption<bool >(m_option_subDisplayAllowInter0, UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV, "Allow all inter0 nodes to write to output file");
123  m_parser->registerOption<std::string >(m_option_subDisplayAllowedSet, UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV, "subEnvs that will write to output file");
125  m_parser->registerOption<unsigned int>(m_option_syncVerbosity, UQ_ENV_SYNC_VERBOSITY_ODV, "set sync verbosity");
126  m_parser->registerOption<unsigned int>(m_option_checkingLevel, UQ_ENV_CHECKING_LEVEL_ODV, "set checking level");
127  m_parser->registerOption<std::string >(m_option_rngType, UQ_ENV_RNG_TYPE_ODV, "set rngType");
129  m_parser->registerOption<std::string >(m_option_platformName, UQ_ENV_PLATFORM_NAME_ODV, "platform name");
131 
132  // Read the input file
134 
135  m_parser->getOption<std::string >(m_option_help, m_help);
148 #else
154 
155  // UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV is the empty set (string) by default
156  unsigned int size = m_env->input().vector_variable_size(m_option_subDisplayAllowedSet);
157  for (unsigned int i = 0; i < size; i++) {
158  // We default to empty set, so the default values are actually never
159  // used here
160  unsigned int allowed = m_env->input()(m_option_subDisplayAllowedSet, i, i);
161  m_subDisplayAllowedSet.insert(allowed);
162  }
163 
171 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
172 
173  checkOptions();
174 }
175 
176 void
178 {
179  // Clear the permitted set of ranks if the user specifies that all are
180  // allowed to display or the Inter0 communicator is allowed to display
181  if (m_subDisplayAllowAll) {
182  // This will get filled by the Environment after the sub communicators are
183  // created
184  m_subDisplayAllowedSet.clear();
185  }
186  else if (m_subDisplayAllowInter0) {
187  m_subDisplayAllowedSet.clear();
188  }
189 }
190 
191 // Copy constructor ---------------------------------
193 {
194  this->copy(src);
195 }
196 
197 // Destructor ---------------------------------------
199 {
200 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
201  if (m_parser) {
202  delete m_parser;
203  }
204 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
205 }
206 
207 // Set methods---------------------------------------
210 {
211  this->copy(rhs);
212  return *this;
213 }
214 // Private methods-----------------------------------
215 void
217 {
226  m_rngType = src.m_rngType;
227  m_seed = src.m_seed;
232 
233  return;
234 }
235 
236 std::ostream& operator<<(std::ostream& os, const EnvOptionsValues & obj)
237 {
238  // Print the parser
239 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
240  os << (*(obj.m_parser)) << std::endl;
241 #else
242  obj.m_env->input().print(os);
243 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
244 
245  // Print the option names and current values
246  os << obj.m_option_numSubEnvironments << " = " << obj.m_numSubEnvironments
247  << "\n" << obj.m_option_subDisplayFileName << " = " << obj.m_subDisplayFileName
248  << "\n" << obj.m_option_subDisplayAllowAll << " = " << obj.m_subDisplayAllowAll
249  //<< "\n" << obj.m_option_subDisplayAllowInter0 << " = " << obj.m_subDisplayAllowInter0
250  << "\n" << obj.m_option_subDisplayAllowedSet << " = ";
251  for (std::set<unsigned int>::iterator setIt = obj.m_subDisplayAllowedSet.begin(); setIt != obj.m_subDisplayAllowedSet.end(); ++setIt) {
252  os << *setIt << " ";
253  }
254  os << "\n" << obj.m_option_displayVerbosity << " = " << obj.m_displayVerbosity
255  << "\n" << obj.m_option_syncVerbosity << " = " << obj.m_syncVerbosity
256  << "\n" << obj.m_option_checkingLevel << " = " << obj.m_checkingLevel
257  << "\n" << obj.m_option_rngType << " = " << obj.m_rngType
258  << "\n" << obj.m_option_seed << " = " << obj.m_seed
259  << "\n" << obj.m_option_platformName << " = " << obj.m_platformName
260  << "\n" << obj.m_option_identifyingString << " = " << obj.m_identifyingString
261  //<< "\n" << obj.m_option_numDebugParams << " = " << obj.m_numDebugParams
262  << std::endl;
263  return os;
264 }
265 
266 // --------------------------------------------------
267 // EnvironmentOptions ------------------------
268 // --------------------------------------------------
269 
270 // Default constructor ------------------------------
272  const BaseEnvironment& env,
273  const char* prefix)
274  :
275  m_ov (),
276  m_env (env),
277  m_prefix ((std::string)(prefix) + "env_"),
278 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
279  m_optionsDesc (new boost::program_options::options_description("Environment options")),
280 #endif // DISABLE_BOOST_PROGRAM_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" )
294 {
296  queso_require_not_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the abscense of an options input file"));
297 }
298 // Constructor with alternative values --------------
300  const BaseEnvironment& env,
301  const char* prefix,
302  const EnvOptionsValues& alternativeOptionsValues)
303  :
304  m_ov (alternativeOptionsValues),
305  m_env (env),
306  m_prefix ((std::string)(prefix) + "env_"),
307 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
308  m_optionsDesc (NULL),
309 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
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" )
323 {
325  queso_require_equal_to_msg(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"));
326 
327  if (m_env.subDisplayFile() != NULL) {
328  *m_env.subDisplayFile() << "In EnvironmentOptions::constructor(2)"
329  << ": after setting values of options with prefix '" << m_prefix
330  << "', state of object is:"
331  << "\n" << *this
332  << std::endl;
333  }
334 }
335 // Destructor ---------------------------------------
337 {
339 
340 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
341  if (m_optionsDesc) delete m_optionsDesc;
342 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
343 }
344 
345 // I/O methods---------------------------------------
346 void
348 {
350 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
351  queso_require_msg(m_optionsDesc, "m_optionsDesc variable is NULL");
352 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
353 
354 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
358 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
359 
360  // 'm_subDisplayOutputFile' is still not available at this moment. Use 'std::cout'
361  //if (m_env.subScreenFile() != NULL) {
362  // *m_env.subScreenFile()
363  if ((m_env.fullRank() == 0) && (m_env.displayVerbosity() >= 3)) {
364  std::cout << "In EnvironmentOptions::scanOptionsValues()"
365  << ": after reading values of options with prefix '" << m_prefix
366  << "', state of object is:"
367  << "\n" << *this
368  << std::endl;
369  }
370 
371  return;
372 }
373 // --------------------------------------------------
374 void
375 EnvironmentOptions::print(std::ostream& os) const
376 {
378 
382  //<< "\n" << m_option_subDisplayAllowInter0 << " = " << m_ov.m_subDisplayAllowInter0
383  << "\n" << m_option_subDisplayAllowedSet << " = ";
384  for (std::set<unsigned int>::iterator setIt = m_ov.m_subDisplayAllowedSet.begin(); setIt != m_ov.m_subDisplayAllowedSet.end(); ++setIt) {
385  os << *setIt << " ";
386  }
387  os << "\n" << m_option_displayVerbosity << " = " << m_ov.m_displayVerbosity
388  << "\n" << m_option_syncVerbosity << " = " << m_ov.m_syncVerbosity
389  << "\n" << m_option_checkingLevel << " = " << m_ov.m_checkingLevel
390  << "\n" << m_option_rngType << " = " << m_ov.m_rngType
391  << "\n" << m_option_seed << " = " << m_ov.m_seed
392  << "\n" << m_option_platformName << " = " << m_ov.m_platformName
394  //<< "\n" << m_option_numDebugParams << " = " << m_ov.m_numDebugParams
395  << std::endl;
396  return;
397 }
398 
399 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
400 // Private methods ----------------------------------
401 void
402 EnvironmentOptions::defineMyOptions(boost::program_options::options_description& optionsDesc) const
403 {
405 
406 #ifdef QUESO_MEMORY_DEBUGGING
407  std::cout << "In EnvOptions::defineMyOptions(), before add_options()" << std::endl;
408 #endif
409  optionsDesc.add_options()
410  (m_option_help.c_str(), "produce help message for environment" )
411  (m_option_numSubEnvironments.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_ENV_NUM_SUB_ENVIRONMENTS_ODV), "number of subEnvironments" )
412  (m_option_subDisplayFileName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_ENV_SUB_DISPLAY_FILE_NAME_ODV), "output filename for subscreen writing" )
413  (m_option_subDisplayAllowAll.c_str(), boost::program_options::value<bool >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOW_ALL_ODV), "Allow all processors to write to output file" )
414  (m_option_subDisplayAllowInter0.c_str(), boost::program_options::value<bool >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV), "Allow all inter0 nodes to write to output file")
415  (m_option_subDisplayAllowedSet.c_str(), boost::program_options::value<std::string >()->default_value(UQ_ENV_SUB_DISPLAY_ALLOWED_SET_ODV), "subEnvs that will write to output file" )
416  (m_option_displayVerbosity.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_ENV_DISPLAY_VERBOSITY_ODV), "set verbosity" )
417  (m_option_syncVerbosity.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_ENV_SYNC_VERBOSITY_ODV), "set sync verbosity" )
418  (m_option_checkingLevel.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_ENV_CHECKING_LEVEL_ODV), "set checking level" )
419  (m_option_rngType.c_str(), boost::program_options::value<std::string >()->default_value(UQ_ENV_RNG_TYPE_ODV), "set rngType" )
420  (m_option_seed.c_str(), boost::program_options::value<int >()->default_value(UQ_ENV_SEED_ODV), "set seed" )
421  (m_option_platformName.c_str(), boost::program_options::value<std::string >()->default_value(UQ_ENV_PLATFORM_NAME_ODV), "platform name" )
422  (m_option_identifyingString.c_str(), boost::program_options::value<std::string >()->default_value(UQ_ENV_IDENTIFYING_STRING_ODV), "identifying string" )
423  //(m_option_numDebugParams.c_str(), boost::program_options::value<unsigned int>()->default_value(UQ_ENV_NUM_DEBUG_PARAMS_ODV), "set number of debug parameters" )
424  ;
425 #ifdef QUESO_MEMORY_DEBUGGING
426  std::cout << "In EnvOptions::defineMyOptions(), after add_options()" << std::endl;
427 #endif
428 
429  return;
430 }
431 // --------------------------------------------------
432 void
433 EnvironmentOptions::getMyOptionValues(boost::program_options::options_description& optionsDesc)
434 {
436 
437 #ifdef QUESO_MEMORY_DEBUGGING
438  std::cout << "Entering EnvOptions::getMyOptionsValues()" << std::endl;
439 #endif
440  if (m_env.allOptionsMap().count(m_option_help.c_str())) {
441  // 'm_subDisplayOutputFile' is still not available at this moment. Use 'std::cout'
442  if (m_env.fullRank() == 0) std::cout << optionsDesc
443  << std::endl;
444  }
445 
446  if (m_env.allOptionsMap().count(m_option_numSubEnvironments.c_str())) {
448  }
450  std::cerr << "In BaseEnvironment::getMyOptionValues()"
451  << ": m_env.fullComm().NumProc() = " << m_env.fullComm().NumProc()
452  << ", m_numSubEnvironments = " << m_ov.m_numSubEnvironments
453  << std::endl;
454  }
455  queso_require_equal_to_msg((m_env.fullComm().NumProc()%m_ov.m_numSubEnvironments), 0, "total number of processors in environment must be multiple of the specified number of subEnvironments");
456 
457  if (m_env.allOptionsMap().count(m_option_subDisplayFileName.c_str())) {
459  }
460 
461  if (m_env.allOptionsMap().count(m_option_subDisplayAllowAll.c_str())) {
463  }
464 
465  if (m_env.allOptionsMap().count(m_option_subDisplayAllowInter0.c_str())) {
467  }
468 
471  // The line below is commented because 'm_subId' is not set at this point yet
472  //m_subDisplayAllowedSet.insert((unsigned int) m_subId);
473  }
474  else if (m_ov.m_subDisplayAllowInter0) {
476  }
477  else if (m_env.allOptionsMap().count(m_option_subDisplayAllowedSet.c_str())) {
479  std::vector<double> tmpAllow(0,0.);
480  std::string inputString = m_env.allOptionsMap()[m_option_subDisplayAllowedSet].as<std::string>();
481  MiscReadDoublesFromString(inputString,tmpAllow);
482  //if (m_subDisplayOutputFile) {
483  // *m_subDisplayOutputFile << "In EnvironmentOptions::getMyOptionValues(): allow = ";
484  // for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
485  // *m_subDisplayOutputFile << " " << tmpAllow[i];
486  // }
487  // *m_subDisplayOutputFile << std::endl;
488  //}
489 
490  if (tmpAllow.size() > 0) {
491  for (unsigned int i = 0; i < tmpAllow.size(); ++i) {
492  m_ov.m_subDisplayAllowedSet.insert((unsigned int) tmpAllow[i]);
493  }
494  }
495  }
496 
497  if (m_env.allOptionsMap().count(m_option_displayVerbosity.c_str())) {
499  }
500 
501  if (m_env.allOptionsMap().count(m_option_syncVerbosity.c_str())) {
503  }
504 
505  if (m_env.allOptionsMap().count(m_option_checkingLevel.c_str())) {
507  }
508 
509  if (m_env.allOptionsMap().count(m_option_rngType.c_str())) {
510  m_ov.m_rngType = m_env.allOptionsMap()[m_option_rngType].as<std::string>();
511  }
512 
513  if (m_env.allOptionsMap().count(m_option_seed.c_str())) {
515  }
516 
517  if (m_env.allOptionsMap().count(m_option_platformName.c_str())) {
519  }
520 
521  if (m_env.allOptionsMap().count(m_option_identifyingString.c_str())) {
523  }
524 
525  //if (m_env.allOptionsMap().count(m_option_numDebugParams.c_str())) {
526  // m_numDebugParams = m_env.allOptionsMap()[m_option_numDebugParams].as<unsigned int>();
527  //}
528 
529 #ifdef QUESO_MEMORY_DEBUGGING
530  std::cout << "Leaving EnvOptions::getMyOptionsValues()" << std::endl;
531 #endif
532 
533  return;
534 }
535 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
536 
537 // Operator outside class definition ----------------
538 std::ostream& operator<<(std::ostream& os, const EnvironmentOptions& obj)
539 {
541 
542  obj.print(os);
543 
544  return os;
545 }
546 
547 } // End namespace QUESO
#define UQ_ENV_SEED_ODV
int NumProc() const
Returns total number of processes.
Definition: MpiComm.C:123
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.
Definition: Environment.C:1148
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
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...
Definition: Environment.C:353
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...
Definition: Environment.h:197
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
Definition: getpot.h:2532
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)
Definition: Miscellaneous.C:40
#define UQ_ENV_HELP
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:73
EnvOptionsValues()
Default constructor.
#define UQ_ENV_SUB_DISPLAY_ALLOW_INTER0_ODV
boost::program_options::variables_map & allOptionsMap() const
Definition: Environment.C:385
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()
Definition: Defines.h:134
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.
Definition: Environment.C:396
void scanInputFile()
This is the method that parses the input file.
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
int print(std::ostream &out_stream=std::cout) const
Definition: getpot.h:2614
std::string m_option_platformName
Platform name.
int fullRank() const
Returns the process full rank.
Definition: Environment.C:268
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
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:74
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
Definition: Environment.C:449
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)
Definition: asserts.h:69
const MpiComm & fullComm() const
Access function for MpiComm full communicator.
Definition: Environment.C:274
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.

Generated on Tue Nov 29 2016 10:53:10 for queso-0.56.0 by  doxygen 1.8.5