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