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