queso-0.53.0
|
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable. More...
#include <Environment.h>
Public Member Functions | |
Constructor/Destructor methods | |
BaseEnvironment (const char *passedOptionsInputFileName, EnvOptionsValues *alternativeOptionsValues) | |
Default constructor. More... | |
virtual | ~BaseEnvironment () |
Destructor. More... | |
Environment, Communicator and Options Input File methods | |
bool | fullEnvIsReady () const |
Returns whether the full environment class is ready (constructor has successfully been called). More... | |
int | worldRank () const |
Returns the process world rank. More... | |
int | fullRank () const |
Returns the process full rank. More... | |
const MpiComm & | fullComm () const |
Access function for MpiComm full communicator. More... | |
RawType_MPI_Group | subGroup () const |
Access function for sub-group. More... | |
int | subRank () const |
Access function for sub-rank. More... | |
const MpiComm & | subComm () const |
Access function for MpiComm sub communicator. More... | |
const MpiComm & | selfComm () const |
Access function for MpiComm self-communicator. More... | |
int | inter0Rank () const |
Returns the process inter0 rank. More... | |
const MpiComm & | inter0Comm () const |
Access function for MpiComm inter0-communicator. More... | |
std::ofstream * | subDisplayFile () const |
Access function for m_subDisplayFile (displays file on stream). More... | |
std::string | subDisplayFileName () const |
Access function for m_subDisplayFileName (displays filename on stream). More... | |
unsigned int | numSubEnvironments () const |
Access function to the number of sub-environments. More... | |
unsigned int | subId () const |
Access function to the number of each sub-environment Id: m_subId. More... | |
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. More... | |
void | checkTheParallelEnvironment () const |
std::string | optionsInputFileName () const |
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the user to QUESO. More... | |
void | setOptionsInputFileAccessState (bool newState) const |
boost::program_options::variables_map & | allOptionsMap () const |
void | scanInputFileForMyOptions (const boost::program_options::options_description &optionsDesc) const |
This method scans the input file provided by the user to QUESO. More... | |
unsigned int | displayVerbosity () const |
unsigned int | syncVerbosity () const |
Access function to private attribute m_syncVerbosity. More... | |
unsigned int | checkingLevel () const |
Access function to private attribute m_checkingLevel. More... | |
const RngBase * | rngObject () const |
Access to the RNG object. More... | |
void | resetSeed (int newSeedOption) |
Reset RNG seed. More... | |
int | seed () const |
Access to the RNG seed. More... | |
const BasicPdfsBase * | basicPdfs () const |
Access to Basic PDFs. More... | |
std::string | platformName () const |
Access to the platform name. More... | |
std::string | identifyingString () const |
Access function to private attribute m_identifyingString: identifying string. More... | |
void | resetIdentifyingString (const std::string &newString) |
Reset private attribute m_identifyingString with the value newString . More... | |
bool | isThereInputFile () const |
//TODO Not implemented? it is called in examples/validationCycle/tests_old/results_5_25/uqTgaEx4.h. More... | |
struct timeval | timevalBegin () const |
Used to save the time when the combo `QUESO+user's application' started to run. More... | |
I/O methods | |
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. More... | |
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. More... | |
bool | openInputFile (const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, FilePtrSetStruct &filePtrSet) const |
Opens an input file. More... | |
bool | openUnifiedInputFile (const std::string &fileName, const std::string &fileType, FilePtrSetStruct &filePtrSet) const |
Opens the unified input file. More... | |
void | closeFile (FilePtrSetStruct &filePtrSet, const std::string &fileType) const |
Closes the file. More... | |
void | setExceptionalCircumstance (bool value) const |
Set an exceptional circumstance. More... | |
bool | exceptionalCircumstance () const |
Decides whether there is an exceptional circumstance. More... | |
virtual void | print (std::ostream &os) const =0 |
Protected Attributes | |
bool | m_fullEnvIsReady |
int | m_worldRank |
MpiComm * | m_fullComm |
int | m_fullRank |
int | m_fullCommSize |
RawType_MPI_Group | m_fullGroup |
std::string | m_optionsInputFileName |
bool | m_optionsInputFileAccessState |
boost::program_options::options_description * | m_allOptionsDesc |
boost::program_options::variables_map * | m_allOptionsMap |
unsigned int | m_subId |
std::string | m_subIdString |
RawType_MPI_Group | m_subGroup |
MpiComm * | m_subComm |
int | m_subRank |
int | m_subCommSize |
MpiComm * | m_selfComm |
RawType_MPI_Group | m_inter0Group |
MpiComm * | m_inter0Comm |
int | m_inter0Rank |
int | m_inter0CommSize |
std::ofstream * | m_subDisplayFile |
RngBase * | m_rngObject |
BasicPdfsBase * | m_basicPdfs |
struct timeval | m_timevalBegin |
bool | m_exceptionalCircumstance |
EnvOptionsValues * | m_optionsObj |
This (virtual) class sets up the 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. It:
opens output files for messages that would otherwise be written to the screen (one output file per allowed rank is opened and allowed ranks can be specified through the 'options input file').
This class is virtual. It is inherited by 'EmptyEnvironment' and 'FullEnvironment'. The QUESO environment class is instantiated at the application level, right after 'MPI_Init(&argc,&argv)'. The QUESO environment is required by reference by many constructors in the QUESO library, and is available by reference from many classes as well.
Throughout QUESO, there are five classes whose constructors check options in the 'options input file':
These classes rely on 'options classes' to read their options from the input file. The options classes are, respectively:
The last two classes also rely on SequenceStatisticalOptions for reading the options specifying which statistics have to be computed on the sequences of vectors
The QUESO environment class manages five types of communicators. Let:
Usually 'W'='N', but such equality is not necessary. The number 'S' is equal to the QUESO environment option 'm_numSubEnvironments', and is equal to 1 by default. The number 'N' must be a multiple of 'S', otherwise the QUESO class prints a fatal error message and MPI aborts. The five types of communicators that QUESO manages are referred to as:
So, any given node has potentially five different ranks. Of course, if the user is solving just one statistical problem with just one MPI node, then all ranks are equal to zero.
In the QUESO library terminology, one might refer to a QUESO "full" environment composed of
'S' QUESO "sub" environments. Each sub environment is assigned a "sub" id varying from 0 (zero) to S-1. Each sub environment is able to generate a statistical inverse problem and/or a statistical forward problem. That is, each sub environment is able to handle a "sub" Markov chain (a sequence) of vectors and/or a "sub" Monte Carlo sequence of output vectors. The "sub" sequences can be seen as forming a "unified" sequence in a distributed way. Indeed, the virtual class 'VectorSequence' provides "sub" and "unified" statistical operations.
A QUESO "sub" environment eventually prints messages to its own output file. In order for that to happen, the requirements are:
If all requirements are satisfied, then QUESO will generate a file with name '<m_subDisplayFileName>_sub<sub id>.txt'. For instance, if 'm_subDisplayFileName' is 'pROblem_775_' then a node of sub rank 0 in sub environment 17 will write a message to the file 'pROblem_775_sub17.txt'.
Definition at line 193 of file Environment.h.
QUESO::BaseEnvironment::BaseEnvironment | ( | const char * | passedOptionsInputFileName, |
EnvOptionsValues * | alternativeOptionsValues | ||
) |
Default constructor.
Definition at line 132 of file Environment.C.
References m_optionsInputFileName.
|
virtual |
Destructor.
It deallocates memory and does other cleanup for the class object and its class members when the object is destroyed. It displays the total run time of the combo QUESO + application using the function gettimeofday() from a struct timeval (as specified in <sys/time.h>).
Definition at line 161 of file Environment.C.
References displayVerbosity(), m_allOptionsDesc, m_allOptionsMap, m_basicPdfs, m_fullComm, m_fullRank, m_inter0Comm, m_rngObject, m_selfComm, m_subComm, m_subDisplayFile, and m_timevalBegin.
boost::program_options::variables_map & QUESO::BaseEnvironment::allOptionsMap | ( | ) | const |
Access function to private attribute m_allOptionsMap. It is an instance of boost::program_options::variables_map(), which allows concrete variables to map which store variables in real map.
Definition at line 336 of file Environment.C.
References m_allOptionsMap, queso_deprecated, and queso_require_msg.
Referenced by QUESO::ExperimentModelOptions::getMyOptionValues(), QUESO::SimulationModelOptions::getMyOptionValues(), QUESO::GpmsaComputerModelOptions::getMyOptionValues(), QUESO::StatisticalForwardProblemOptions::getMyOptionValues(), QUESO::StatisticalInverseProblemOptions::getMyOptionValues(), QUESO::MonteCarloSGOptions::getMyOptionValues(), QUESO::EnvironmentOptions::getMyOptionValues(), and QUESO::MetropolisHastingsSGOptions::getMyOptionValues().
const BasicPdfsBase * QUESO::BaseEnvironment::basicPdfs | ( | ) | const |
unsigned int QUESO::BaseEnvironment::checkingLevel | ( | ) | const |
Access function to private attribute m_checkingLevel.
Definition at line 410 of file Environment.C.
References QUESO::EnvOptionsValues::m_checkingLevel, m_optionsObj, and queso_require_msg.
Referenced by QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo(), QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmJointTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointTildeInfo(), QUESO::GcmSimulationTildeInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationTildeInfo(), QUESO::GcmZTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZTildeInfo(), and QUESO::GslMatrix::inverse().
void QUESO::BaseEnvironment::checkTheParallelEnvironment | ( | ) | const |
void QUESO::BaseEnvironment::closeFile | ( | FilePtrSetStruct & | filePtrSet, |
const std::string & | fileType | ||
) | const |
Closes the file.
Definition at line 1020 of file Environment.C.
References QUESO::FilePtrSetStruct::ifsVar, m_subDisplayFile, QUESO::FilePtrSetStruct::ofsVar, queso_error_msg, subDisplayFile(), subRank(), UQ_FILE_EXTENSION_FOR_HDF_FORMAT, and UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT.
Referenced by QUESO::GslVector::subReadContents(), QUESO::GslMatrix::subReadContents(), QUESO::GslVector::subWriteContents(), and QUESO::GslMatrix::subWriteContents().
unsigned int QUESO::BaseEnvironment::displayVerbosity | ( | ) | const |
Access function to private attribute m_displayVerbosity. It manages how much information will be release during the use of the QUESO library.
Definition at line 396 of file Environment.C.
References QUESO::EnvOptionsValues::m_displayVerbosity, m_optionsObj, and queso_require_msg.
Referenced by QUESO::AsciiTable< V, M >::AsciiTable(), QUESO::BaseJointPdf< V, M >::BaseJointPdf(), QUESO::BaseMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::BaseMatrixCovarianceFunction(), QUESO::BaseOneDGrid< T >::BaseOneDGrid(), QUESO::BaseScalarCdf< T >::BaseScalarCdf(), QUESO::BaseScalarCovarianceFunction< V, M >::BaseScalarCovarianceFunction(), QUESO::BaseVectorCdf< V, M >::BaseVectorCdf(), QUESO::BaseVectorMdf< V, M >::BaseVectorMdf(), QUESO::BaseVectorRealizer< V, M >::BaseVectorRealizer(), QUESO::BaseVectorRV< V, M >::BaseVectorRV(), QUESO::BetaJointPdf< V, M >::BetaJointPdf(), QUESO::BetaVectorRealizer< V, M >::BetaVectorRealizer(), QUESO::BetaVectorRV< V, M >::BetaVectorRV(), QUESO::ConcatenatedVectorRealizer< V, M >::ConcatenatedVectorRealizer(), QUESO::ConcatenatedVectorRV< V, M >::ConcatenatedVectorRV(), QUESO::GslVector::cwSetBeta(), QUESO::GslMatrix::determinant(), QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::ExperimentModel(), QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::ExperimentStorage(), QUESO::ExponentialMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::ExponentialMatrixCovarianceFunction(), QUESO::ExponentialScalarCovarianceFunction< V, M >::ExponentialScalarCovarianceFunction(), QUESO::FiniteDistribution::FiniteDistribution(), QUESO::FullEnvironment::FullEnvironment(), QUESO::GammaJointPdf< V, M >::GammaJointPdf(), QUESO::GammaVectorRealizer< V, M >::GammaVectorRealizer(), QUESO::GammaVectorRV< V, M >::GammaVectorRV(), QUESO::GaussianJointPdf< V, M >::GaussianJointPdf(), QUESO::GaussianVectorCdf< V, M >::GaussianVectorCdf(), QUESO::GaussianVectorMdf< V, M >::GaussianVectorMdf(), QUESO::GaussianVectorRealizer< V, M >::GaussianVectorRealizer(), QUESO::GaussianVectorRV< V, M >::GaussianVectorRV(), QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo(), QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationInfo(), QUESO::GcmSimulationTildeInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationTildeInfo(), QUESO::GcmTotalInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmTotalInfo(), QUESO::GcmZInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZInfo(), QUESO::GenericMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::GenericMatrixCovarianceFunction(), QUESO::GenericScalarCovarianceFunction< V, M >::GenericScalarCovarianceFunction(), QUESO::GenericVectorRealizer< V, M >::GenericVectorRealizer(), QUESO::GenericVectorRV< V, M >::GenericVectorRV(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel(), QUESO::HessianCovMatricesTKGroup< V, M >::HessianCovMatricesTKGroup(), QUESO::horizontalDistance(), QUESO::GslMatrix::inverse(), QUESO::InverseGammaJointPdf< V, M >::InverseGammaJointPdf(), QUESO::InverseGammaVectorRealizer< V, M >::InverseGammaVectorRealizer(), QUESO::InverseGammaVectorRV< V, M >::InverseGammaVectorRV(), QUESO::GslMatrix::invertMultiply(), QUESO::InvLogitGaussianVectorRV< V, M >::InvLogitGaussianVectorRV(), QUESO::JeffreysJointPdf< V, M >::JeffreysJointPdf(), QUESO::JeffreysVectorRealizer< V, M >::JeffreysVectorRealizer(), QUESO::JeffreysVectorRV< V, M >::JeffreysVectorRV(), QUESO::GslMatrix::lnDeterminant(), QUESO::LogNormalJointPdf< V, M >::LogNormalJointPdf(), QUESO::LogNormalVectorRealizer< V, M >::LogNormalVectorRealizer(), QUESO::LogNormalVectorRV< V, M >::LogNormalVectorRV(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), QUESO::PoweredJointPdf< V, M >::PoweredJointPdf(), QUESO::GslMatrix::rank(), QUESO::SampledScalarCdf< T >::SampledScalarCdf(), QUESO::SampledVectorCdf< V, M >::SampledVectorCdf(), QUESO::SampledVectorMdf< V, M >::SampledVectorMdf(), QUESO::ScaledCovMatrixTKGroup< V, M >::ScaledCovMatrixTKGroup(), QUESO::EnvironmentOptions::scanOptionsValues(), QUESO::SequentialVectorRealizer< V, M >::SequentialVectorRealizer(), QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel(), QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationStorage(), QUESO::StdOneDGrid< T >::StdOneDGrid(), QUESO::StdScalarCdf< T >::StdScalarCdf(), QUESO::GslMatrix::svdSolve(), QUESO::TransformedScaledCovMatrixTKGroup< V, M >::TransformedScaledCovMatrixTKGroup(), QUESO::UniformJointPdf< V, M >::UniformJointPdf(), QUESO::UniformOneDGrid< T >::UniformOneDGrid(), QUESO::UniformVectorRealizer< V, M >::UniformVectorRealizer(), QUESO::UniformVectorRV< V, M >::UniformVectorRV(), QUESO::VectorSet< V, M >::VectorSet(), QUESO::VectorSpace< V, M >::VectorSpace(), QUESO::VectorSubset< V, M >::VectorSubset(), QUESO::WignerJointPdf< V, M >::WignerJointPdf(), QUESO::WignerVectorRealizer< V, M >::WignerVectorRealizer(), QUESO::WignerVectorRV< V, M >::WignerVectorRV(), and ~BaseEnvironment().
bool QUESO::BaseEnvironment::exceptionalCircumstance | ( | ) | const |
Decides whether there is an exceptional circumstance.
Definition at line 1078 of file Environment.C.
References m_exceptionalCircumstance.
const MpiComm & QUESO::BaseEnvironment::fullComm | ( | ) | const |
Access function for MpiComm full communicator.
Definition at line 228 of file Environment.C.
References m_fullComm, and queso_require_msg.
Referenced by QUESO::FullEnvironment::FullEnvironment(), QUESO::EnvironmentOptions::getMyOptionValues(), QUESO::MiscCheckTheParallelEnvironment(), and QUESO::InterpolationSurrogateIOASCII< V, M >::read().
bool QUESO::BaseEnvironment::fullEnvIsReady | ( | ) | const |
Returns whether the full environment class is ready (constructor has successfully been called).
Definition at line 210 of file Environment.C.
References m_fullEnvIsReady.
int QUESO::BaseEnvironment::fullRank | ( | ) | const |
Returns the process full rank.
Definition at line 222 of file Environment.C.
References m_fullRank.
Referenced by QUESO::GslVector::cwSetBeta(), QUESO::EnvironmentOptions::getMyOptionValues(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), QUESO::GslMatrix::mpiSum(), QUESO::OptimizerMonitor::print_header(), QUESO::OptimizerMonitor::print_iteration(), QUESO::InterpolationSurrogateIOASCII< V, M >::read(), QUESO::EnvironmentOptions::scanOptionsValues(), QUESO::GslVector::subReadContents(), QUESO::GslMatrix::subReadContents(), and QUESO::MpiComm::syncPrintDebugMsg().
std::string QUESO::BaseEnvironment::identifyingString | ( | ) | const |
Access function to private attribute m_identifyingString: identifying string.
Definition at line 448 of file Environment.C.
References QUESO::EnvOptionsValues::m_identifyingString, and m_optionsObj.
const MpiComm & QUESO::BaseEnvironment::inter0Comm | ( | ) | const |
Access function for MpiComm inter0-communicator.
Definition at line 267 of file Environment.C.
References m_inter0Comm, and queso_require_msg.
Referenced by QUESO::ComputeCovCorrBetweenScalarSequences(), and QUESO::ComputeCovCorrMatricesBetweenVectorSequences().
int QUESO::BaseEnvironment::inter0Rank | ( | ) | const |
Returns the process inter0 rank.
Definition at line 261 of file Environment.C.
References m_inter0Rank.
Referenced by QUESO::ComputeCovCorrBetweenScalarSequences(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::ComputeUnifiedGaussian2dKde(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), and QUESO::MpiComm::syncPrintDebugMsg().
bool QUESO::BaseEnvironment::isThereInputFile | ( | ) | const |
//TODO Not implemented? it is called in examples/validationCycle/tests_old/results_5_25/uqTgaEx4.h.
unsigned int QUESO::BaseEnvironment::numSubEnvironments | ( | ) | const |
Access function to the number of sub-environments.
Definition at line 288 of file Environment.C.
References QUESO::EnvOptionsValues::m_numSubEnvironments, m_optionsObj, and queso_require_msg.
Referenced by QUESO::ComputeUnifiedGaussian2dKde(), and QUESO::MiscCheckTheParallelEnvironment().
bool QUESO::BaseEnvironment::openInputFile | ( | const std::string & | fileName, |
const std::string & | fileType, | ||
const std::set< unsigned int > & | allowedSubEnvIds, | ||
FilePtrSetStruct & | filePtrSet | ||
) | const |
Opens an input file.
Definition at line 834 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), QUESO::FilePtrSetStruct::ifsVar, m_subDisplayFile, queso_error_msg, queso_require_greater_equal_msg, queso_require_msg, subDisplayFile(), subRank(), UQ_ENV_FILENAME_FOR_NO_INPUT_FILE, UQ_FILE_EXTENSION_FOR_HDF_FORMAT, and UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT.
Referenced by QUESO::GslVector::subReadContents(), and QUESO::GslMatrix::subReadContents().
bool QUESO::BaseEnvironment::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.
Definition at line 467 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), m_subDisplayFile, QUESO::FilePtrSetStruct::ofsVar, queso_error_msg, queso_require_greater_equal_msg, queso_require_msg, subDisplayFile(), subId(), subIdString(), subRank(), UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE, UQ_FILE_EXTENSION_FOR_HDF_FORMAT, and UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT.
Referenced by QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel(), QUESO::GslVector::subWriteContents(), and QUESO::GslMatrix::subWriteContents().
bool QUESO::BaseEnvironment::openUnifiedInputFile | ( | const std::string & | fileName, |
const std::string & | fileType, | ||
FilePtrSetStruct & | filePtrSet | ||
) | const |
Opens the unified input file.
Definition at line 928 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), QUESO::FilePtrSetStruct::ifsVar, m_subDisplayFile, queso_error_msg, queso_require_greater_equal_msg, queso_require_msg, subDisplayFile(), subRank(), UQ_ENV_FILENAME_FOR_NO_INPUT_FILE, UQ_FILE_EXTENSION_FOR_HDF_FORMAT, and UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT.
bool QUESO::BaseEnvironment::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.
Definition at line 666 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), m_subDisplayFile, QUESO::FilePtrSetStruct::ofsVar, queso_error_msg, queso_require_greater_equal_msg, queso_require_msg, subDisplayFile(), subRank(), UQ_FILE_EXTENSION_FOR_HDF_FORMAT, and UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT.
std::string QUESO::BaseEnvironment::optionsInputFileName | ( | ) | const |
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the user to QUESO.
Definition at line 307 of file Environment.C.
References m_optionsInputFileAccessState, and m_optionsInputFileName.
Referenced by QUESO::EnvironmentOptions::EnvironmentOptions(), QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::ExperimentModel(), QUESO::ExperimentModelOptions::ExperimentModelOptions(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel(), QUESO::GpmsaComputerModelOptions::GpmsaComputerModelOptions(), QUESO::GPMSAFactory< V, M >::GPMSAFactory(), QUESO::GPMSAOptions::GPMSAOptions(), QUESO::InfiniteDimensionalMCMCSamplerOptions::InfiniteDimensionalMCMCSamplerOptions(), QUESO::MetropolisHastingsSGOptions::MetropolisHastingsSGOptions(), QUESO::MonteCarloSGOptions::MonteCarloSGOptions(), QUESO::MLSamplingLevelOptions::scanOptionsValues(), QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel(), QUESO::SimulationModelOptions::SimulationModelOptions(), QUESO::StatisticalForwardProblemOptions::StatisticalForwardProblemOptions(), QUESO::StatisticalInverseProblem< P_V, P_M >::StatisticalInverseProblem(), and QUESO::StatisticalInverseProblemOptions::StatisticalInverseProblemOptions().
std::string QUESO::BaseEnvironment::platformName | ( | ) | const |
Access to the platform name.
Definition at line 442 of file Environment.C.
References m_optionsObj, and QUESO::EnvOptionsValues::m_platformName.
|
pure virtual |
Implemented in QUESO::FullEnvironment, and QUESO::EmptyEnvironment.
void QUESO::BaseEnvironment::resetIdentifyingString | ( | const std::string & | newString | ) |
Reset private attribute m_identifyingString with the value newString
.
Definition at line 454 of file Environment.C.
References QUESO::EnvOptionsValues::m_identifyingString, and m_optionsObj.
void QUESO::BaseEnvironment::resetSeed | ( | int | newSeedOption | ) |
Reset RNG seed.
Definition at line 429 of file Environment.C.
References m_rngObject, and QUESO::RngBase::resetSeed().
const RngBase * QUESO::BaseEnvironment::rngObject | ( | ) | const |
Access to the RNG object.
Definition at line 417 of file Environment.C.
References m_rngObject.
Referenced by QUESO::GslVector::cwSetBeta(), QUESO::GslVector::cwSetGamma(), QUESO::GslVector::cwSetGaussian(), QUESO::GslVector::cwSetInverseGamma(), QUESO::GslVector::cwSetUniform(), QUESO::InfiniteDimensionalGaussian::draw(), and QUESO::FiniteDistribution::sample().
void QUESO::BaseEnvironment::scanInputFileForMyOptions | ( | const boost::program_options::options_description & | optionsDesc | ) | const |
This method scans the input file provided by the user to QUESO.
It checks if no input file is passed and updates the private attribute m_allOptionsDesc, which keeps all the options.
Definition at line 345 of file Environment.C.
References m_allOptionsDesc, m_allOptionsMap, m_optionsInputFileName, queso_deprecated, queso_require_msg, and queso_require_not_equal_to_msg.
Referenced by QUESO::ExperimentModelOptions::scanOptionsValues(), QUESO::SimulationModelOptions::scanOptionsValues(), QUESO::GpmsaComputerModelOptions::scanOptionsValues(), QUESO::StatisticalForwardProblemOptions::scanOptionsValues(), QUESO::StatisticalInverseProblemOptions::scanOptionsValues(), QUESO::MonteCarloSGOptions::scanOptionsValues(), QUESO::EnvironmentOptions::scanOptionsValues(), and QUESO::MetropolisHastingsSGOptions::scanOptionsValues().
int QUESO::BaseEnvironment::seed | ( | ) | const |
Access to the RNG seed.
Definition at line 423 of file Environment.C.
References m_rngObject, and QUESO::RngBase::seed().
const MpiComm & QUESO::BaseEnvironment::selfComm | ( | ) | const |
Access function for MpiComm self-communicator.
Definition at line 254 of file Environment.C.
References m_selfComm, and queso_require_msg.
void QUESO::BaseEnvironment::setExceptionalCircumstance | ( | bool | value | ) | const |
Set an exceptional circumstance.
Definition at line 1071 of file Environment.C.
References m_exceptionalCircumstance.
void QUESO::BaseEnvironment::setOptionsInputFileAccessState | ( | bool | newState | ) | const |
Definition at line 318 of file Environment.C.
References m_optionsInputFileAccessState.
const MpiComm & QUESO::BaseEnvironment::subComm | ( | ) | const |
Access function for MpiComm sub communicator.
Definition at line 247 of file Environment.C.
References m_subComm, and queso_require_msg.
Referenced by QUESO::MiscCheckTheParallelEnvironment().
std::ofstream * QUESO::BaseEnvironment::subDisplayFile | ( | ) | const |
Access function for m_subDisplayFile (displays file on stream).
Definition at line 274 of file Environment.C.
References m_subDisplayFile.
Referenced by QUESO::AsciiTable< V, M >::AsciiTable(), QUESO::BaseJointPdf< V, M >::BaseJointPdf(), QUESO::BaseMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::BaseMatrixCovarianceFunction(), QUESO::BaseOneDGrid< T >::BaseOneDGrid(), QUESO::BaseScalarCdf< T >::BaseScalarCdf(), QUESO::BaseScalarCovarianceFunction< V, M >::BaseScalarCovarianceFunction(), QUESO::BaseVectorCdf< V, M >::BaseVectorCdf(), QUESO::BaseVectorMdf< V, M >::BaseVectorMdf(), QUESO::BaseVectorRealizer< V, M >::BaseVectorRealizer(), QUESO::BaseVectorRV< V, M >::BaseVectorRV(), QUESO::BetaJointPdf< V, M >::BetaJointPdf(), QUESO::BetaVectorRealizer< V, M >::BetaVectorRealizer(), QUESO::BetaVectorRV< V, M >::BetaVectorRV(), QUESO::GPMSAOptions::checkOptions(), QUESO::MLSamplingOptions::checkOptions(), QUESO::MLSamplingLevelOptions::checkOptions(), closeFile(), QUESO::ComputeConditionalGaussianVectorRV(), QUESO::ConcatenatedVectorRealizer< V, M >::ConcatenatedVectorRealizer(), QUESO::ConcatenatedVectorRV< V, M >::ConcatenatedVectorRV(), QUESO::GslVector::cwSetBeta(), QUESO::GslMatrix::determinant(), QUESO::EnvironmentOptions::EnvironmentOptions(), QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::ExperimentModel(), QUESO::ExperimentModelOptions::ExperimentModelOptions(), QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::ExperimentStorage(), QUESO::ExponentialMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::ExponentialMatrixCovarianceFunction(), QUESO::ExponentialScalarCovarianceFunction< V, M >::ExponentialScalarCovarianceFunction(), QUESO::FiniteDistribution::FiniteDistribution(), QUESO::GammaJointPdf< V, M >::GammaJointPdf(), QUESO::GammaVectorRealizer< V, M >::GammaVectorRealizer(), QUESO::GammaVectorRV< V, M >::GammaVectorRV(), QUESO::GaussianJointPdf< V, M >::GaussianJointPdf(), QUESO::GaussianVectorCdf< V, M >::GaussianVectorCdf(), QUESO::GaussianVectorMdf< V, M >::GaussianVectorMdf(), QUESO::GaussianVectorRealizer< V, M >::GaussianVectorRealizer(), QUESO::GaussianVectorRV< V, M >::GaussianVectorRV(), QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo(), QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmJointTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointTildeInfo(), QUESO::GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationInfo(), QUESO::GcmSimulationTildeInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationTildeInfo(), QUESO::GcmTotalInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmTotalInfo(), QUESO::GcmZInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZInfo(), QUESO::GcmZTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZTildeInfo(), QUESO::GenericMatrixCovarianceFunction< P_V, P_M, Q_V, Q_M >::GenericMatrixCovarianceFunction(), QUESO::GenericScalarCovarianceFunction< V, M >::GenericScalarCovarianceFunction(), QUESO::GenericVectorRealizer< V, M >::GenericVectorRealizer(), QUESO::GenericVectorRV< V, M >::GenericVectorRV(), QUESO::ExperimentModelOptions::getMyOptionValues(), QUESO::SimulationModelOptions::getMyOptionValues(), QUESO::GpmsaComputerModelOptions::getMyOptionValues(), QUESO::StatisticalForwardProblemOptions::getMyOptionValues(), QUESO::StatisticalInverseProblemOptions::getMyOptionValues(), QUESO::MonteCarloSGOptions::getMyOptionValues(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel(), QUESO::GpmsaComputerModelOptions::GpmsaComputerModelOptions(), QUESO::HessianCovMatricesTKGroup< V, M >::HessianCovMatricesTKGroup(), QUESO::horizontalDistance(), QUESO::GslMatrix::inverse(), QUESO::InverseGammaJointPdf< V, M >::InverseGammaJointPdf(), QUESO::InverseGammaVectorRealizer< V, M >::InverseGammaVectorRealizer(), QUESO::InverseGammaVectorRV< V, M >::InverseGammaVectorRV(), QUESO::GslMatrix::invertMultiply(), QUESO::InvLogitGaussianVectorRV< V, M >::InvLogitGaussianVectorRV(), QUESO::JeffreysJointPdf< V, M >::JeffreysJointPdf(), QUESO::JeffreysVectorRealizer< V, M >::JeffreysVectorRealizer(), QUESO::JeffreysVectorRV< V, M >::JeffreysVectorRV(), QUESO::GslMatrix::lnDeterminant(), QUESO::LogNormalJointPdf< V, M >::LogNormalJointPdf(), QUESO::LogNormalVectorRealizer< V, M >::LogNormalVectorRealizer(), QUESO::LogNormalVectorRV< V, M >::LogNormalVectorRV(), QUESO::MetropolisHastingsSG< P_V, P_M >::MetropolisHastingsSG(), QUESO::MetropolisHastingsSGOptions::MetropolisHastingsSGOptions(), QUESO::MLSampling< P_V, P_M >::MLSampling(), QUESO::ModelValidation< P_V, P_M, Q_V, Q_M >::ModelValidation(), QUESO::MonteCarloSGOptions::MonteCarloSGOptions(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), QUESO::PoweredJointPdf< V, M >::PoweredJointPdf(), QUESO::GslMatrix::rank(), QUESO::SampledScalarCdf< T >::SampledScalarCdf(), QUESO::SampledVectorCdf< V, M >::SampledVectorCdf(), QUESO::SampledVectorMdf< V, M >::SampledVectorMdf(), QUESO::ScaledCovMatrixTKGroup< V, M >::ScaledCovMatrixTKGroup(), QUESO::ExperimentModelOptions::scanOptionsValues(), QUESO::SimulationModelOptions::scanOptionsValues(), QUESO::GpmsaComputerModelOptions::scanOptionsValues(), QUESO::StatisticalForwardProblemOptions::scanOptionsValues(), QUESO::StatisticalInverseProblemOptions::scanOptionsValues(), QUESO::MonteCarloSGOptions::scanOptionsValues(), QUESO::MetropolisHastingsSGOptions::scanOptionsValues(), QUESO::SequentialVectorRealizer< V, M >::SequentialVectorRealizer(), QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel(), QUESO::SimulationModelOptions::SimulationModelOptions(), QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationStorage(), QUESO::StatisticalForwardProblemOptions::StatisticalForwardProblemOptions(), QUESO::StatisticalInverseProblem< P_V, P_M >::StatisticalInverseProblem(), QUESO::StatisticalInverseProblemOptions::StatisticalInverseProblemOptions(), QUESO::StdOneDGrid< T >::StdOneDGrid(), QUESO::StdScalarCdf< T >::StdScalarCdf(), QUESO::GslVector::subReadContents(), QUESO::GslMatrix::subReadContents(), QUESO::GslMatrix::svdSolve(), QUESO::TransformedScaledCovMatrixTKGroup< V, M >::TransformedScaledCovMatrixTKGroup(), QUESO::UniformJointPdf< V, M >::UniformJointPdf(), QUESO::UniformOneDGrid< T >::UniformOneDGrid(), QUESO::UniformVectorRealizer< V, M >::UniformVectorRealizer(), QUESO::UniformVectorRV< V, M >::UniformVectorRV(), QUESO::ValidationCycle< P_V, P_M, Q_V, Q_M >::ValidationCycle(), QUESO::VectorSet< V, M >::VectorSet(), QUESO::VectorSpace< V, M >::VectorSpace(), QUESO::VectorSubset< V, M >::VectorSubset(), QUESO::WignerJointPdf< V, M >::WignerJointPdf(), QUESO::WignerVectorRealizer< V, M >::WignerVectorRealizer(), and QUESO::WignerVectorRV< V, M >::WignerVectorRV().
std::string QUESO::BaseEnvironment::subDisplayFileName | ( | ) | const |
Access function for m_subDisplayFileName (displays filename on stream).
Definition at line 280 of file Environment.C.
References m_optionsObj, and QUESO::EnvOptionsValues::m_subDisplayFileName.
RawType_MPI_Group QUESO::BaseEnvironment::subGroup | ( | ) | const |
unsigned int QUESO::BaseEnvironment::subId | ( | ) | const |
Access function to the number of each sub-environment Id: m_subId.
Definition at line 295 of file Environment.C.
References m_subId.
Referenced by QUESO::MLSamplingLevelOptions::checkOptions(), QUESO::MhOptionsValues::checkOptions(), QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo(), QUESO::GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointInfo(), QUESO::GcmJointTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmJointTildeInfo(), QUESO::GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationInfo(), QUESO::GcmSimulationTildeInfo< S_V, S_M, P_V, P_M, Q_V, Q_M >::GcmSimulationTildeInfo(), QUESO::GcmZTildeInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GcmZTildeInfo(), QUESO::SimulationModelOptions::getMyOptionValues(), QUESO::GpmsaComputerModelOptions::getMyOptionValues(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel(), openOutputFile(), QUESO::SimulationModel< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationModel(), and QUESO::MpiComm::syncPrintDebugMsg().
const std::string & QUESO::BaseEnvironment::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.
Definition at line 301 of file Environment.C.
References m_subIdString.
Referenced by openOutputFile(), QUESO::Sampled1D1DFunction::printForMatlab(), QUESO::GslVector::subWriteContents(), and QUESO::GslMatrix::subWriteContents().
int QUESO::BaseEnvironment::subRank | ( | ) | const |
Access function for sub-rank.
Definition at line 241 of file Environment.C.
References m_subRank.
Referenced by closeFile(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), QUESO::MiscCheckTheParallelEnvironment(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), QUESO::GslVector::subReadContents(), QUESO::GslMatrix::subReadContents(), QUESO::GslVector::subWriteContents(), QUESO::GslMatrix::subWriteContents(), and QUESO::MpiComm::syncPrintDebugMsg().
unsigned int QUESO::BaseEnvironment::syncVerbosity | ( | ) | const |
Access function to private attribute m_syncVerbosity.
Definition at line 403 of file Environment.C.
References m_optionsObj, QUESO::EnvOptionsValues::m_syncVerbosity, and queso_require_msg.
Referenced by QUESO::MpiComm::syncPrintDebugMsg().
struct timeval QUESO::BaseEnvironment::timevalBegin | ( | ) | const |
Used to save the time when the combo `QUESO+user's application' started to run.
Definition at line 461 of file Environment.C.
int QUESO::BaseEnvironment::worldRank | ( | ) | const |
Returns the process world rank.
Definition at line 216 of file Environment.C.
References m_worldRank.
Referenced by QUESO::GslMatrix::chol(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), and QUESO::GslMatrix::internalSvd().
|
protected |
Definition at line 360 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), scanInputFileForMyOptions(), and ~BaseEnvironment().
|
protected |
Definition at line 361 of file Environment.h.
Referenced by allOptionsMap(), QUESO::FullEnvironment::FullEnvironment(), scanInputFileForMyOptions(), and ~BaseEnvironment().
|
protected |
Definition at line 379 of file Environment.h.
Referenced by basicPdfs(), QUESO::FullEnvironment::FullEnvironment(), and ~BaseEnvironment().
|
mutableprotected |
Definition at line 381 of file Environment.h.
Referenced by exceptionalCircumstance(), and setExceptionalCircumstance().
|
protected |
Definition at line 353 of file Environment.h.
Referenced by fullComm(), QUESO::FullEnvironment::FullEnvironment(), and ~BaseEnvironment().
|
protected |
Definition at line 355 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment().
|
protected |
Definition at line 350 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and fullEnvIsReady().
|
protected |
Definition at line 356 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment().
|
protected |
Definition at line 354 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), fullRank(), QUESO::FullEnvironment::readOptionsInputFile(), and ~BaseEnvironment().
|
protected |
Definition at line 373 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), inter0Comm(), and ~BaseEnvironment().
|
protected |
Definition at line 375 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment().
|
protected |
Definition at line 372 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment().
|
protected |
Definition at line 374 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and inter0Rank().
|
mutableprotected |
Definition at line 359 of file Environment.h.
Referenced by optionsInputFileName(), and setOptionsInputFileAccessState().
|
protected |
Definition at line 358 of file Environment.h.
Referenced by BaseEnvironment(), QUESO::FullEnvironment::FullEnvironment(), optionsInputFileName(), QUESO::FullEnvironment::readOptionsInputFile(), and scanInputFileForMyOptions().
|
protected |
Definition at line 383 of file Environment.h.
Referenced by checkingLevel(), displayVerbosity(), QUESO::FullEnvironment::FullEnvironment(), identifyingString(), numSubEnvironments(), platformName(), resetIdentifyingString(), subDisplayFileName(), and syncVerbosity().
|
protected |
Definition at line 378 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), resetSeed(), rngObject(), seed(), and ~BaseEnvironment().
|
protected |
Definition at line 370 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), selfComm(), and ~BaseEnvironment().
|
protected |
Definition at line 366 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), subComm(), and ~BaseEnvironment().
|
protected |
Definition at line 368 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment().
|
mutableprotected |
Definition at line 377 of file Environment.h.
Referenced by closeFile(), QUESO::FullEnvironment::FullEnvironment(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), subDisplayFile(), and ~BaseEnvironment().
|
protected |
Definition at line 365 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and subGroup().
|
protected |
Definition at line 363 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and subId().
|
protected |
Definition at line 364 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and subIdString().
|
protected |
Definition at line 367 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and subRank().
|
protected |
Definition at line 380 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and ~BaseEnvironment().
|
protected |
Definition at line 351 of file Environment.h.
Referenced by QUESO::FullEnvironment::FullEnvironment(), and worldRank().