queso-0.57.1
|
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... | |
BaseEnvironment (const std::string &passedOptionsInputFileName, EnvOptionsValues *alternativeOptionsValues) | |
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 same thing as fullRank() More... | |
int | fullRank () const |
Returns the rank of the MPI process in QUESO's full communicator. More... | |
const MpiComm & | fullComm () const |
Access function for the communicator that was passed to QUESO's environment. More... | |
RawType_MPI_Group | subGroup () const |
Access function for sub-group. More... | |
int | subRank () const |
Returns the rank of the MPI process in the sub-communicator subComm() More... | |
const MpiComm & | subComm () const |
Access function for each sub-environment's 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 communicator for processes with subRank() 0. 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 |
const boost::program_options::options_description & | allOptionsDesc () 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... | |
const GetPot & | input () const |
The GetPot input file parser. More... | |
virtual void | print (std::ostream &os) const =0 |
Protected Attributes | |
bool | m_fullEnvIsReady |
int | m_worldRank |
ScopedPtr< MpiComm >::Type | m_fullComm |
int | m_fullRank |
int | m_fullCommSize |
RawType_MPI_Group | m_fullGroup |
std::string | m_optionsInputFileName |
bool | m_optionsInputFileAccessState |
ScopedPtr < boost::program_options::options_description > ::Type | m_allOptionsDesc |
ScopedPtr < boost::program_options::variables_map > ::Type | m_allOptionsMap |
ScopedPtr< GetPot >::Type | m_input |
unsigned int | m_subId |
std::string | m_subIdString |
RawType_MPI_Group | m_subGroup |
ScopedPtr< MpiComm >::Type | m_subComm |
int | m_subRank |
int | m_subCommSize |
ScopedPtr< MpiComm >::Type | m_selfComm |
RawType_MPI_Group | m_inter0Group |
ScopedPtr< MpiComm >::Type | m_inter0Comm |
int | m_inter0Rank |
int | m_inter0CommSize |
ScopedPtr< std::ofstream >::Type | m_subDisplayFile |
ScopedPtr< RngBase >::Type | m_rngObject |
ScopedPtr< BasicPdfsBase >::Type | m_basicPdfs |
struct timeval | m_timevalBegin |
bool | m_exceptionalCircumstance |
ScopedPtr< EnvOptionsValues >::Type | 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 198 of file Environment.h.
QUESO::BaseEnvironment::BaseEnvironment | ( | const char * | passedOptionsInputFileName, |
EnvOptionsValues * | alternativeOptionsValues | ||
) |
Default constructor.
Definition at line 145 of file Environment.C.
References m_optionsInputFileName, and m_optionsObj.
QUESO::BaseEnvironment::BaseEnvironment | ( | const std::string & | passedOptionsInputFileName, |
EnvOptionsValues * | alternativeOptionsValues | ||
) |
Definition at line 184 of file Environment.C.
References m_optionsObj.
|
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 222 of file Environment.C.
References displayVerbosity(), m_fullRank, m_subDisplayFile, and m_timevalBegin.
const boost::program_options::options_description & QUESO::BaseEnvironment::allOptionsDesc | ( | ) | const |
Definition at line 375 of file Environment.C.
References m_allOptionsDesc.
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 386 of file Environment.C.
References m_allOptionsMap.
Referenced by QUESO::StatisticalInverseProblemOptions::getMyOptionValues(), QUESO::EnvironmentOptions::getMyOptionValues(), and QUESO::MetropolisHastingsSGOptions::getMyOptionValues().
const BasicPdfsBase * QUESO::BaseEnvironment::basicPdfs | ( | ) | const |
Access to Basic PDFs.
Definition at line 490 of file Environment.C.
References m_basicPdfs.
unsigned int QUESO::BaseEnvironment::checkingLevel | ( | ) | const |
Access function to private attribute m_checkingLevel.
Definition at line 464 of file Environment.C.
References m_optionsObj.
Referenced by QUESO::TeuchosMatrix::inverse(), 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 1084 of file Environment.C.
References QUESO::FilePtrSetStruct::h5Var, QUESO::FilePtrSetStruct::ifsVar, m_subDisplayFile, QUESO::FilePtrSetStruct::ofsVar, subDisplayFile(), and subRank().
Referenced by QUESO::GslVector::subReadContents(), QUESO::TeuchosVector::subReadContents(), QUESO::TeuchosMatrix::subReadContents(), QUESO::GslMatrix::subReadContents(), QUESO::GslVector::subWriteContents(), QUESO::TeuchosVector::subWriteContents(), QUESO::TeuchosMatrix::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 450 of file Environment.C.
References m_optionsObj.
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::BIP_routine(), QUESO::ConcatenatedVectorRealizer< V, M >::ConcatenatedVectorRealizer(), QUESO::ConcatenatedVectorRV< V, M >::ConcatenatedVectorRV(), QUESO::FullEnvironment::construct(), QUESO::GslVector::cwSetBeta(), QUESO::TeuchosVector::cwSetBeta(), QUESO::TeuchosMatrix::determinant(), QUESO::GslMatrix::determinant(), 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::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::HessianCovMatricesTKGroup< V, M >::HessianCovMatricesTKGroup(), QUESO::horizontalDistance(), QUESO::TeuchosMatrix::inverse(), QUESO::GslMatrix::inverse(), QUESO::InverseGammaJointPdf< V, M >::InverseGammaJointPdf(), QUESO::InverseGammaVectorRealizer< V, M >::InverseGammaVectorRealizer(), QUESO::InverseGammaVectorRV< V, M >::InverseGammaVectorRV(), QUESO::TeuchosMatrix::invertMultiply(), QUESO::GslMatrix::invertMultiply(), QUESO::InvLogitGaussianVectorRV< V, M >::InvLogitGaussianVectorRV(), QUESO::JeffreysJointPdf< V, M >::JeffreysJointPdf(), QUESO::JeffreysVectorRealizer< V, M >::JeffreysVectorRealizer(), QUESO::JeffreysVectorRV< V, M >::JeffreysVectorRV(), QUESO::TeuchosMatrix::lnDeterminant(), QUESO::GslMatrix::lnDeterminant(), QUESO::LogNormalJointPdf< V, M >::LogNormalJointPdf(), QUESO::LogNormalVectorRealizer< V, M >::LogNormalVectorRealizer(), QUESO::LogNormalVectorRV< V, M >::LogNormalVectorRV(), QUESO::MetropolisAdjustedLangevinTK< V, M >::MetropolisAdjustedLangevinTK(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), QUESO::PoweredJointPdf< V, M >::PoweredJointPdf(), QUESO::TeuchosMatrix::rank(), 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::StdOneDGrid< T >::StdOneDGrid(), QUESO::StdScalarCdf< T >::StdScalarCdf(), QUESO::TeuchosMatrix::svdSolve(), 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 1143 of file Environment.C.
References m_exceptionalCircumstance.
const MpiComm & QUESO::BaseEnvironment::fullComm | ( | ) | const |
Access function for the communicator that was passed to QUESO's environment.
The 'full' communicator is the MPI communicator that the user passed when creating the QUESO FullEnvironment. This is usually MPI_COMM_WORLD, but the user is permitted to pass any MPI communicator smaller than MPI_COMM_WORLD.
Definition at line 274 of file Environment.C.
References m_fullComm.
Referenced by QUESO::FullEnvironment::construct(), 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 256 of file Environment.C.
References m_fullEnvIsReady.
int QUESO::BaseEnvironment::fullRank | ( | ) | const |
Returns the rank of the MPI process in QUESO's full communicator.
Returns the rank of the MPI process in the communicator returned by fullComm().
See fullComm() for what the full communicator is.
Definition at line 268 of file Environment.C.
References m_fullRank.
Referenced by QUESO::GslVector::cwSetBeta(), QUESO::TeuchosVector::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::TeuchosVector::subReadContents(), QUESO::TeuchosMatrix::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 502 of file Environment.C.
References m_optionsObj.
const GetPot & QUESO::BaseEnvironment::input | ( | ) | const |
The GetPot input file parser.
Definition at line 1149 of file Environment.C.
References m_input.
Referenced by QUESO::BaseScalarFunction< V, M >::BaseScalarFunction(), QUESO::EnvOptionsValues::EnvOptionsValues(), QUESO::MLSamplingLevelOptions::getAllOptions(), QUESO::InfiniteDimensionalMCMCSamplerOptions::InfiniteDimensionalMCMCSamplerOptions(), QUESO::MLSamplingOptions::MLSamplingOptions(), QUESO::operator<<(), QUESO::OptimizerOptions::OptimizerOptions(), QUESO::GPMSAOptions::parse(), and QUESO::SipOptionsValues::SipOptionsValues().
const MpiComm & QUESO::BaseEnvironment::inter0Comm | ( | ) | const |
Access function for MpiComm communicator for processes with subRank() 0.
Definition at line 313 of file Environment.C.
References m_inter0Comm.
Referenced by QUESO::ComputeCovCorrBetweenScalarSequences(), and QUESO::ComputeCovCorrMatricesBetweenVectorSequences().
int QUESO::BaseEnvironment::inter0Rank | ( | ) | const |
Returns the process inter0 rank.
Definition at line 307 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 335 of file Environment.C.
References m_optionsObj.
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 896 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), QUESO::FilePtrSetStruct::h5Var, QUESO::FilePtrSetStruct::ifsVar, m_subDisplayFile, subDisplayFile(), and subRank().
Referenced by QUESO::GslVector::subReadContents(), QUESO::TeuchosVector::subReadContents(), QUESO::TeuchosMatrix::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 521 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), QUESO::FilePtrSetStruct::h5Var, m_subDisplayFile, QUESO::FilePtrSetStruct::ofsVar, subDisplayFile(), subId(), subIdString(), and subRank().
Referenced by QUESO::GslVector::subWriteContents(), QUESO::TeuchosVector::subWriteContents(), QUESO::TeuchosMatrix::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 991 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), QUESO::FilePtrSetStruct::h5Var, QUESO::FilePtrSetStruct::ifsVar, m_subDisplayFile, subDisplayFile(), and subRank().
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 726 of file Environment.C.
References QUESO::CheckFilePath(), displayVerbosity(), QUESO::FilePtrSetStruct::h5Var, m_subDisplayFile, QUESO::FilePtrSetStruct::ofsVar, subDisplayFile(), and subRank().
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 354 of file Environment.C.
References m_optionsInputFileAccessState, and m_optionsInputFileName.
Referenced by QUESO::EnvironmentOptions::EnvironmentOptions(), QUESO::GPMSAFactory< V, M >::GPMSAFactory(), QUESO::InfiniteDimensionalMCMCSampler::InfiniteDimensionalMCMCSampler(), QUESO::InfiniteDimensionalMCMCSamplerOptions::InfiniteDimensionalMCMCSamplerOptions(), QUESO::MetropolisHastingsSGOptions::MetropolisHastingsSGOptions(), QUESO::GPMSAOptions::parse(), QUESO::MLSamplingLevelOptions::scanOptionsValues(), 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 496 of file Environment.C.
References m_optionsObj.
|
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 508 of file Environment.C.
References m_optionsObj.
void QUESO::BaseEnvironment::resetSeed | ( | int | newSeedOption | ) |
Reset RNG seed.
Definition at line 483 of file Environment.C.
References m_rngObject.
const RngBase * QUESO::BaseEnvironment::rngObject | ( | ) | const |
Access to the RNG object.
Definition at line 471 of file Environment.C.
References m_rngObject.
Referenced by QUESO::InfiniteDimensionalMCMCSampler::_metropolis_hastings(), QUESO::GslVector::cwSetBeta(), QUESO::TeuchosVector::cwSetBeta(), QUESO::GslVector::cwSetGamma(), QUESO::TeuchosVector::cwSetGamma(), QUESO::GslVector::cwSetGaussian(), QUESO::TeuchosVector::cwSetGaussian(), QUESO::GslVector::cwSetInverseGamma(), QUESO::TeuchosVector::cwSetInverseGamma(), QUESO::GslVector::cwSetUniform(), QUESO::TeuchosVector::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 397 of file Environment.C.
References m_allOptionsDesc, m_allOptionsMap, m_optionsInputFileName, and QUESO::queso_require_not_equal_to_msg.
Referenced by QUESO::StatisticalInverseProblemOptions::scanOptionsValues(), QUESO::EnvironmentOptions::scanOptionsValues(), and QUESO::MetropolisHastingsSGOptions::scanOptionsValues().
int QUESO::BaseEnvironment::seed | ( | ) | const |
Access to the RNG seed.
Definition at line 477 of file Environment.C.
References m_rngObject.
const MpiComm & QUESO::BaseEnvironment::selfComm | ( | ) | const |
Access function for MpiComm self-communicator.
This communicator is exactly MPI_COMM_SELF.
Definition at line 300 of file Environment.C.
References m_selfComm.
void QUESO::BaseEnvironment::setExceptionalCircumstance | ( | bool | value | ) | const |
Set an exceptional circumstance.
Definition at line 1136 of file Environment.C.
References m_exceptionalCircumstance.
void QUESO::BaseEnvironment::setOptionsInputFileAccessState | ( | bool | newState | ) | const |
Definition at line 365 of file Environment.C.
References m_optionsInputFileAccessState.
const MpiComm & QUESO::BaseEnvironment::subComm | ( | ) | const |
Access function for each sub-environment's communicator.
Let's say QUESO was passed a fullComm() communicator of size N. The ranks of each process in this communicator are:
0 1 2 ... N-2 N-1
If the user asks for M sub-environments (chains) then, assuming M divides N, QUESO partitions the processes in the fullComm() communicator into M sub-communicators like so:
Sub-environment 0 contains processes with fullRank() 0 1 ... M-1
Sub-environment 1 contains processes with fullRank() M M+1 ... 2M-1
et cetera
Sub-environment M-1 contains processes with fullRank() N-M N-M+1 ... N-1
subComm() returns the sub-communicator corresponding to the sub-environment the calling MPI process belongs to. For example, if I am an MPI process calling this function and I live in sub-environment k
, then this method returns the sub-communicator for sub-environment k.
Definition at line 293 of file Environment.C.
References m_subComm.
Referenced by QUESO::VectorFunctionSynchronizer< P_V, P_M, Q_V, Q_M >::callFunction(), and QUESO::MiscCheckTheParallelEnvironment().
std::ofstream * QUESO::BaseEnvironment::subDisplayFile | ( | ) | const |
Access function for m_subDisplayFile (displays file on stream).
Definition at line 320 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::BIP_routine(), QUESO::MLSamplingOptions::checkOptions(), QUESO::GPMSAOptions::checkOptions(), QUESO::MLSamplingLevelOptions::checkOptions(), closeFile(), QUESO::ComputeConditionalGaussianVectorRV(), QUESO::ConcatenatedVectorRealizer< V, M >::ConcatenatedVectorRealizer(), QUESO::ConcatenatedVectorRV< V, M >::ConcatenatedVectorRV(), QUESO::GslVector::cwSetBeta(), QUESO::TeuchosVector::cwSetBeta(), QUESO::TeuchosMatrix::determinant(), QUESO::GslMatrix::determinant(), QUESO::EnvironmentOptions::EnvironmentOptions(), 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::MLSampling< P_V, P_M >::generateSequence_Step09_all(), 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::StatisticalInverseProblemOptions::getMyOptionValues(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), QUESO::HessianCovMatricesTKGroup< V, M >::HessianCovMatricesTKGroup(), QUESO::horizontalDistance(), QUESO::if(), QUESO::InfiniteDimensionalMCMCSampler::InfiniteDimensionalMCMCSampler(), QUESO::MonteCarloSG< P_V, P_M, Q_V, Q_M >::internGenerateSequence(), QUESO::TeuchosMatrix::inverse(), QUESO::GslMatrix::inverse(), QUESO::InverseGammaJointPdf< V, M >::InverseGammaJointPdf(), QUESO::InverseGammaVectorRealizer< V, M >::InverseGammaVectorRealizer(), QUESO::InverseGammaVectorRV< V, M >::InverseGammaVectorRV(), QUESO::TeuchosMatrix::invertMultiply(), QUESO::GslMatrix::invertMultiply(), QUESO::InvLogitGaussianVectorRV< V, M >::InvLogitGaussianVectorRV(), QUESO::JeffreysJointPdf< V, M >::JeffreysJointPdf(), QUESO::JeffreysVectorRealizer< V, M >::JeffreysVectorRealizer(), QUESO::JeffreysVectorRV< V, M >::JeffreysVectorRV(), QUESO::TeuchosMatrix::lnDeterminant(), QUESO::GslMatrix::lnDeterminant(), QUESO::LogNormalJointPdf< V, M >::LogNormalJointPdf(), QUESO::LogNormalVectorRealizer< V, M >::LogNormalVectorRealizer(), QUESO::LogNormalVectorRV< V, M >::LogNormalVectorRV(), QUESO::MetropolisAdjustedLangevinTK< V, M >::MetropolisAdjustedLangevinTK(), 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::MonteCarloSG< P_V, P_M, Q_V, Q_M >::MonteCarloSG(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), QUESO::PoweredJointPdf< V, M >::PoweredJointPdf(), QUESO::TeuchosMatrix::rank(), QUESO::GslMatrix::rank(), QUESO::SampledScalarCdf< T >::SampledScalarCdf(), QUESO::SampledVectorCdf< V, M >::SampledVectorCdf(), QUESO::SampledVectorMdf< V, M >::SampledVectorMdf(), QUESO::ScaledCovMatrixTKGroup< V, M >::ScaledCovMatrixTKGroup(), QUESO::StatisticalInverseProblemOptions::scanOptionsValues(), QUESO::MetropolisHastingsSGOptions::scanOptionsValues(), QUESO::SequentialVectorRealizer< V, M >::SequentialVectorRealizer(), QUESO::StatisticalForwardProblem< P_V, P_M, Q_V, Q_M >::StatisticalForwardProblem(), QUESO::StatisticalInverseProblem< P_V, P_M >::StatisticalInverseProblem(), QUESO::StatisticalInverseProblemOptions::StatisticalInverseProblemOptions(), QUESO::StdOneDGrid< T >::StdOneDGrid(), QUESO::StdScalarCdf< T >::StdScalarCdf(), QUESO::GslVector::subReadContents(), QUESO::TeuchosVector::subReadContents(), QUESO::TeuchosMatrix::subReadContents(), QUESO::GslMatrix::subReadContents(), QUESO::TeuchosMatrix::svdSolve(), 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 327 of file Environment.C.
References m_optionsObj.
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 342 of file Environment.C.
References m_subId.
Referenced by QUESO::MLSamplingLevelOptions::checkOptions(), QUESO::MhOptionsValues::checkOptions(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), openOutputFile(), 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 348 of file Environment.C.
References m_subIdString.
Referenced by openOutputFile(), QUESO::Sampled1D1DFunction::printForMatlab(), QUESO::GslVector::subWriteContents(), QUESO::TeuchosVector::subWriteContents(), QUESO::TeuchosMatrix::subWriteContents(), and QUESO::GslMatrix::subWriteContents().
int QUESO::BaseEnvironment::subRank | ( | ) | const |
Returns the rank of the MPI process in the sub-communicator subComm()
Example, if the calling MPI process has fullRank() equal to 3, the size of fullComm() is 6, and the user asked for two sub-environments, then this method will return 0. Here's why.
fullComm() has MPI processes with these ranks: 0 1 2 3 4 5
QUESO divides the first three (ranks 0, 1, 2) of these into a sub-communicator for sub-environment 0. Inside the sub-communicator their ranks are 0, 1, 2, respectively.
QUESO divides the second three (ranks 3, 4, 5) of these into a sub-communicator for sub-environment 1. Inside the sub-communicator their ranks are 0, 1, 2, respectively.
It should be clear, now, that if fullRank() is 3 then subRank() is 0.
Definition at line 287 of file Environment.C.
References m_subRank.
Referenced by closeFile(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), QUESO::MiscCheckTheParallelEnvironment(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), QUESO::GslVector::subReadContents(), QUESO::TeuchosVector::subReadContents(), QUESO::TeuchosMatrix::subReadContents(), QUESO::GslMatrix::subReadContents(), QUESO::GslVector::subWriteContents(), QUESO::TeuchosVector::subWriteContents(), QUESO::TeuchosMatrix::subWriteContents(), QUESO::GslMatrix::subWriteContents(), and QUESO::MpiComm::syncPrintDebugMsg().
unsigned int QUESO::BaseEnvironment::syncVerbosity | ( | ) | const |
Access function to private attribute m_syncVerbosity.
Definition at line 457 of file Environment.C.
References m_optionsObj.
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 515 of file Environment.C.
int QUESO::BaseEnvironment::worldRank | ( | ) | const |
Returns the same thing as fullRank()
This is the same thing as fullRank(), since QUESO's 'world' communicator is not MPI_COMM_WORLD, but the communicator that user passed to it when creating the environment.
Definition at line 262 of file Environment.C.
References m_worldRank.
Referenced by QUESO::MetropolisHastingsSG< P_V, P_M >::alpha(), QUESO::TeuchosMatrix::chol(), QUESO::GslMatrix::chol(), QUESO::ComputeCovCorrMatricesBetweenVectorSequences(), QUESO::MetropolisHastingsSGOptions::getMyOptionValues(), QUESO::GslMatrix::internalSvd(), and QUESO::ScalarSequence< T >::subInterQuantileRange().
|
protected |
Definition at line 450 of file Environment.h.
Referenced by allOptionsDesc(), QUESO::FullEnvironment::construct(), and scanInputFileForMyOptions().
|
protected |
Definition at line 451 of file Environment.h.
Referenced by allOptionsMap(), QUESO::FullEnvironment::construct(), and scanInputFileForMyOptions().
|
protected |
Definition at line 471 of file Environment.h.
Referenced by basicPdfs(), and QUESO::FullEnvironment::construct().
|
mutableprotected |
Definition at line 473 of file Environment.h.
Referenced by exceptionalCircumstance(), and setExceptionalCircumstance().
Definition at line 442 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and fullComm().
|
protected |
Definition at line 444 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct().
|
protected |
Definition at line 439 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and fullEnvIsReady().
|
protected |
Definition at line 445 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct().
|
protected |
Definition at line 443 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), fullRank(), QUESO::FullEnvironment::readOptionsInputFile(), and ~BaseEnvironment().
|
protected |
Definition at line 453 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and input().
Definition at line 465 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and inter0Comm().
|
protected |
Definition at line 467 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct().
|
protected |
Definition at line 464 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct().
|
protected |
Definition at line 466 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and inter0Rank().
|
mutableprotected |
Definition at line 448 of file Environment.h.
Referenced by optionsInputFileName(), and setOptionsInputFileAccessState().
|
protected |
Definition at line 447 of file Environment.h.
Referenced by BaseEnvironment(), QUESO::FullEnvironment::construct(), optionsInputFileName(), QUESO::FullEnvironment::readOptionsInputFile(), and scanInputFileForMyOptions().
|
protected |
Definition at line 475 of file Environment.h.
Referenced by BaseEnvironment(), checkingLevel(), QUESO::FullEnvironment::construct(), displayVerbosity(), identifyingString(), numSubEnvironments(), platformName(), resetIdentifyingString(), subDisplayFileName(), and syncVerbosity().
Definition at line 470 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), resetSeed(), rngObject(), and seed().
Definition at line 462 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and selfComm().
Definition at line 458 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and subComm().
|
protected |
Definition at line 460 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct().
|
mutableprotected |
Definition at line 469 of file Environment.h.
Referenced by closeFile(), QUESO::FullEnvironment::construct(), openInputFile(), openOutputFile(), openUnifiedInputFile(), openUnifiedOutputFile(), subDisplayFile(), and ~BaseEnvironment().
|
protected |
Definition at line 457 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and subGroup().
|
protected |
Definition at line 455 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and subId().
|
protected |
Definition at line 456 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and subIdString().
|
protected |
Definition at line 459 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and subRank().
|
protected |
Definition at line 472 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and ~BaseEnvironment().
|
protected |
Definition at line 440 of file Environment.h.
Referenced by QUESO::FullEnvironment::construct(), and worldRank().