25 #include <queso/queso.h> 
   26 #include <queso/Environment.h> 
   27 #include <queso/EnvironmentOptions.h> 
   28 #include <queso/RngGsl.h> 
   29 #include <queso/RngBoost.h> 
   30 #include <queso/BasicPdfsGsl.h> 
   31 #include <queso/BasicPdfsBoost.h> 
   32 #include <queso/Miscellaneous.h> 
   39 #include <queso/asserts.h> 
   50       os << 
"------------------------------------------------------------------------------------------" ;
 
   51       os << 
"--------------------" << std::endl;
 
   70       os << 
"------------------------------------------------------------------------------------------" ;
 
   71       os << 
"--------------------" << std::endl;
 
   90     int major_version = 0;
 
   91     int minor_version = 0;
 
   92     int micro_version = 0;
 
   94 #ifdef QUESO_MAJOR_VERSION 
   98 #ifdef QUESO_MINOR_VERSION 
  102 #ifdef QUESO_MICRO_VERSION 
  106     return(major_version*10000 + minor_version*100 + micro_version);
 
  131   const char*                    passedOptionsInputFileName,
 
  134   m_fullEnvIsReady             (false),
 
  139   m_optionsInputFileName       (
""),
 
  140   m_optionsInputFileAccessState(true),
 
  141   m_allOptionsDesc             (NULL),
 
  142   m_allOptionsMap              (NULL),
 
  149   m_inter0CommSize             (1),
 
  150   m_subDisplayFile             (NULL),
 
  153   m_exceptionalCircumstance    (false),
 
  154   m_alternativeOptionsValues   (),
 
  165                       "BaseEnvironment::constructor(), copy",
 
  166                       "code should not execute through here");
 
  176   struct timeval timevalNow;
 
  178   gettimeofday(&timevalNow, NULL);
 
  184                           << 
"Total run time = " << timevalNow.tv_sec - 
m_timevalBegin.tv_sec
 
  190         std::cout << 
"Ending run at "    << ctime(&timevalNow.tv_sec)
 
  191                   << 
"Total run time = " << timevalNow.tv_sec - 
m_timevalBegin.tv_sec
 
  223                       "BaseEnvironment::operator=()",
 
  224                       "code should not execute through here");
 
  251                       "BaseEnvironment::fullComm()",
 
  252                       "m_fullComm variable is NULL");
 
  273                       "BaseEnvironment::subComm()",
 
  274                       "m_subComm variable is NULL");
 
  283                       "BaseEnvironment::selfComm()",
 
  284                       "m_selfComm variable is NULL");
 
  299                       "BaseEnvironment::inter0Comm()",
 
  300                       "m_inter0Comm variable is NULL");
 
  323                       "BaseEnvironment::numSubEnvironments()",
 
  324                       "m_optionsObj variable is NULL");
 
  359 #ifdef UQ_USES_COMMAND_LINE_OPTIONS 
  360 const po::options_description&
 
  361 BaseEnvironment::allOptionsDesc()
 const 
  372                       "BaseEnvironment::allOptionsMap()",
 
  373                       "m_allOptionsMap variable is NULL");
 
  380 #ifdef UQ_USES_COMMAND_LINE_OPTIONS 
  392 #ifdef QUESO_MEMORY_DEBUGGING 
  393   std::cout << 
"Entering BaseEnv::scanInputFileForMyOptions()" << std::endl;
 
  398                       "BaseEnvironment::scanInputFileForMyOptions()",
 
  399                       "m_allOptionsDesc variable is NULL");
 
  408                       "BaseEnvironment::scanInputFileForMyOptions()",
 
  409                       "m_optionsInputFileName is 'nothing'");
 
  412 #ifdef QUESO_MEMORY_DEBUGGING 
  413   std::cout << 
"in BaseEnv::scanInputFileForMyOptions(), before store(a)" << std::endl;
 
  418                       "BaseEnvironment::scanInputFileForMyOptions()",
 
  419                       "m_allOptionsMap variable is NULL");
 
  421 #ifdef QUESO_MEMORY_DEBUGGING 
  422   std::cout << 
"in BaseEnv::scanInputFileForMyOptions(), after store(a)" << std::endl;
 
  428 #ifdef QUESO_MEMORY_DEBUGGING 
  429   std::cout << 
"Leaving BaseEnv::scanInputFileForMyOptions()" << std::endl;
 
  440                       "BaseEnvironment::displayVerbosity()",
 
  441                       "m_optionsObj variable is NULL");
 
  450                       "BaseEnvironment::displayVerbosity()",
 
  451                       "m_optionsObj variable is NULL");
 
  460                       "BaseEnvironment::checkingLevel()",
 
  461                       "m_optionsObj variable is NULL");
 
  505   m_optionsObj->m_ov.m_identifyingString = newString;
 
  512   return m_timevalBegin;
 
  517   const std::string&            baseFileName,
 
  518   const std::string&            inputFileType,
 
  519   const std::set<unsigned int>& allowedSubEnvIds,
 
  523   std::string fileType(inputFileType);
 
  524 #ifdef QUESO_HAS_HDF5 
  529       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openOutputFile()" 
  531                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  537       std::cerr << 
"WARNING in BaseEnvironment::openOutputFile()" 
  539                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  548   bool returnValue = 
true;
 
  551       (allowedSubEnvIds.find(this->subId()) == allowedSubEnvIds.end()            )) {
 
  554                               << 
", subId = "     << this->
subId()
 
  555                               << 
": no output file opened with base name '" << baseFileName << 
"." << fileType
 
  557                               << 
", writeOver = " << writeOver
 
  568                               << 
", subId = "     << this->
subId()
 
  569                               << 
": opening output file with base name '" << baseFileName << 
"." << fileType
 
  571                               << 
", writeOver = " << writeOver
 
  577       std::cout << 
"In BaseEnvironment::openOutputFile()" 
  578                 << 
": opening output file with base name '" << baseFileName << 
"." << fileType
 
  580                 << 
", writeOver = " << writeOver
 
  591                                 << 
", subId = "     << this->
subId()
 
  592                                 << 
", trying to open output file with base name '" << baseFileName << 
"." << fileType
 
  594                                 << 
", writeOver = " << writeOver
 
  595                                 << 
": calling CheckFilePath()..." 
  601                                 << 
", subId = "     << this->
subId()
 
  602                                 << 
", trying to open output file with base name '" << baseFileName << 
"." << fileType
 
  604                                 << 
", writeOver = " << writeOver
 
  605                                 << 
": returned from CheckFilePath() with irtrn = " << irtrn
 
  610                           "BaseEnvironment::openOutputFile()",
 
  611                           "unable to verify output path");
 
  618           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  619                                                 std::ofstream::out | std::ofstream::trunc);
 
  624                               "BaseEnvironment::openOutputFile(), writeOver=true",
 
  625                               "hdf file type not supported yet");
 
  630                               "BaseEnvironment::openOutputFile(), writeOver=true",
 
  631                               "invalid file type");
 
  635                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  637                                   << 
", writeOver = " << writeOver
 
  638                                   << 
", options 'out|trunc'" 
  639                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  649           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  651           std::cout << 
"filePtrSet.ofsVar(1) = " << filePtrSet.
ofsVar << std::endl;
 
  652           if (filePtrSet.
ofsVar) std::cout << 
"filePtrSet.ofsVar(1)->is_open() = " << filePtrSet.
ofsVar->is_open() << std::endl;
 
  656           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  657                                                 std::ofstream::out  | std::ofstream::app);
 
  662                               "BaseEnvironment::openOutputFile(), writeOver=false",
 
  663                               "hdf file type not supported yet");
 
  668                               "BaseEnvironment::openOutputFile(), writeOver=false",
 
  669                               "invalid file type");
 
  673                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  675                                   << 
", writeOver = " << writeOver
 
  676                                   << 
", options 'out|in|app'" 
  677                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  684           if ((filePtrSet.
ofsVar            == NULL ) ||
 
  685               (filePtrSet.
ofsVar->is_open() == 
false)) {
 
  688             filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  689                                                   std::ofstream::out | std::ofstream::trunc);
 
  692                                       << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  694                                       << 
", writeOver = " << writeOver
 
  695                                       << 
", options 'out|trunc'" 
  696                                       << 
", osfvar = " << filePtrSet.
ofsVar 
  702       if (filePtrSet.
ofsVar != NULL) {
 
  705                                   << 
", subId = "     << this->
subId()
 
  706                                   << 
": succeeded on opening output file with base name '" << baseFileName << 
"." << fileType
 
  708                                   << 
", writeOver = " << writeOver
 
  713         std::cerr << 
"In BaseEnvironment::openOutputFile()" 
  714                   << 
": failed to open output file with base name '" << baseFileName << 
"." << fileType
 
  721                           "failed to open output file");
 
  734   const std::string&        baseFileName,
 
  735   const std::string&        inputFileType,
 
  739   std::string fileType(inputFileType);
 
  740 #ifdef QUESO_HAS_HDF5 
  745       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openUnifiedOutputFile()" 
  747                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  753       std::cerr << 
"WARNING in BaseEnvironment::openUnifiedOutputFile()" 
  755                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  764   bool returnValue = 
true;
 
  766   if (baseFileName == 
".") {
 
  768       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  769                               << 
": no unified output file opened with base name '" << baseFileName << 
"." << fileType
 
  771                               << 
", writeOver = " << writeOver
 
  781       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  782                               << 
": opening unified output file with base name '" << baseFileName << 
"." << fileType
 
  784                               << 
", writeOver = " << writeOver
 
  792       std::cout << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  793                 << 
": opening output file with base name '" << baseFileName << 
"." << fileType
 
  795                 << 
", writeOver = " << writeOver
 
  803       int irtrn = 
CheckFilePath((baseFileName+
"."+fileType).c_str());
 
  806                           "BaseEnvironment::openUnifiedOutputFile()",
 
  807                           "unable to verify output path");
 
  814           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"."+fileType).c_str(),
 
  815                                                 std::ofstream::out | std::ofstream::trunc);
 
  817 #ifdef QUESO_HAS_HDF5 
  819           filePtrSet.h5Var = H5Fcreate((baseFileName+
"."+fileType).c_str(),
 
  828                               "BaseEnvironment::openUnifiedOutputFile(), writeOver=true",
 
  829                               "invalid file type");
 
  832           *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  833                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  835                                   << 
", writeOver = " << writeOver
 
  836                                   << 
", options 'out|trunc'" 
  837                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  847           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"."+fileType).c_str(),
 
  848                                                 std::ofstream::out  | std::ofstream::app);
 
  850 #ifdef QUESO_HAS_HDF5 
  852           filePtrSet.h5Var = H5Fcreate((baseFileName+
"."+fileType).c_str(), 
 
  865                               "BaseEnvironment::openUnifiedOutputFile(), writeOver=false",
 
  866                               "invalid file type");
 
  869           *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  870                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  872                                   << 
", writeOver = " << writeOver
 
  873                                   << 
", options 'out|in|app'" 
  874                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  877         if ((filePtrSet.
ofsVar            == NULL ) ||
 
  878             (filePtrSet.
ofsVar->is_open() == 
false)) {
 
  880           std::cout << 
"Retrying 2..." << std::endl;
 
  883           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"."+fileType).c_str(),
 
  884                                                 std::ofstream::out | std::ofstream::trunc);
 
  886             *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  887                                     << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  889                                     << 
", writeOver = " << writeOver
 
  890                                     << 
", options 'out|trunc'" 
  891                                     << 
", osfvar = " << filePtrSet.
ofsVar 
  896       if (filePtrSet.
ofsVar == NULL) {
 
  897         std::cerr << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  898                   << 
": failed to open unified output file with base name '" << baseFileName << 
"." << fileType
 
  904                           "openUnifiedOutputFile()",
 
  905                           "failed to open output file");
 
  914   const std::string&            baseFileName,
 
  915   const std::string&            inputFileType,
 
  916   const std::set<unsigned int>& allowedSubEnvIds,
 
  919   std::string fileType(inputFileType);
 
  920 #ifdef QUESO_HAS_HDF5 
  925       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openInputFile()" 
  927                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  933       std::cerr << 
"WARNING in BaseEnvironment::openInputFile()" 
  935                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  944   bool returnValue = 
true;
 
  947       (allowedSubEnvIds.find(this->subId()) == allowedSubEnvIds.end()           )) {
 
  950                               << 
": no input file opened with base name '" << baseFileName << 
"." << fileType
 
  962                               << 
": opening input file with base name '" << baseFileName << 
"." << fileType
 
  972       int irtrn = 
CheckFilePath((baseFileName+
"."+fileType).c_str());
 
  975                           "BaseEnvironment::openInputFile()",
 
  976                           "unable to verify input path");
 
  979         filePtrSet.
ifsVar = 
new std::ifstream((baseFileName+
"."+fileType).c_str(),
 
  981         if ((filePtrSet.
ifsVar == NULL) || (filePtrSet.
ifsVar->is_open() == 
false)) {
 
  982           std::cerr << 
"In BaseEnvironment::openInputFile()" 
  983                     << 
": failed to open input file with base name '" << baseFileName << 
"." << fileType
 
  989                             "BaseEnvironment::openInputFile()",
 
  990                             "file with fileName could not be found");
 
  992 #ifdef QUESO_HAS_HDF5 
  994         filePtrSet.h5Var = H5Fopen((baseFileName+
"."+fileType).c_str(),
 
 1002                             "BaseEnvironment::openInputFile()",
 
 1003                             "invalid file type");
 
 1007       returnValue = 
false;
 
 1017   const std::string&        baseFileName,
 
 1018   const std::string&        inputFileType,
 
 1021   std::string fileType(inputFileType);
 
 1022 #ifdef QUESO_HAS_HDF5 
 1027       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openUnifiedInputFile()" 
 1029                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1035       std::cerr << 
"WARNING in BaseEnvironment::openUnifiedInputFile()" 
 1037                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1046   bool returnValue = 
true;
 
 1047   filePtrSet.
ifsVar = NULL;
 
 1050       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedInputFile()" 
 1051                               << 
": no input file opened with base name '" << baseFileName << 
"." << fileType
 
 1055     returnValue = 
false;
 
 1062       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedInputFile()" 
 1063                               << 
": opening input file with base name '" << baseFileName << 
"." << fileType
 
 1073       int irtrn = 
CheckFilePath((baseFileName+
"."+fileType).c_str());
 
 1076                           "BaseEnvironment::openUnifiedInputFile()",
 
 1077                           "unable to verify input path");
 
 1080         filePtrSet.
ifsVar = 
new std::ifstream((baseFileName+
"."+fileType).c_str(),
 
 1082         if ((filePtrSet.
ifsVar == NULL) || (filePtrSet.
ifsVar->is_open() == 
false)) {
 
 1083           std::cerr << 
"In BaseEnvironment::openUnifiedInputFile()" 
 1084                     << 
": failed to open input file with base name '" << baseFileName << 
"." << fileType
 
 1090                             "BaseEnvironment::openUnifiedInputFile()",
 
 1091                             "file with fileName could not be found");
 
 1093 #ifdef QUESO_HAS_HDF5 
 1095         filePtrSet.h5Var = H5Fopen((baseFileName+
"."+fileType).c_str(),
 
 1103                             "BaseEnvironment::openUnifiedInputFile()",
 
 1104                             "invalid file type");
 
 1119   const std::string&  inputFileType)
 const 
 1121   std::string fileType(inputFileType);
 
 1122 #ifdef QUESO_HAS_HDF5 
 1127       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::closeFile()" 
 1129                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1135       std::cerr << 
"WARNING in BaseEnvironment::closeFile()" 
 1137                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1148     delete filePtrSet.
ofsVar;
 
 1149     filePtrSet.
ofsVar = NULL;
 
 1152     delete filePtrSet.
ifsVar;
 
 1153     filePtrSet.
ifsVar = NULL;
 
 1155 #ifdef QUESO_HAS_HDF5 
 1157     H5Fclose(filePtrSet.h5Var);
 
 1163                         "BaseEnvironment::closeFile()",
 
 1164                         "invalid file type");
 
 1209   const char*                    passedOptionsInputFileName,
 
 1215 #ifdef QUESO_MEMORY_DEBUGGING 
 1216   std::cout << 
"Entering FullEnv" << std::endl;
 
 1222   int mpiRC = MPI_Comm_rank(inputComm,&
m_worldRank);
 
 1225                       "FullEnvironment::commonConstructor()",
 
 1226                       "failed to get world fullRank()");
 
 1235                       "FullEnvironment::commonConstructor()",
 
 1236                       "failed MPI_Comm_group()");
 
 1241 #ifdef QUESO_MEMORY_DEBUGGING 
 1242   std::cout << 
"In FullEnv, finished dealing with MPI initially" << std::endl;
 
 1261 #ifdef QUESO_MEMORY_DEBUGGING 
 1262   std::cout << 
"In FullEnv, finished scanning options" << std::endl;
 
 1282       std::cout << 
"Beginning run at " << ctime(&
m_timevalBegin.tv_sec)
 
 1294   sprintf(tmpSubId,
"%u",
m_subId);
 
 1301   std::vector<int> fullRanksOfMySubEnvironment(numRanksPerSubEnvironment,0);
 
 1302   for (
unsigned int i = 0; i < numRanksPerSubEnvironment; ++i) {
 
 1303     fullRanksOfMySubEnvironment[i] = 
m_subId * numRanksPerSubEnvironment + i;
 
 1306   mpiRC = MPI_Group_incl(
m_fullGroup, (
int) numRanksPerSubEnvironment, &fullRanksOfMySubEnvironment[0], &
m_subGroup);
 
 1309                       "FullEnvironment::commonConstructor()",
 
 1310                       "failed MPI_Group_incl() for a subEnvironment");
 
 1316                       "FullEnvironment::commonConstructor()",
 
 1317                       "failed MPI_Comm_group() for a subEnvironment");
 
 1332     fullRanksOfInter0[i] = i * numRanksPerSubEnvironment;
 
 1337                       "FullEnvironment::commonConstructor()",
 
 1338                       "failed MPI_Group_incl() for inter0");
 
 1343                       "FullEnvironment::commonConstructor()",
 
 1344                       "failed MPI_Comm_group() for inter0");
 
 1345   if (
m_fullRank%numRanksPerSubEnvironment == 0) {
 
 1364   bool openFile = 
false;
 
 1379                         "Environment::constructor()",
 
 1380                         "unable to verify output path");
 
 1393                                          std::ofstream::out | std::ofstream::trunc);
 
 1396                         "Environment::constructor()",
 
 1397                         "failed to open sub screen file");
 
 1412         std::cout << 
"MPI node of worldRank "             << 
m_worldRank 
 1414                   << 
", belongs to subEnvironment of id " << 
m_subId 
 1418         std::cout << 
"MPI node of worldRank " << 
m_worldRank 
 1419                   << 
" belongs to sub communicator with full ranks";
 
 1420         for (
unsigned int j = 0; j < fullRanksOfMySubEnvironment.size(); ++j) {
 
 1421           std::cout << 
" " << fullRanksOfMySubEnvironment[j];
 
 1426           std::cout << 
"MPI node of worldRank " << m_worldRank
 
 1427                     << 
" also belongs to inter0 communicator with full ranks";
 
 1428           for (
unsigned int j = 0; j < fullRanksOfInter0.size(); ++j) {
 
 1429             std::cout << 
" " << fullRanksOfInter0[j];
 
 1435         std::cout << std::endl;
 
 1456     std::cerr << 
"In Environment::constructor()" 
 1461                         "Environment::constructor()",
 
 1462                         "the requested 'rngType' is not supported yet");
 
 1472     *
m_subDisplayFile << 
"Done with initializations at FullEnvironment::commonConstructor()" 
 1492   int mpi_initialized;
 
 1493   MPI_Initialized (&mpi_initialized);
 
 1495   if (mpi_initialized)
 
 1498       MPI_Abort(MPI_COMM_WORLD, 1);
 
 1516   if (ifs->is_open()) {
 
 1521     if (
m_fullRank == 0) std::cout << 
"An invalid input file has been passed to the 'environment' class constructor!" 
 1525     if (
m_fullRank == 0) std::cout << 
"\nThis is a help message of the QUESO library." 
 1526                                    << 
"\nAn application using the QUESO library shall be executed by typing" 
 1527                                    << 
"\n  '<eventual mpi commands and options> <Application> <InputFile>'" 
 1528                                    << 
"\nin the command line." 
unsigned int m_checkingLevel
Checking level. 
 
const std::string & subIdString() const 
Access to the attribute m_subIdString; which stores the string for the sub-environment, and it will be used, for instance, to create the output files for each sub-environment. 
 
bool openInputFile(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, FilePtrSetStruct &filePtrSet) const 
Opens an input file. 
 
std::string m_subIdString
 
int NumProc() const 
Returns total number of processes. 
 
po::options_description * m_allOptionsDesc
 
int subRank() const 
Access function for sub-rank. 
 
#define UQ_ENV_FILENAME_FOR_NO_INPUT_FILE
 
Class for random number generation (base class for either GSL or Boost RNG). 
 
const RngBase * rngObject() const 
Access to the RNG object. 
 
void print(std::ostream &os) const 
Sends the environment options to the stream. 
 
unsigned int syncVerbosity() const 
Access function to private attribute m_syncVerbosity. 
 
bool openUnifiedInputFile(const std::string &fileName, const std::string &fileType, FilePtrSetStruct &filePtrSet) const 
Opens the unified input file. 
 
struct timeval m_timevalBegin
 
int inter0Rank() const 
Returns the process inter0 rank. 
 
#define UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE
 
#define QUESO_MAJOR_VERSION
 
unsigned int m_displayVerbosity
Verbosity. 
 
std::string m_subDisplayFileName
Output filename for sub-screen writing. 
 
Struct for handling data input and output from files. 
 
std::string subDisplayFileName() const 
Access function for m_subDisplayFileName (displays filename on stream). 
 
void resetSeed(int newSeedOption)
Reset RNG seed. 
 
int worldRank() const 
Returns the process world rank. 
 
RawType_MPI_Comm Comm() const 
Extract MPI Communicator from a MpiComm object. 
 
unsigned int checkingLevel() const 
Access function to private attribute m_checkingLevel. 
 
const MpiComm & subComm() const 
Access function for MpiComm sub communicator. 
 
const int UQ_UNAVAILABLE_RANK
 
BaseEnvironment(const char *passedOptionsInputFileName, const EnvOptionsValues *alternativeOptionsValues)
Default constructor. 
 
MPI_Comm RawType_MPI_Comm
 
TODO: Base class for basic PDFs using Boost library. 
 
std::ofstream * subDisplayFile() const 
Access function for m_subDisplayFile (displays file on stream). 
 
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output. 
 
EmptyEnvironment()
Default constructor. Does nothing. 
 
const MpiComm & fullComm() const 
Access function for MpiComm full communicator. 
 
void print(std::ostream &os) const 
 
void Barrier() const 
Pause every process in *this communicator until all the processes reach this point. 
 
virtual ~BaseEnvironment()
Destructor. 
 
po::variables_map & allOptionsMap() const 
 
void resetIdentifyingString(const std::string &newString) const 
Reset private attribute m_identifyingString with the value newString. 
 
int CheckFilePath(const char *path)
 
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
 
std::string identifyingString() const 
Access function to private attribute m_identifyingString: identifying string. 
 
~FilePtrSetStruct()
Destructor. 
 
std::ofstream * ofsVar
Provides a stream interface to write data to files. 
 
#define UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
 
std::string m_optionsInputFileName
 
std::ofstream * m_subDisplayFile
 
std::string platformName() const 
Access to the platform name. 
 
void QUESO_version_print(std::ostream &os)
 
unsigned int m_syncVerbosity
Synchronized verbosity. 
 
std::string m_rngType
Type of the random number generator. 
 
po::variables_map * m_allOptionsMap
 
void readOptionsInputFile()
Checks the options input file and reads the options. 
 
#define UQ_FATAL_TEST_MACRO(test, givenRank, where, what)
 
BasicPdfsBase * m_basicPdfs
 
int seed() const 
Sets the seed. 
 
void closeFile(FilePtrSetStruct &filePtrSet, const std::string &fileType) const 
Closes the file. 
 
#define QUESO_LIB_VERSION
 
std::string optionsInputFileName() const 
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
 
FilePtrSetStruct()
Struct constructor. 
 
int MyPID() const 
Return my process ID. 
 
std::ifstream * ifsVar
Provides a stream interface to read data from files. 
 
void setOptionsInputFileAccessState(bool newState) const 
 
bool m_optionsInputFileAccessState
 
#define QUESO_BUILD_VERSION
 
RawType_MPI_Group m_inter0Group
 
void scanOptionsValues()
Scans option values from input file. 
 
TODO: Base class for basic PDFs (via either GSL or Boost). 
 
~FullEnvironment()
Destructor. 
 
#define QUESO_LIB_RELEASE
 
std::string m_platformName
Platform name. 
 
bool fullEnvIsReady() const 
Returns whether the full environment class is ready (constructor has successfully been called)...
 
The QUESO MPI Communicator Class. 
 
~EmptyEnvironment()
Destructor. 
 
const BasicPdfsBase * basicPdfs() const 
Access to Basic PDFs. 
 
void setExceptionalCircumstance(bool value) const 
Set an exceptional circumstance. 
 
#define QUESO_MINOR_VERSION
 
std::string m_identifyingString
Identifying string. 
 
int QUESO_get_numeric_version()
 
int fullRank() const 
Returns the process full rank. 
 
MPI_Group RawType_MPI_Group
 
unsigned int numSubEnvironments() const 
Access function to the number of sub-environments. 
 
This class reads options one can pass to a QUESO environment through an input file. 
 
const MpiComm & selfComm() const 
Access function for MpiComm self-communicator. 
 
FullEnvironment(RawType_MPI_Comm inputComm, const char *passedOptionsInputFileName, const char *prefix, const EnvOptionsValues *alternativeOptionsValues)
Default constructor. 
 
EnvironmentOptions * m_optionsObj
 
#define QUESO_TRILINOS_DIR
 
const int UQ_INVALID_INTERNAL_STATE_RC
 
RawType_MPI_Group subGroup() const 
Access function for sub-group. 
 
#define UQ_FILE_EXTENSION_FOR_HDF_FORMAT
 
void queso_terminate_handler()
Function for unhandled exceptions in Queso. 
 
bool m_exceptionalCircumstance
 
EnvOptionsValues m_ov
Instance of EnvOptionsValues, a class with default values for QUESO environment. 
 
int seed() const 
Access to the RNG seed. 
 
RawType_MPI_Group m_fullGroup
 
bool openUnifiedOutputFile(const std::string &fileName, const std::string &fileType, bool writeOver, FilePtrSetStruct &filePtrSet) const 
Opens a unified output file, that will contain data from all sub-environments. 
 
unsigned int displayVerbosity() const 
 
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file. 
 
const MpiComm & inter0Comm() const 
Access function for MpiComm inter0-communicator. 
 
#define RawValue_MPI_COMM_SELF
 
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file. 
 
This class provides a suite options one can pass to a QUESO environment. 
 
EnvOptionsValues m_alternativeOptionsValues
 
int m_seed
Seed of the random number generator. 
 
unsigned int subId() const 
Access function to the number of each sub-environment Id: m_subId. 
 
BaseEnvironment & operator=(const BaseEnvironment &rhs)
Assignment operator. It should not be used be the user. 
 
bool openOutputFile(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, bool writeOver, FilePtrSetStruct &filePtrSet) const 
Opens an output file for each sub-environment that was chosen to send data to the file...
 
bool exceptionalCircumstance() const 
Decides whether there is an exceptional circumstance. 
 
std::terminate_handler old_terminate_handler
 
RawType_MPI_Group m_subGroup
 
#define QUESO_MICRO_VERSION
 
void scanInputFileForMyOptions(const po::options_description &optionsDesc) const 
This method scans the input file provided by the user to QUESO. 
 
unsigned int m_numSubEnvironments
Number of sub-environments. 
 
TODO: Base class for basic PDFs using Gsl library. 
 
virtual void resetSeed(int newSeed)
Resets the seed with value newSeed.