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
The QUESO MPI Communicator Class.
po::options_description * m_allOptionsDesc
virtual void print(std::ostream &os) const =0
int subRank() const
Access function for sub-rank.
~FilePtrSetStruct()
Destructor.
const RngBase * rngObject() const
Access to the RNG object.
std::ofstream * ofsVar
Provides a stream interface to write data to files.
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.
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.
EmptyEnvironment()
Default constructor. Does nothing.
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).
void print(std::ostream &os) const
This class sets up the environment underlying the use of the QUESO library by an executable.
const MpiComm & fullComm() const
Access function for MpiComm full communicator.
void QUESO_version_print(std::ostream &os)
virtual ~BaseEnvironment()
Destructor.
po::variables_map & allOptionsMap() const
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::ostream & operator<<(std::ostream &os, const BaseEnvironment &obj)
void print(std::ostream &os) const
Sends the environment options to the stream.
std::string m_optionsInputFileName
std::ofstream * m_subDisplayFile
std::string platformName() const
Access to the platform name.
po::variables_map * m_allOptionsMap
BasicPdfsBase * m_basicPdfs
void closeFile(FilePtrSetStruct &filePtrSet, const std::string &fileType) const
Closes the file.
std::ifstream * ifsVar
Provides a stream interface to read data from files.
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.
Struct for handling data input and output from files.
~FullEnvironment()
Destructor.
int QUESO_get_numeric_version()
void setOptionsInputFileAccessState(bool newState) const
bool m_optionsInputFileAccessState
RawType_MPI_Group m_inter0Group
FilePtrSetStruct()
Struct constructor.
MPI_Comm RawType_MPI_Comm
MPI_Group RawType_MPI_Group
bool fullEnvIsReady() const
Returns whether the full environment class is ready (constructor has successfully been called)...
const BasicPdfsBase * basicPdfs() const
Access to Basic PDFs.
void setExceptionalCircumstance(bool value) const
Set an exceptional circumstance.
void readOptionsInputFile()
Checks the options input file and reads the options.
int fullRank() const
Returns the process full rank.
unsigned int numSubEnvironments() const
Access function to the number of sub-environments.
This class provides a suite options one can pass to a QUESO environment.
const MpiComm & selfComm() const
Access function for MpiComm self-communicator.
EnvironmentOptions * m_optionsObj
RawType_MPI_Group subGroup() const
Access function for sub-group.
bool m_exceptionalCircumstance
FullEnvironment(RawType_MPI_Comm inputComm, const char *passedOptionsInputFileName, const char *prefix, const EnvOptionsValues *alternativeOptionsValues)
Default constructor.
int seed() const
Access to the RNG seed.
TODO: Base class for basic PDFs (via either GSL or Boost).
This class sets up the full environment underlying the use of the QUESO library by an executable...
RawType_MPI_Group m_fullGroup
Class for random number generation (base class for either GSL or Boost RNG).
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_terminate_handler()
Function for unhandled exceptions in Queso.
~EmptyEnvironment()
Destructor.
const MpiComm & inter0Comm() const
Access function for MpiComm inter0-communicator.
void checkTheParallelEnvironment() const
EnvOptionsValues m_alternativeOptionsValues
This class reads options one can pass to a QUESO environment through an input file.
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
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
void scanInputFileForMyOptions(const po::options_description &optionsDesc) const
This method scans the input file provided by the user to QUESO.