25 #ifndef UQ_ENVIRONMENT_H
26 #define UQ_ENVIRONMENT_H
28 #include <queso/Defines.h>
29 #undef UQ_USES_COMMAND_LINE_OPTIONS
31 #include <queso/MpiComm.h>
32 #include <queso/ScopedPtr.h>
41 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
44 namespace program_options {
45 class options_description;
49 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
55 class EnvironmentOptions;
56 class EnvOptionsValues;
76 struct FilePtrSetStruct {
329 unsigned int subId ()
const;
343 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
344 #ifdef UQ_USES_COMMAND_LINE_OPTIONS
345 const boost::program_options::options_description&
allOptionsDesc ()
const;
347 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
349 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
350 boost::program_options::variables_map&
allOptionsMap ()
const;
353 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
356 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
361 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
398 struct timeval timevalBegin () const;
405 bool openOutputFile(
const std::string& fileName,
const std::string& fileType,
406 const std::set<unsigned int>& allowedSubEnvIds,
bool writeOver,
414 bool openInputFile (
const std::string& fileName,
const std::string& fileType,
415 const std::set<unsigned int>& allowedSubEnvIds,
432 const GetPot &
input()
const;
435 virtual void print (std::ostream& os)
const = 0;
449 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
452 #endif // DISABLE_BOOST_PROGRAM_OPTIONS
496 void print(std::ostream& os)
const;
522 const std::string& passedOptionsInputFileName,
523 const std::string& prefix,
535 const std::string& prefix,
544 void print (std::ostream& os)
const;
568 #endif // UQ_ENVIRONMENT_H
bool m_optionsInputFileAccessState
BaseEnvironment(const char *passedOptionsInputFileName, EnvOptionsValues *alternativeOptionsValues)
Default constructor.
std::string platformName() const
Access to the platform name.
void print(std::ostream &os) const
ScopedPtr< MpiComm >::Type m_subComm
bool openUnifiedInputFile(const std::string &fileName, const std::string &fileType, FilePtrSetStruct &filePtrSet) const
Opens the unified input file.
void setOptionsInputFileAccessState(bool newState) const
MPI_Comm RawType_MPI_Comm
ScopedPtr< boost::program_options::options_description >::Type m_allOptionsDesc
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.
int seed() const
Access to the RNG seed.
ScopedPtr< std::ofstream >::Type m_subDisplayFile
std::ostream & operator<<(std::ostream &os, const SequenceStatisticalOptions &obj)
std::string m_subIdString
std::ifstream * ifsVar
Provides a stream interface to read data from files.
const MpiComm & subComm() const
Access function for each sub-environment's communicator.
const BasicPdfsBase * basicPdfs() const
Access to Basic PDFs.
This class sets up the full environment underlying the use of the QUESO library by an executable...
This class sets up the environment underlying the use of the QUESO library by an executable.
bool m_exceptionalCircumstance
std::string identifyingString() const
Access function to private attribute m_identifyingString: identifying string.
bool isThereInputFile() const
//TODO Not implemented? it is called in examples/validationCycle/tests_old/results_5_25/uqTgaEx4.h.
ScopedPtr< MpiComm >::Type m_fullComm
bool exceptionalCircumstance() const
Decides whether there is an exceptional circumstance.
void resetSeed(int newSeedOption)
Reset RNG seed.
The QUESO MPI Communicator Class.
std::string m_optionsInputFileName
const std::string & subIdString() const
Access to the attribute m_subIdString; which stores the string for the sub-environment, and it will be used, for instance, to create the output files for each sub-environment.
ScopedPtr< MpiComm >::Type m_selfComm
std::unique_ptr< T > Type
int fullRank() const
Returns the rank of the MPI process in QUESO's full communicator.
const MpiComm & inter0Comm() const
Access function for MpiComm communicator for processes with subRank() 0.
~FilePtrSetStruct()
Destructor.
std::ofstream * ofsVar
Provides a stream interface to write data to files.
~EmptyEnvironment()
Destructor.
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
RawType_MPI_Group subGroup() const
Access function for sub-group.
const MpiComm & selfComm() const
Access function for MpiComm self-communicator.
RawType_MPI_Group m_inter0Group
const RngBase * rngObject() const
Access to the RNG object.
bool openOutputFile(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, bool writeOver, FilePtrSetStruct &filePtrSet) const
Opens an output file for each sub-environment that was chosen to send data to the file...
EmptyEnvironment()
Default constructor. Does nothing.
Class for random number generation (base class for either GSL or Boost RNG).
ScopedPtr< GetPot >::Type m_input
int inter0Rank() const
Returns the process inter0 rank.
std::string subDisplayFileName() const
Access function for m_subDisplayFileName (displays filename on stream).
bool openUnifiedOutputFile(const std::string &fileName, const std::string &fileType, bool writeOver, FilePtrSetStruct &filePtrSet) const
Opens a unified output file, that will contain data from all sub-environments.
int worldRank() const
Returns the same thing as fullRank()
ScopedPtr< BasicPdfsBase >::Type m_basicPdfs
void print(std::ostream &os) const
Sends the environment options to the stream.
This class provides a suite options one can pass to a QUESO environment.
void queso_terminate_handler()
Function for unhandled exceptions in Queso.
void QUESO_version_print(std::ostream &os)
void construct(RawType_MPI_Comm inputComm, const char *prefix)
Named constructor backend for multiple constructor overloads.
const boost::program_options::options_description & allOptionsDesc() const
~FullEnvironment()
Destructor.
ScopedPtr< EnvOptionsValues >::Type m_optionsObj
const GetPot & input() const
The GetPot input file parser.
ScopedPtr< MpiComm >::Type m_inter0Comm
Struct for handling data input and output from files.
boost::program_options::variables_map & allOptionsMap() const
int subRank() const
Returns the rank of the MPI process in the sub-communicator subComm()
virtual ~BaseEnvironment()
Destructor.
MPI_Group RawType_MPI_Group
void closeFile(FilePtrSetStruct &filePtrSet, const std::string &fileType) const
Closes the file.
void readOptionsInputFile()
Checks the options input file and reads the options.
struct timeval m_timevalBegin
void resetIdentifyingString(const std::string &newString)
Reset private attribute m_identifyingString with the value newString.
RawType_MPI_Group m_subGroup
bool fullEnvIsReady() const
Returns whether the full environment class is ready (constructor has successfully been called)...
TODO: Base class for basic PDFs (via either GSL or Boost).
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
FilePtrSetStruct()
Struct constructor.
bool openInputFile(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, FilePtrSetStruct &filePtrSet) const
Opens an input file.
int QUESO_get_numeric_version()
unsigned int checkingLevel() const
Access function to private attribute m_checkingLevel.
ScopedPtr< boost::program_options::variables_map >::Type m_allOptionsMap
unsigned int displayVerbosity() const
RawType_MPI_Group m_fullGroup
FullEnvironment(RawType_MPI_Comm inputComm, const char *passedOptionsInputFileName, const char *prefix, EnvOptionsValues *alternativeOptionsValues)
Parallel constructor.
ScopedPtr< RngBase >::Type m_rngObject
void setExceptionalCircumstance(bool value) const
Set an exceptional circumstance.
virtual void print(std::ostream &os) const =0
const MpiComm & fullComm() const
Access function for the communicator that was passed to QUESO's environment.
void checkTheParallelEnvironment() const
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
unsigned int syncVerbosity() const
Access function to private attribute m_syncVerbosity.
unsigned int numSubEnvironments() const
Access function to the number of sub-environments.