25 #include <boost/program_options.hpp>
27 #include <queso/queso.h>
28 #include <queso/Environment.h>
29 #include <queso/EnvironmentOptions.h>
30 #include <queso/RngGsl.h>
31 #include <queso/RngBoost.h>
32 #include <queso/BasicPdfsGsl.h>
33 #include <queso/BasicPdfsBoost.h>
34 #include <queso/Miscellaneous.h>
41 #include <queso/asserts.h>
52 os <<
"------------------------------------------------------------------------------------------" ;
53 os <<
"--------------------" << std::endl;
54 os <<
"QUESO Library: Version = " << QUESO_LIB_VERSION;
57 os << QUESO_LIB_RELEASE << std::endl << std::endl;
59 os <<
"Build Date = " << QUESO_BUILD_DATE << std::endl;
60 os <<
"Build Host = " << QUESO_BUILD_HOST << std::endl;
61 os <<
"Build User = " << QUESO_BUILD_USER << std::endl;
62 os <<
"Build Arch = " << QUESO_BUILD_ARCH << std::endl;
63 os <<
"Build Rev = " << QUESO_BUILD_VERSION << std::endl << std::endl;
65 os <<
"C++ Config = " << QUESO_CXX <<
" " << QUESO_CXXFLAGS << std::endl;
67 os <<
"Trilinos DIR = " << QUESO_TRILINOS_DIR << std::endl;
68 os <<
"GSL Libs = " << QUESO_GSL_DIR << std::endl;
69 os <<
"GRVY DIR = " << QUESO_GRVY_DIR << std::endl;
70 os <<
"GLPK DIR = " << QUESO_GLPK_DIR << std::endl;
71 os <<
"HDF5 DIR = " << QUESO_HDF5_DIR << std::endl;
72 os <<
"------------------------------------------------------------------------------------------" ;
73 os <<
"--------------------" << std::endl;
92 int major_version = 0;
93 int minor_version = 0;
94 int micro_version = 0;
96 #ifdef QUESO_MAJOR_VERSION
97 major_version = QUESO_MAJOR_VERSION;
100 #ifdef QUESO_MINOR_VERSION
101 minor_version = QUESO_MINOR_VERSION;
104 #ifdef QUESO_MICRO_VERSION
105 micro_version = QUESO_MICRO_VERSION;
108 return(major_version*10000 + minor_version*100 + micro_version);
133 const char* passedOptionsInputFileName,
136 m_fullEnvIsReady (false),
141 m_optionsInputFileName (
""),
142 m_optionsInputFileAccessState(true),
143 m_allOptionsDesc (NULL),
144 m_allOptionsMap (NULL),
151 m_inter0CommSize (1),
152 m_subDisplayFile (NULL),
155 m_exceptionalCircumstance (false),
156 m_optionsObj (alternativeOptionsValues)
168 struct timeval timevalNow;
170 gettimeofday(&timevalNow, NULL);
176 <<
"Total run time = " << timevalNow.tv_sec -
m_timevalBegin.tv_sec
182 std::cout <<
"Ending run at " << ctime(&timevalNow.tv_sec)
183 <<
"Total run time = " << timevalNow.tv_sec -
m_timevalBegin.tv_sec
325 #ifdef UQ_USES_COMMAND_LINE_OPTIONS
326 const boost::program_options::options_description&
327 BaseEnvironment::allOptionsDesc()
const
335 boost::program_options::variables_map&
349 #ifdef UQ_USES_COMMAND_LINE_OPTIONS
361 #ifdef QUESO_MEMORY_DEBUGGING
362 std::cout <<
"Entering BaseEnv::scanInputFileForMyOptions()" << std::endl;
375 #ifdef QUESO_MEMORY_DEBUGGING
376 std::cout <<
"in BaseEnv::scanInputFileForMyOptions(), before store(a)" << std::endl;
381 #ifdef QUESO_MEMORY_DEBUGGING
382 std::cout <<
"in BaseEnv::scanInputFileForMyOptions(), after store(a)" << std::endl;
388 #ifdef QUESO_MEMORY_DEBUGGING
389 std::cout <<
"Leaving BaseEnv::scanInputFileForMyOptions()" << std::endl;
463 return m_timevalBegin;
468 const std::string& baseFileName,
469 const std::string& inputFileType,
470 const std::set<unsigned int>& allowedSubEnvIds,
474 std::string fileType(inputFileType);
475 #ifdef QUESO_HAS_HDF5
480 *this->
subDisplayFile() <<
"WARNING in BaseEnvironment::openOutputFile()"
482 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
488 std::cerr <<
"WARNING in BaseEnvironment::openOutputFile()"
490 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
499 bool returnValue =
true;
502 (allowedSubEnvIds.find(this->subId()) == allowedSubEnvIds.end() )) {
505 <<
", subId = " << this->
subId()
506 <<
": no output file opened with base name '" << baseFileName <<
"." << fileType
508 <<
", writeOver = " << writeOver
519 <<
", subId = " << this->
subId()
520 <<
": opening output file with base name '" << baseFileName <<
"." << fileType
522 <<
", writeOver = " << writeOver
528 std::cout <<
"In BaseEnvironment::openOutputFile()"
529 <<
": opening output file with base name '" << baseFileName <<
"." << fileType
531 <<
", writeOver = " << writeOver
542 <<
", subId = " << this->
subId()
543 <<
", trying to open output file with base name '" << baseFileName <<
"." << fileType
545 <<
", writeOver = " << writeOver
546 <<
": calling CheckFilePath()..."
552 <<
", subId = " << this->
subId()
553 <<
", trying to open output file with base name '" << baseFileName <<
"." << fileType
555 <<
", writeOver = " << writeOver
556 <<
": returned from CheckFilePath() with irtrn = " << irtrn
567 filePtrSet.
ofsVar =
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
568 std::ofstream::out | std::ofstream::trunc);
578 <<
": just opened output file with base name '" << baseFileName <<
"." << fileType
580 <<
", writeOver = " << writeOver
581 <<
", options 'out|trunc'"
582 <<
", osfvar = " << filePtrSet.
ofsVar
593 filePtrSet.
ofsVar =
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
595 std::cout <<
"filePtrSet.ofsVar(1) = " << filePtrSet.
ofsVar << std::endl;
596 if (filePtrSet.
ofsVar) std::cout <<
"filePtrSet.ofsVar(1)->is_open() = " << filePtrSet.
ofsVar->is_open() << std::endl;
600 filePtrSet.
ofsVar =
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
601 std::ofstream::out | std::ofstream::app);
611 <<
": just opened output file with base name '" << baseFileName <<
"." << fileType
613 <<
", writeOver = " << writeOver
614 <<
", options 'out|in|app'"
615 <<
", osfvar = " << filePtrSet.
ofsVar
622 if ((filePtrSet.
ofsVar == NULL ) ||
623 (filePtrSet.
ofsVar->is_open() ==
false)) {
626 filePtrSet.
ofsVar =
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
627 std::ofstream::out | std::ofstream::trunc);
630 <<
": just opened output file with base name '" << baseFileName <<
"." << fileType
632 <<
", writeOver = " << writeOver
633 <<
", options 'out|trunc'"
634 <<
", osfvar = " << filePtrSet.
ofsVar
640 if (filePtrSet.
ofsVar != NULL) {
643 <<
", subId = " << this->
subId()
644 <<
": succeeded on opening output file with base name '" << baseFileName <<
"." << fileType
646 <<
", writeOver = " << writeOver
651 std::cerr <<
"In BaseEnvironment::openOutputFile()"
652 <<
": failed to open output file with base name '" << baseFileName <<
"." << fileType
669 const std::string& baseFileName,
670 const std::string& inputFileType,
674 std::string fileType(inputFileType);
675 #ifdef QUESO_HAS_HDF5
680 *this->
subDisplayFile() <<
"WARNING in BaseEnvironment::openUnifiedOutputFile()"
682 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
688 std::cerr <<
"WARNING in BaseEnvironment::openUnifiedOutputFile()"
690 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
699 bool returnValue =
true;
701 if (baseFileName ==
".") {
703 *this->
subDisplayFile() <<
"In BaseEnvironment::openUnifiedOutputFile()"
704 <<
": no unified output file opened with base name '" << baseFileName <<
"." << fileType
706 <<
", writeOver = " << writeOver
716 *this->
subDisplayFile() <<
"In BaseEnvironment::openUnifiedOutputFile()"
717 <<
": opening unified output file with base name '" << baseFileName <<
"." << fileType
719 <<
", writeOver = " << writeOver
727 std::cout <<
"In BaseEnvironment::openUnifiedOutputFile()"
728 <<
": opening output file with base name '" << baseFileName <<
"." << fileType
730 <<
", writeOver = " << writeOver
738 int irtrn =
CheckFilePath((baseFileName+
"."+fileType).c_str());
747 filePtrSet.
ofsVar =
new std::ofstream((baseFileName+
"."+fileType).c_str(),
748 std::ofstream::out | std::ofstream::trunc);
750 #ifdef QUESO_HAS_HDF5
752 filePtrSet.h5Var = H5Fcreate((baseFileName+
"."+fileType).c_str(),
762 *this->
subDisplayFile() <<
"In BaseEnvironment::openUnifiedOutputFile()"
763 <<
": just opened output file with base name '" << baseFileName <<
"." << fileType
765 <<
", writeOver = " << writeOver
766 <<
", options 'out|trunc'"
767 <<
", osfvar = " << filePtrSet.
ofsVar
778 filePtrSet.
ofsVar =
new std::ofstream((baseFileName+
"."+fileType).c_str(),
779 std::ofstream::out | std::ofstream::app);
781 #ifdef QUESO_HAS_HDF5
783 filePtrSet.h5Var = H5Fcreate((baseFileName+
"."+fileType).c_str(),
797 *this->
subDisplayFile() <<
"In BaseEnvironment::openUnifiedOutputFile()"
798 <<
": just opened output file with base name '" << baseFileName <<
"." << fileType
800 <<
", writeOver = " << writeOver
801 <<
", options 'out|in|app'"
802 <<
", osfvar = " << filePtrSet.
ofsVar
805 if ((filePtrSet.
ofsVar == NULL ) ||
806 (filePtrSet.
ofsVar->is_open() ==
false)) {
808 std::cout <<
"Retrying 2..." << std::endl;
811 filePtrSet.
ofsVar =
new std::ofstream((baseFileName+
"."+fileType).c_str(),
812 std::ofstream::out | std::ofstream::trunc);
814 *this->
subDisplayFile() <<
"In BaseEnvironment::openUnifiedOutputFile()"
815 <<
": just opened output file with base name '" << baseFileName <<
"." << fileType
817 <<
", writeOver = " << writeOver
818 <<
", options 'out|trunc'"
819 <<
", osfvar = " << filePtrSet.
ofsVar
824 if (filePtrSet.
ofsVar == NULL) {
825 std::cerr <<
"In BaseEnvironment::openUnifiedOutputFile()"
826 <<
": failed to open unified output file with base name '" << baseFileName <<
"." << fileType
839 const std::string& baseFileName,
840 const std::string& inputFileType,
841 const std::set<unsigned int>& allowedSubEnvIds,
844 std::string fileType(inputFileType);
845 #ifdef QUESO_HAS_HDF5
850 *this->
subDisplayFile() <<
"WARNING in BaseEnvironment::openInputFile()"
852 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
858 std::cerr <<
"WARNING in BaseEnvironment::openInputFile()"
860 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
869 bool returnValue =
true;
872 (allowedSubEnvIds.find(this->subId()) == allowedSubEnvIds.end() )) {
875 <<
": no input file opened with base name '" << baseFileName <<
"." << fileType
887 <<
": opening input file with base name '" << baseFileName <<
"." << fileType
897 int irtrn =
CheckFilePath((baseFileName+
"."+fileType).c_str());
902 filePtrSet.
ifsVar =
new std::ifstream((baseFileName+
"."+fileType).c_str(),
904 if ((filePtrSet.
ifsVar == NULL) || (filePtrSet.
ifsVar->is_open() ==
false)) {
905 std::cerr <<
"In BaseEnvironment::openInputFile()"
906 <<
": failed to open input file with base name '" << baseFileName <<
"." << fileType
912 #ifdef QUESO_HAS_HDF5
914 filePtrSet.h5Var = H5Fopen((baseFileName+
"."+fileType).c_str(),
934 const std::string& baseFileName,
935 const std::string& inputFileType,
938 std::string fileType(inputFileType);
939 #ifdef QUESO_HAS_HDF5
944 *this->
subDisplayFile() <<
"WARNING in BaseEnvironment::openUnifiedInputFile()"
946 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
952 std::cerr <<
"WARNING in BaseEnvironment::openUnifiedInputFile()"
954 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
963 bool returnValue =
true;
967 *this->
subDisplayFile() <<
"In BaseEnvironment::openUnifiedInputFile()"
968 <<
": no input file opened with base name '" << baseFileName <<
"." << fileType
979 *this->
subDisplayFile() <<
"In BaseEnvironment::openUnifiedInputFile()"
980 <<
": opening input file with base name '" << baseFileName <<
"." << fileType
990 int irtrn =
CheckFilePath((baseFileName+
"."+fileType).c_str());
995 filePtrSet.
ifsVar =
new std::ifstream((baseFileName+
"."+fileType).c_str(),
997 if ((filePtrSet.
ifsVar == NULL) || (filePtrSet.
ifsVar->is_open() ==
false)) {
998 std::cerr <<
"In BaseEnvironment::openUnifiedInputFile()"
999 <<
": failed to open input file with base name '" << baseFileName <<
"." << fileType
1005 #ifdef QUESO_HAS_HDF5
1007 filePtrSet.h5Var = H5Fopen((baseFileName+
"."+fileType).c_str(),
1028 const std::string& inputFileType)
const
1030 std::string fileType(inputFileType);
1031 #ifdef QUESO_HAS_HDF5
1036 *this->
subDisplayFile() <<
"WARNING in BaseEnvironment::closeFile()"
1038 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
1044 std::cerr <<
"WARNING in BaseEnvironment::closeFile()"
1046 <<
"' has been requested, but this QUESO library has not been built with 'hdf5'"
1058 delete filePtrSet.
ofsVar;
1059 filePtrSet.
ofsVar = NULL;
1062 delete filePtrSet.
ifsVar;
1063 filePtrSet.
ifsVar = NULL;
1065 #ifdef QUESO_HAS_HDF5
1067 H5Fclose(filePtrSet.h5Var);
1114 #ifdef QUESO_HAS_MPI
1117 const char* passedOptionsInputFileName,
1123 #ifdef QUESO_MEMORY_DEBUGGING
1124 std::cout <<
"Entering FullEnv" << std::endl;
1130 int mpiRC = MPI_Comm_rank(inputComm,&
m_worldRank);
1144 #ifdef QUESO_MEMORY_DEBUGGING
1145 std::cout <<
"In FullEnv, finished dealing with MPI initially" << std::endl;
1159 m_allOptionsDesc =
new boost::program_options::options_description(
"Allowed options");
1161 readOptionsInputFile();
1172 std::cout << (*m_optionsObj) << std::endl;
1177 "total number of processors in environment must be multiple of the specified number of subEnvironments");
1179 #ifdef QUESO_MEMORY_DEBUGGING
1180 std::cout <<
"In FullEnv, finished scanning options" << std::endl;
1200 std::cout <<
"Beginning run at " << ctime(&
m_timevalBegin.tv_sec)
1212 sprintf(tmpSubId,
"%u",
m_subId);
1219 std::vector<int> fullRanksOfMySubEnvironment(numRanksPerSubEnvironment,0);
1220 for (
unsigned int i = 0; i < numRanksPerSubEnvironment; ++i) {
1221 fullRanksOfMySubEnvironment[i] =
m_subId * numRanksPerSubEnvironment + i;
1224 mpiRC = MPI_Group_incl(
m_fullGroup, (
int) numRanksPerSubEnvironment, &fullRanksOfMySubEnvironment[0], &
m_subGroup);
1230 m_subComm =
new MpiComm(*
this,subRawComm);
1244 fullRanksOfInter0[i] = i * numRanksPerSubEnvironment;
1251 if (
m_fullRank%numRanksPerSubEnvironment == 0) {
1270 bool openFile =
false;
1296 std::ofstream::out | std::ofstream::trunc);
1312 std::cout <<
"MPI node of worldRank " <<
m_worldRank
1314 <<
", belongs to subEnvironment of id " <<
m_subId
1318 std::cout <<
"MPI node of worldRank " <<
m_worldRank
1319 <<
" belongs to sub communicator with full ranks";
1320 for (
unsigned int j = 0; j < fullRanksOfMySubEnvironment.size(); ++j) {
1321 std::cout <<
" " << fullRanksOfMySubEnvironment[j];
1326 std::cout <<
"MPI node of worldRank " << m_worldRank
1327 <<
" also belongs to inter0 communicator with full ranks";
1328 for (
unsigned int j = 0; j < fullRanksOfInter0.size(); ++j) {
1329 std::cout <<
" " << fullRanksOfInter0[j];
1335 std::cout << std::endl;
1356 std::cerr <<
"In Environment::constructor()"
1369 *
m_subDisplayFile <<
"Done with initializations at FullEnvironment::commonConstructor()"
1375 #endif // QUESO_HAS_MPI
1378 const char* passedOptionsInputFileName,
1384 #ifdef QUESO_MEMORY_DEBUGGING
1385 std::cout <<
"Entering FullEnv" << std::endl;
1394 #ifndef QUESO_HAS_MPI
1401 #ifdef QUESO_MEMORY_DEBUGGING
1402 std::cout <<
"In FullEnv, finished dealing with MPI initially" << std::endl;
1416 m_allOptionsDesc =
new boost::program_options::options_description(
"Allowed options");
1429 std::cout << (*m_optionsObj) << std::endl;
1434 "total number of processors in environment must be multiple of the specified number of subEnvironments");
1436 #ifdef QUESO_MEMORY_DEBUGGING
1437 std::cout <<
"In FullEnv, finished scanning options" << std::endl;
1454 std::cout <<
"Beginning run at " << ctime(&
m_timevalBegin.tv_sec)
1460 sprintf(tmpSubId,
"%u",
m_subId);
1467 int fullRanksOfMySubEnvironment = 1;
1469 #ifndef QUESO_HAS_MPI
1485 int fullRanksOfInter0 = 0;
1486 #ifndef QUESO_HAS_MPI
1506 bool openFile =
false;
1513 if (openFile && m_worldRank == 0) {
1532 std::ofstream::out | std::ofstream::trunc);
1548 std::cout <<
"MPI node of worldRank " << m_worldRank
1550 <<
", belongs to subEnvironment of id " <<
m_subId
1554 std::cout <<
"MPI node of worldRank " << m_worldRank
1555 <<
" belongs to sub communicator with full ranks";
1556 std::cout <<
" " << fullRanksOfMySubEnvironment;
1560 std::cout <<
"MPI node of worldRank " << m_worldRank
1561 <<
" also belongs to inter0 communicator with full ranks";
1562 std::cout <<
" " << fullRanksOfInter0;
1567 std::cout << std::endl;
1585 std::cerr <<
"In Environment::constructor()"
1598 *
m_subDisplayFile <<
"Done with initializations at FullEnvironment::commonConstructor()"
1619 #ifdef QUESO_HAS_MPI
1620 int mpi_initialized;
1621 MPI_Initialized (&mpi_initialized);
1623 if (mpi_initialized)
1626 MPI_Abort(MPI_COMM_WORLD, 1);
1647 if (ifs->is_open()) {
1652 if (
m_fullRank == 0) std::cout <<
"An invalid input file has been passed to the 'environment' class constructor!"
1656 if (
m_fullRank == 0) std::cout <<
"\nThis is a help message of the QUESO library."
1657 <<
"\nAn application using the QUESO library shall be executed by typing"
1658 <<
"\n '<eventual mpi commands and options> <Application> <InputFile>'"
1659 <<
"\nin the command line."
#define UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
unsigned int displayVerbosity() const
const MpiComm & subComm() const
Access function for MpiComm sub communicator.
void readOptionsInputFile()
Checks the options input file and reads the options.
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
std::ofstream * ofsVar
Provides a stream interface to write data to files.
#define UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE
BasicPdfsBase * m_basicPdfs
unsigned int m_checkingLevel
Checking level.
#define UQ_FILE_EXTENSION_FOR_TXT_FORMAT
int subRank() const
Access function for sub-rank.
#define queso_error_msg(msg)
RawType_MPI_Comm Comm() const
Extract MPI Communicator from a MpiComm object.
void print(std::ostream &os) const
Sends the environment options to the stream.
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
TODO: Base class for basic PDFs using Boost library.
int fullRank() const
Returns the process full rank.
int QUESO_get_numeric_version()
std::string identifyingString() const
Access function to private attribute m_identifyingString: identifying string.
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
FilePtrSetStruct()
Struct constructor.
RawType_MPI_Group subGroup() const
Access function for sub-group.
#define queso_deprecated()
const MpiComm & fullComm() const
Access function for MpiComm full communicator.
void queso_terminate_handler()
Function for unhandled exceptions in Queso.
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.
std::string m_platformName
Platform name.
boost::program_options::variables_map & allOptionsMap() const
#define queso_require_msg(asserted, msg)
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.
Class for random number generation using Boost library.
#define queso_require_equal_to_msg(expr1, expr2, msg)
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.
void Barrier() const
Pause every process in *this communicator until all the processes reach this point.
#define queso_require_greater_equal_msg(expr1, expr2, msg)
virtual ~BaseEnvironment()
Destructor.
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
void closeFile(FilePtrSetStruct &filePtrSet, const std::string &fileType) const
Closes the file.
std::terminate_handler old_terminate_handler
std::string m_subIdString
#define UQ_ENV_FILENAME_FOR_NO_INPUT_FILE
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)...
~FilePtrSetStruct()
Destructor.
int seed() const
Sets the seed.
Struct for handling data input and output from files.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
#define RawValue_MPI_COMM_SELF
RawType_MPI_Group m_fullGroup
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
unsigned int m_numSubEnvironments
void setExceptionalCircumstance(bool value) const
Set an exceptional circumstance.
#define UQ_FILE_EXTENSION_FOR_HDF_FORMAT
std::string m_rngType
Type of the random number generator.
boost::program_options::options_description * m_allOptionsDesc
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).
int MyPID() const
Return my process ID.
FullEnvironment(const char *passedOptionsInputFileName, const char *prefix, EnvOptionsValues *alternativeOptionsValues)
Parallel constructor.
int CheckFilePath(const char *path)
bool m_optionsInputFileAccessState
std::string m_identifyingString
Identifying string.
std::string platformName() const
Access to the platform name.
int NumProc() const
Returns total number of processes.
std::ifstream * ifsVar
Provides a stream interface to read data from files.
const MpiComm & inter0Comm() const
Access function for MpiComm inter0-communicator.
struct timeval m_timevalBegin
std::ofstream * m_subDisplayFile
This class provides a suite options one can pass to a QUESO environment.
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...
virtual void resetSeed(int newSeed)
Resets the seed with value newSeed.
unsigned int checkingLevel() const
Access function to private attribute m_checkingLevel.
Class for random number generation using GSL library.
unsigned int m_displayVerbosity
Verbosity.
std::string m_subDisplayFileName
Output filename for sub-screen writing.
std::string subDisplayFileName() const
Access function for m_subDisplayFileName (displays filename on stream).
The QUESO MPI Communicator Class.
int m_seed
Seed of the random number generator.
int worldRank() const
Returns the process world rank.
TODO: Base class for basic PDFs using Gsl library.
EmptyEnvironment()
Default constructor. Does nothing.
unsigned int m_syncVerbosity
Synchronized verbosity.
void resetIdentifyingString(const std::string &newString)
Reset private attribute m_identifyingString with the value newString.
~FullEnvironment()
Destructor.
RawType_MPI_Group m_subGroup
~EmptyEnvironment()
Destructor.
BaseEnvironment(const char *passedOptionsInputFileName, EnvOptionsValues *alternativeOptionsValues)
Default constructor.
void print(std::ostream &os) const
Class for random number generation (base class for either GSL or Boost RNG).
bool openUnifiedInputFile(const std::string &fileName, const std::string &fileType, FilePtrSetStruct &filePtrSet) const
Opens the unified input file.
bool openInputFile(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, FilePtrSetStruct &filePtrSet) const
Opens an input file.