25 #ifndef UQ_ENVIRONMENT_H
26 #define UQ_ENVIRONMENT_H
28 #include <queso/Defines.h>
30 class EnvironmentOptions;
33 #undef UQ_USES_COMMAND_LINE_OPTIONS
35 #include <queso/MpiComm.h>
39 #include <boost/program_options.hpp>
40 namespace po = boost::program_options;
44 #include <queso/RngBase.h>
45 #include <queso/BasicPdfsBase.h>
65 struct FilePtrSetStruct {
252 unsigned int subId ()
const;
266 #ifdef UQ_USES_COMMAND_LINE_OPTIONS
267 const po::options_description& allOptionsDesc ()
const;
315 struct timeval timevalBegin () const;
322 bool openOutputFile(
const std::string& fileName,
const std::string& fileType,
323 const std::set<unsigned int>& allowedSubEnvIds,
bool writeOver,
331 bool openInputFile (
const std::string& fileName,
const std::string& fileType,
332 const std::set<unsigned int>& allowedSubEnvIds,
349 virtual void print (std::ostream& os)
const = 0;
408 void print(std::ostream& os)
const;
435 void print (std::ostream& os)
const;
450 #endif // UQ_ENVIRONMENT_H
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.
bool openInputFile(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, FilePtrSetStruct &filePtrSet) const
Opens an input file.
std::string m_subIdString
po::options_description * m_allOptionsDesc
void readOptionsInputFile()
Checks the options input file and reads the options.
virtual void print(std::ostream &os) const =0
Class for random number generation (base class for either GSL or Boost RNG).
int subRank() const
Access function for sub-rank.
int QUESO_get_numeric_version()
MPI_Group RawType_MPI_Group
const RngBase * rngObject() const
Access to the RNG object.
unsigned int syncVerbosity() const
Access function to private attribute m_syncVerbosity.
bool openUnifiedInputFile(const std::string &fileName, const std::string &fileType, FilePtrSetStruct &filePtrSet) const
Opens the unified input file.
struct timeval m_timevalBegin
int inter0Rank() const
Returns the process inter0 rank.
~FilePtrSetStruct()
Destructor.
std::ofstream * ofsVar
Provides a stream interface to write data to files.
This class sets up the full environment underlying the use of the QUESO library by an executable...
std::string subDisplayFileName() const
Access function for m_subDisplayFileName (displays filename on stream).
void resetSeed(int newSeedOption)
Reset RNG seed.
int worldRank() const
Returns the process world rank.
unsigned int checkingLevel() const
Access function to private attribute m_checkingLevel.
const MpiComm & subComm() const
Access function for MpiComm sub communicator.
BaseEnvironment(const char *passedOptionsInputFileName, const EnvOptionsValues *alternativeOptionsValues)
Default constructor.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
~EmptyEnvironment()
Destructor.
This class reads options one can pass to a QUESO environment through an input file.
const MpiComm & fullComm() const
Access function for MpiComm full communicator.
virtual ~BaseEnvironment()
Destructor.
~FullEnvironment()
Destructor.
po::variables_map & allOptionsMap() const
FilePtrSetStruct()
Struct constructor.
void resetIdentifyingString(const std::string &newString) const
Reset private attribute m_identifyingString with the value newString.
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
std::string identifyingString() const
Access function to private attribute m_identifyingString: identifying string.
std::string m_optionsInputFileName
std::ofstream * m_subDisplayFile
std::string platformName() const
Access to the platform name.
void queso_terminate_handler()
Function for unhandled exceptions in Queso.
po::variables_map * m_allOptionsMap
BasicPdfsBase * m_basicPdfs
void closeFile(FilePtrSetStruct &filePtrSet, const std::string &fileType) const
Closes the file.
std::string optionsInputFileName() const
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
bool isThereInputFile() const
//TODO Not implemented? it is called in examples/validationCycle/tests_old/results_5_25/uqTgaEx4.h.
void print(std::ostream &os) const
void setOptionsInputFileAccessState(bool newState) const
bool m_optionsInputFileAccessState
RawType_MPI_Group m_inter0Group
TODO: Base class for basic PDFs (via either GSL or Boost).
bool fullEnvIsReady() const
Returns whether the full environment class is ready (constructor has successfully been called)...
EmptyEnvironment()
Default constructor. Does nothing.
const BasicPdfsBase * basicPdfs() const
Access to Basic PDFs.
This class sets up the environment underlying the use of the QUESO library by an executable.
void setExceptionalCircumstance(bool value) const
Set an exceptional circumstance.
int fullRank() const
Returns the process full rank.
unsigned int numSubEnvironments() const
Access function to the number of sub-environments.
const MpiComm & selfComm() const
Access function for MpiComm self-communicator.
EnvironmentOptions * m_optionsObj
std::ifstream * ifsVar
Provides a stream interface to read data from files.
RawType_MPI_Group subGroup() const
Access function for sub-group.
Struct for handling data input and output from files.
bool m_exceptionalCircumstance
void print(std::ostream &os) const
Sends the environment options to the stream.
int seed() const
Access to the RNG seed.
RawType_MPI_Group m_fullGroup
std::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
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.
unsigned int displayVerbosity() const
void QUESO_version_print(std::ostream &os)
const MpiComm & inter0Comm() const
Access function for MpiComm inter0-communicator.
void checkTheParallelEnvironment() const
FullEnvironment(RawType_MPI_Comm inputComm, const char *passedOptionsInputFileName, const char *prefix, const EnvOptionsValues *alternativeOptionsValues)
Default constructor.
EnvOptionsValues m_alternativeOptionsValues
This class provides a suite options one can pass to a QUESO environment.
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
The QUESO MPI Communicator Class.
BaseEnvironment & operator=(const BaseEnvironment &rhs)
Assignment operator. It should not be used be the user.
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...
bool exceptionalCircumstance() const
Decides whether there is an exceptional circumstance.
RawType_MPI_Group m_subGroup
MPI_Comm RawType_MPI_Comm
void scanInputFileForMyOptions(const po::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.