25 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
   26 #include <boost/program_options.hpp> 
   27 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
   29 #define GETPOT_NAMESPACE QUESO 
   30 #include <queso/getpot.h> 
   32 #include <queso/queso.h> 
   33 #include <queso/Environment.h> 
   34 #include <queso/EnvironmentOptions.h> 
   35 #include <queso/RngGsl.h> 
   36 #include <queso/RngBoost.h> 
   37 #include <queso/BasicPdfsGsl.h> 
   38 #include <queso/BasicPdfsBoost.h> 
   39 #include <queso/Miscellaneous.h> 
   46 #include <queso/asserts.h> 
   57       os << 
"------------------------------------------------------------------------------------------" ;
 
   58       os << 
"--------------------" << std::endl;
 
   59       os << 
"QUESO Library: Version = " << QUESO_LIB_VERSION;
 
   62       os << QUESO_LIB_RELEASE << std::endl << std::endl;
 
   64       os << 
"Build Date   = " << QUESO_BUILD_DATE     << std::endl;
 
   65       os << 
"Build Host   = " << QUESO_BUILD_HOST     << std::endl;
 
   66       os << 
"Build User   = " << QUESO_BUILD_USER     << std::endl;
 
   67       os << 
"Build Arch   = " << QUESO_BUILD_ARCH     << std::endl;
 
   68       os << 
"Build Rev    = " << QUESO_BUILD_VERSION  << std::endl     << std::endl;
 
   70       os << 
"C++ Config   = " << QUESO_CXX << 
" " << QUESO_CXXFLAGS    << std::endl;
 
   72       os << 
"Trilinos DIR = " << QUESO_TRILINOS_DIR << std::endl;
 
   73       os << 
"GSL Libs     = " << QUESO_GSL_DIR  << std::endl;
 
   74       os << 
"GRVY DIR     = " << QUESO_GRVY_DIR << std::endl;
 
   75       os << 
"GLPK DIR     = " << QUESO_GLPK_DIR << std::endl;
 
   76       os << 
"HDF5 DIR     = " << QUESO_HDF5_DIR << std::endl;
 
   77       os << 
"------------------------------------------------------------------------------------------" ;
 
   78       os << 
"--------------------" << std::endl;
 
   97     int major_version = 0;
 
   98     int minor_version = 0;
 
   99     int micro_version = 0;
 
  101 #ifdef QUESO_MAJOR_VERSION 
  102     major_version = QUESO_MAJOR_VERSION;
 
  105 #ifdef QUESO_MINOR_VERSION 
  106     minor_version = QUESO_MINOR_VERSION;
 
  109 #ifdef QUESO_MICRO_VERSION 
  110     micro_version = QUESO_MICRO_VERSION;
 
  113     return(major_version*10000 + minor_version*100 + micro_version);
 
  120 #ifdef QUESO_HAS_HDF5
 
  142   const char*                    passedOptionsInputFileName,
 
  145   m_fullEnvIsReady             (false),
 
  150   m_optionsInputFileName       (
""),
 
  151   m_optionsInputFileAccessState(true),
 
  152 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
 
  153   m_allOptionsDesc             (NULL),
 
  154   m_allOptionsMap              (NULL),
 
  163   m_inter0CommSize             (1),
 
  164   m_subDisplayFile             (NULL),
 
  167   m_exceptionalCircumstance    (false),
 
  168   m_optionsObj                 (alternativeOptionsValues)
 
  174   const std::string&             passedOptionsInputFileName,
 
  177   m_fullEnvIsReady             (false),
 
  182   m_optionsInputFileName       (passedOptionsInputFileName),
 
  183   m_optionsInputFileAccessState(true),
 
  184 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS
 
  185   m_allOptionsDesc             (NULL),
 
  186   m_allOptionsMap              (NULL),
 
  195   m_inter0CommSize             (1),
 
  196   m_subDisplayFile             (NULL),
 
  199   m_exceptionalCircumstance    (false),
 
  200   m_optionsObj                 (alternativeOptionsValues)
 
  212   struct timeval timevalNow;
 
  214   gettimeofday(&timevalNow, NULL);
 
  220                           << 
"Total run time = " << timevalNow.tv_sec - 
m_timevalBegin.tv_sec
 
  226         std::cout << 
"Ending run at "    << ctime(&timevalNow.tv_sec)
 
  227                   << 
"Total run time = " << timevalNow.tv_sec - 
m_timevalBegin.tv_sec
 
  233 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
  238 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
  371 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
  372 #ifdef UQ_USES_COMMAND_LINE_OPTIONS 
  373 const boost::program_options::options_description&
 
  374 BaseEnvironment::allOptionsDesc()
 const 
  381 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
  383 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
  384 boost::program_options::variables_map&
 
  392 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
  394 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
  400 #ifdef UQ_USES_COMMAND_LINE_OPTIONS 
  412 #ifdef QUESO_MEMORY_DEBUGGING 
  413   std::cout << 
"Entering BaseEnv::scanInputFileForMyOptions()" << std::endl;
 
  424                                  std::string(
"m_optionsInputFileName is 'nothing'"));
 
  427 #ifdef QUESO_MEMORY_DEBUGGING 
  428   std::cout << 
"in BaseEnv::scanInputFileForMyOptions(), before store(a)" << std::endl;
 
  433 #ifdef QUESO_MEMORY_DEBUGGING 
  434   std::cout << 
"in BaseEnv::scanInputFileForMyOptions(), after store(a)" << std::endl;
 
  440 #ifdef QUESO_MEMORY_DEBUGGING 
  441   std::cout << 
"Leaving BaseEnv::scanInputFileForMyOptions()" << std::endl;
 
  446 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
  516   return m_timevalBegin;
 
  521   const std::string&            baseFileName,
 
  522   const std::string&            inputFileType,
 
  523   const std::set<unsigned int>& allowedSubEnvIds,
 
  527   std::string fileType(inputFileType);
 
  528 #ifdef QUESO_HAS_HDF5 
  533       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openOutputFile()" 
  535                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  541       std::cerr << 
"WARNING in BaseEnvironment::openOutputFile()" 
  543                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  552   bool returnValue = 
true;
 
  555       (allowedSubEnvIds.find(this->subId()) == allowedSubEnvIds.end()            )) {
 
  558                               << 
", subId = "     << this->
subId()
 
  559                               << 
": no output file opened with base name '" << baseFileName << 
"." << fileType
 
  561                               << 
", writeOver = " << writeOver
 
  572                               << 
", subId = "     << this->
subId()
 
  573                               << 
": opening output file with base name '" << baseFileName << 
"." << fileType
 
  575                               << 
", writeOver = " << writeOver
 
  581       std::cout << 
"In BaseEnvironment::openOutputFile()" 
  582                 << 
": opening output file with base name '" << baseFileName << 
"." << fileType
 
  584                 << 
", writeOver = " << writeOver
 
  595                                 << 
", subId = "     << this->
subId()
 
  596                                 << 
", trying to open output file with base name '" << baseFileName << 
"." << fileType
 
  598                                 << 
", writeOver = " << writeOver
 
  599                                 << 
": calling CheckFilePath()..." 
  605                                 << 
", subId = "     << this->
subId()
 
  606                                 << 
", trying to open output file with base name '" << baseFileName << 
"." << fileType
 
  608                                 << 
", writeOver = " << writeOver
 
  609                                 << 
": returned from CheckFilePath() with irtrn = " << irtrn
 
  620           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  621                                                 std::ofstream::out | std::ofstream::trunc);
 
  631                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  633                                   << 
", writeOver = " << writeOver
 
  634                                   << 
", options 'out|trunc'" 
  635                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  646           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  648           std::cout << 
"filePtrSet.ofsVar(1) = " << filePtrSet.
ofsVar << std::endl;
 
  649           if (filePtrSet.
ofsVar) std::cout << 
"filePtrSet.ofsVar(1)->is_open() = " << filePtrSet.
ofsVar->is_open() << std::endl;
 
  653           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  654                                                 std::ofstream::out  | std::ofstream::app);
 
  656 #ifdef QUESO_HAS_HDF5 
  658           std::string fullFileName =
 
  659             baseFileName+
"_sub"+this->
subIdString()+
"."+fileType;
 
  662           filePtrSet.h5Var = H5Fcreate(fullFileName.c_str(),
 
  669               "error opening file `" << fullFileName << 
"`");
 
  677                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  679                                   << 
", writeOver = " << writeOver
 
  680                                   << 
", options 'out|in|app'" 
  681                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  688           if ((filePtrSet.
ofsVar            == NULL ) ||
 
  689               (filePtrSet.
ofsVar->is_open() == 
false)) {
 
  692             filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"_sub"+this->
subIdString()+
"."+fileType).c_str(),
 
  693                                                   std::ofstream::out | std::ofstream::trunc);
 
  696                                       << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  698                                       << 
", writeOver = " << writeOver
 
  699                                       << 
", options 'out|trunc'" 
  700                                       << 
", osfvar = " << filePtrSet.
ofsVar 
  712             "failed to open output file");
 
  726   const std::string&        baseFileName,
 
  727   const std::string&        inputFileType,
 
  731   std::string fileType(inputFileType);
 
  732 #ifdef QUESO_HAS_HDF5 
  737       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openUnifiedOutputFile()" 
  739                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  745       std::cerr << 
"WARNING in BaseEnvironment::openUnifiedOutputFile()" 
  747                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  756   bool returnValue = 
true;
 
  758   if (baseFileName == 
".") {
 
  760       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  761                               << 
": no unified output file opened with base name '" << baseFileName << 
"." << fileType
 
  763                               << 
", writeOver = " << writeOver
 
  773       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  774                               << 
": opening unified output file with base name '" << baseFileName << 
"." << fileType
 
  776                               << 
", writeOver = " << writeOver
 
  784       std::cout << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  785                 << 
": opening output file with base name '" << baseFileName << 
"." << fileType
 
  787                 << 
", writeOver = " << writeOver
 
  795       int irtrn = 
CheckFilePath((baseFileName+
"."+fileType).c_str());
 
  804           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"."+fileType).c_str(),
 
  805                                                 std::ofstream::out | std::ofstream::trunc);
 
  807 #ifdef QUESO_HAS_HDF5 
  809           filePtrSet.h5Var = H5Fcreate((baseFileName+
"."+fileType).c_str(),
 
  819           *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  820                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  822                                   << 
", writeOver = " << writeOver
 
  823                                   << 
", options 'out|trunc'" 
  824                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  835           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"."+fileType).c_str(),
 
  836                                                 std::ofstream::out  | std::ofstream::app);
 
  838 #ifdef QUESO_HAS_HDF5 
  840           filePtrSet.h5Var = H5Fcreate((baseFileName+
"."+fileType).c_str(), 
 
  854           *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  855                                   << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  857                                   << 
", writeOver = " << writeOver
 
  858                                   << 
", options 'out|in|app'" 
  859                                   << 
", osfvar = " << filePtrSet.
ofsVar 
  862         if ((filePtrSet.
ofsVar            == NULL ) ||
 
  863             (filePtrSet.
ofsVar->is_open() == 
false)) {
 
  865           std::cout << 
"Retrying 2..." << std::endl;
 
  868           filePtrSet.
ofsVar = 
new std::ofstream((baseFileName+
"."+fileType).c_str(),
 
  869                                                 std::ofstream::out | std::ofstream::trunc);
 
  871             *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  872                                     << 
": just opened output file with base name '" << baseFileName << 
"." << fileType
 
  874                                     << 
", writeOver = " << writeOver
 
  875                                     << 
", options 'out|trunc'" 
  876                                     << 
", osfvar = " << filePtrSet.
ofsVar 
  881       if (filePtrSet.
ofsVar == NULL) {
 
  882         std::cerr << 
"In BaseEnvironment::openUnifiedOutputFile()" 
  883                   << 
": failed to open unified output file with base name '" << baseFileName << 
"." << fileType
 
  896   const std::string&            baseFileName,
 
  897   const std::string&            inputFileType,
 
  898   const std::set<unsigned int>& allowedSubEnvIds,
 
  901   std::string fileType(inputFileType);
 
  902 #ifdef QUESO_HAS_HDF5 
  907       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openInputFile()" 
  909                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  915       std::cerr << 
"WARNING in BaseEnvironment::openInputFile()" 
  917                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
  926   bool returnValue = 
true;
 
  929       (allowedSubEnvIds.find(this->subId()) == allowedSubEnvIds.end()           )) {
 
  932                               << 
": no input file opened with base name '" << baseFileName << 
"." << fileType
 
  944                               << 
": opening input file with base name '" << baseFileName << 
"." << fileType
 
  954       int irtrn = 
CheckFilePath((baseFileName+
"."+fileType).c_str());
 
  959         filePtrSet.
ifsVar = 
new std::ifstream((baseFileName+
"."+fileType).c_str(),
 
  961         if ((filePtrSet.
ifsVar == NULL) || (filePtrSet.
ifsVar->is_open() == 
false)) {
 
  962           std::cerr << 
"In BaseEnvironment::openInputFile()" 
  963                     << 
": failed to open input file with base name '" << baseFileName << 
"." << fileType
 
  969 #ifdef QUESO_HAS_HDF5 
  971         filePtrSet.h5Var = H5Fopen((baseFileName+
"."+fileType).c_str(),
 
  991   const std::string&        baseFileName,
 
  992   const std::string&        inputFileType,
 
  995   std::string fileType(inputFileType);
 
  996 #ifdef QUESO_HAS_HDF5 
 1001       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::openUnifiedInputFile()" 
 1003                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1009       std::cerr << 
"WARNING in BaseEnvironment::openUnifiedInputFile()" 
 1011                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1020   bool returnValue = 
true;
 
 1021   filePtrSet.
ifsVar = NULL;
 
 1024       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedInputFile()" 
 1025                               << 
": no input file opened with base name '" << baseFileName << 
"." << fileType
 
 1029     returnValue = 
false;
 
 1036       *this->
subDisplayFile() << 
"In BaseEnvironment::openUnifiedInputFile()" 
 1037                               << 
": opening input file with base name '" << baseFileName << 
"." << fileType
 
 1047       int irtrn = 
CheckFilePath((baseFileName+
"."+fileType).c_str());
 
 1052         filePtrSet.
ifsVar = 
new std::ifstream((baseFileName+
"."+fileType).c_str(),
 
 1054         if ((filePtrSet.
ifsVar == NULL) || (filePtrSet.
ifsVar->is_open() == 
false)) {
 
 1055           std::cerr << 
"In BaseEnvironment::openUnifiedInputFile()" 
 1056                     << 
": failed to open input file with base name '" << baseFileName << 
"." << fileType
 
 1062 #ifdef QUESO_HAS_HDF5 
 1064         filePtrSet.h5Var = H5Fopen((baseFileName+
"."+fileType).c_str(),
 
 1085   const std::string&  inputFileType)
 const 
 1087   std::string fileType(inputFileType);
 
 1088 #ifdef QUESO_HAS_HDF5 
 1093       *this->
subDisplayFile() << 
"WARNING in BaseEnvironment::closeFile()" 
 1095                               << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1101       std::cerr << 
"WARNING in BaseEnvironment::closeFile()" 
 1103                 << 
"' has been requested, but this QUESO library has not been built with 'hdf5'" 
 1115     delete filePtrSet.
ofsVar;
 
 1116     filePtrSet.
ofsVar = NULL;
 
 1119     delete filePtrSet.
ifsVar;
 
 1120     filePtrSet.
ifsVar = NULL;
 
 1122 #ifdef QUESO_HAS_HDF5 
 1124     H5Fclose(filePtrSet.h5Var);
 
 1177 #ifdef QUESO_HAS_MPI 
 1180   const char*                    passedOptionsInputFileName,
 
 1186   this->construct(inputComm, prefix);
 
 1191   const std::string&           passedOptionsInputFileName,
 
 1192   const std::string&           prefix,
 
 1193   EnvOptionsValues* alternativeOptionsValues)
 
 1195   BaseEnvironment(passedOptionsInputFileName,alternativeOptionsValues)
 
 1197   this->construct(inputComm, prefix.c_str());
 
 1204 #ifdef QUESO_MEMORY_DEBUGGING 
 1205   std::cout << 
"Entering FullEnv" << std::endl;
 
 1211   int mpiRC = MPI_Comm_rank(inputComm,&
m_worldRank);
 
 1225 #ifdef QUESO_MEMORY_DEBUGGING 
 1226   std::cout << 
"In FullEnv, finished dealing with MPI initially" << std::endl;
 
 1237 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
 1239       m_allOptionsDesc = 
new boost::program_options::options_description(
"Allowed options");
 
 1240 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
 1247     EnvOptionsValues * tempOptions = 
new EnvOptionsValues(
this, prefix);
 
 1257     std::cout << (*m_optionsObj) << std::endl;
 
 1262       "total number of processors in environment must be multiple of the specified number of subEnvironments");
 
 1264 #ifdef QUESO_MEMORY_DEBUGGING 
 1265   std::cout << 
"In FullEnv, finished scanning options" << std::endl;
 
 1285       std::cout << 
"Beginning run at " << ctime(&
m_timevalBegin.tv_sec)
 
 1297   sprintf(tmpSubId,
"%u",
m_subId);
 
 1304   std::vector<int> fullRanksOfMySubEnvironment(numRanksPerSubEnvironment,0);
 
 1305   for (
unsigned int i = 0; i < numRanksPerSubEnvironment; ++i) {
 
 1306     fullRanksOfMySubEnvironment[i] = 
m_subId * numRanksPerSubEnvironment + i;
 
 1309   mpiRC = MPI_Group_incl(
m_fullGroup, (
int) numRanksPerSubEnvironment, &fullRanksOfMySubEnvironment[0], &
m_subGroup);
 
 1315   m_subComm = 
new MpiComm(*
this,subRawComm);
 
 1329     fullRanksOfInter0[i] = i * numRanksPerSubEnvironment;
 
 1336   if (
m_fullRank%numRanksPerSubEnvironment == 0) {
 
 1355   bool openFile = 
false;
 
 1381                                          std::ofstream::out | std::ofstream::trunc);
 
 1397         std::cout << 
"MPI node of worldRank "             << 
m_worldRank 
 1399                   << 
", belongs to subEnvironment of id " << 
m_subId 
 1403         std::cout << 
"MPI node of worldRank " << 
m_worldRank 
 1404                   << 
" belongs to sub communicator with full ranks";
 
 1405         for (
unsigned int j = 0; j < fullRanksOfMySubEnvironment.size(); ++j) {
 
 1406           std::cout << 
" " << fullRanksOfMySubEnvironment[j];
 
 1411           std::cout << 
"MPI node of worldRank " << m_worldRank
 
 1412                     << 
" also belongs to inter0 communicator with full ranks";
 
 1413           for (
unsigned int j = 0; j < fullRanksOfInter0.size(); ++j) {
 
 1414             std::cout << 
" " << fullRanksOfInter0[j];
 
 1420         std::cout << std::endl;
 
 1441     std::cerr << 
"In Environment::constructor()" 
 1454     *
m_subDisplayFile << 
"Done with initializations at FullEnvironment::commonConstructor()" 
 1460 #endif  // QUESO_HAS_MPI 
 1463   const char*                    passedOptionsInputFileName,
 
 1473   const std::string&             passedOptionsInputFileName,
 
 1474   const std::string&             prefix,
 
 1485 #ifdef QUESO_MEMORY_DEBUGGING 
 1486   std::cout << 
"Entering FullEnv" << std::endl;
 
 1495 #ifndef QUESO_HAS_MPI 
 1502 #ifdef QUESO_MEMORY_DEBUGGING 
 1503   std::cout << 
"In FullEnv, finished dealing with MPI initially" << std::endl;
 
 1514 #ifndef DISABLE_BOOST_PROGRAM_OPTIONS 
 1516       m_allOptionsDesc = 
new boost::program_options::options_description(
"Allowed options");
 
 1517 #endif  // DISABLE_BOOST_PROGRAM_OPTIONS 
 1534     std::cout << (*m_optionsObj) << std::endl;
 
 1539       "total number of processors in environment must be multiple of the specified number of subEnvironments");
 
 1541 #ifdef QUESO_MEMORY_DEBUGGING 
 1542   std::cout << 
"In FullEnv, finished scanning options" << std::endl;
 
 1559     std::cout << 
"Beginning run at " << ctime(&
m_timevalBegin.tv_sec)
 
 1565   sprintf(tmpSubId,
"%u",
m_subId);
 
 1572   int fullRanksOfMySubEnvironment = 1;
 
 1574 #ifndef QUESO_HAS_MPI 
 1590   int fullRanksOfInter0 = 0;
 
 1591 #ifndef QUESO_HAS_MPI 
 1611   bool openFile = 
false;
 
 1618   if (openFile && m_worldRank == 0) {
 
 1637                                          std::ofstream::out | std::ofstream::trunc);
 
 1653         std::cout << 
"MPI node of worldRank "             << m_worldRank
 
 1655                   << 
", belongs to subEnvironment of id " << 
m_subId 
 1659         std::cout << 
"MPI node of worldRank " << m_worldRank
 
 1660                   << 
" belongs to sub communicator with full ranks";
 
 1661           std::cout << 
" " << fullRanksOfMySubEnvironment;
 
 1665           std::cout << 
"MPI node of worldRank " << m_worldRank
 
 1666                     << 
" also belongs to inter0 communicator with full ranks";
 
 1667             std::cout << 
" " << fullRanksOfInter0;
 
 1672   std::cout << std::endl;
 
 1690     std::cerr << 
"In Environment::constructor()" 
 1703     *
m_subDisplayFile << 
"Done with initializations at FullEnvironment::commonConstructor()" 
 1724 #ifdef QUESO_HAS_MPI 
 1725   int mpi_initialized;
 
 1726   MPI_Initialized (&mpi_initialized);
 
 1728   if (mpi_initialized)
 
 1731       MPI_Abort(MPI_COMM_WORLD, 1);
 
 1752   if (ifs->is_open()) {
 
 1757     if (
m_fullRank == 0) std::cout << 
"An invalid input file has been passed to the 'environment' class constructor!" 
 1761     if (
m_fullRank == 0) std::cout << 
"\nThis is a help message of the QUESO library." 
 1762                                    << 
"\nAn application using the QUESO library shall be executed by typing" 
 1763                                    << 
"\n  '<eventual mpi commands and options> <Application> <InputFile>'" 
 1764                                    << 
"\nin the command line." 
virtual ~BaseEnvironment()
Destructor. 
 
const RngBase * rngObject() const 
Access to the RNG object. 
 
int NumProc() const 
Returns total number of processes. 
 
std::terminate_handler old_terminate_handler
 
#define UQ_ENV_FILENAME_FOR_NO_INPUT_FILE
 
std::string m_optionsInputFileName
 
EnvOptionsValues * m_optionsObj
 
struct timeval m_timevalBegin
 
int worldRank() const 
Returns the process world rank. 
 
RawType_MPI_Comm Comm() const 
Extract MPI Communicator from a MpiComm object. 
 
void Barrier() const 
Pause every process in *this communicator until all the processes reach this point. 
 
const GetPot & input() const 
The GetPot input file parser. 
 
std::ofstream * subDisplayFile() const 
Access function for m_subDisplayFile (displays file on stream). 
 
#define queso_require_greater_equal_msg(expr1, expr2, msg)
 
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file. 
 
int subRank() const 
Access function for sub-rank. 
 
std::ifstream * ifsVar
Provides a stream interface to read data from files. 
 
int CheckFilePath(const char *path)
 
std::string optionsInputFileName() const 
Access to the attribute m_optionsInputFileName, which stores the name of the input file passed by the...
 
boost::program_options::variables_map * m_allOptionsMap
 
This class provides a suite options one can pass to a QUESO environment. 
 
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
 
int MyPID() const 
Return my process ID. 
 
void resetIdentifyingString(const std::string &newString)
Reset private attribute m_identifyingString with the value newString. 
 
int inter0Rank() const 
Returns the process inter0 rank. 
 
std::string subDisplayFileName() const 
Access function for m_subDisplayFileName (displays filename on stream). 
 
RawType_MPI_Group m_subGroup
 
std::ofstream * m_subDisplayFile
 
std::string platformName() const 
Access to the platform name. 
 
unsigned int m_syncVerbosity
Synchronized verbosity. 
 
EmptyEnvironment()
Default constructor. Does nothing. 
 
bool fullEnvIsReady() const 
Returns whether the full environment class is ready (constructor has successfully been called)...
 
std::string m_platformName
Platform name. 
 
#define RawValue_MPI_COMM_SELF
 
Class for random number generation using Boost library. 
 
void print(std::ostream &os) const 
Sends the environment options to the stream. 
 
#define queso_require_equal_to_msg(expr1, expr2, msg)
 
bool openInputFile(const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds, FilePtrSetStruct &filePtrSet) const 
Opens an input file. 
 
#define UQ_FILE_EXTENSION_FOR_HDF_FORMAT
 
boost::program_options::variables_map & allOptionsMap() const 
 
std::string m_subIdString
 
Class for random number generation using GSL library. 
 
#define UQ_FILE_EXTENSION_FOR_TXT_FORMAT
 
Struct for handling data input and output from files. 
 
boost::program_options::options_description * m_allOptionsDesc
 
unsigned int subId() const 
Access function to the number of each sub-environment Id: m_subId. 
 
unsigned int syncVerbosity() const 
Access function to private attribute m_syncVerbosity. 
 
#define queso_deprecated()
 
void print(std::ostream &os) const 
 
bool m_optionsInputFileAccessState
 
bool m_exceptionalCircumstance
 
std::string identifyingString() const 
Access function to private attribute m_identifyingString: identifying string. 
 
virtual void resetSeed(int newSeed)
Resets the seed with value newSeed. 
 
unsigned int m_displayVerbosity
Verbosity. 
 
std::string m_subDisplayFileName
Output filename for sub-screen writing. 
 
void scanInputFileForMyOptions(const boost::program_options::options_description &optionsDesc) const 
This method scans the input file provided by the user to QUESO. 
 
unsigned int m_numSubEnvironments
 
Class for random number generation (base class for either GSL or Boost RNG). 
 
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output. 
 
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. 
 
void setExceptionalCircumstance(bool value) const 
Set an exceptional circumstance. 
 
void closeFile(FilePtrSetStruct &filePtrSet, const std::string &fileType) const 
Closes the file. 
 
int fullRank() const 
Returns the process full rank. 
 
void readOptionsInputFile()
Checks the options input file and reads the options. 
 
int QUESO_get_numeric_version()
 
unsigned int numSubEnvironments() const 
Access function to the number of sub-environments. 
 
~FilePtrSetStruct()
Destructor. 
 
std::ofstream * ofsVar
Provides a stream interface to write data to files. 
 
BaseEnvironment(const char *passedOptionsInputFileName, EnvOptionsValues *alternativeOptionsValues)
Default constructor. 
 
RawType_MPI_Group subGroup() const 
Access function for sub-group. 
 
bool exceptionalCircumstance() const 
Decides whether there is an exceptional circumstance. 
 
TODO: Base class for basic PDFs using Gsl library. 
 
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...
 
void resetSeed(int newSeedOption)
Reset RNG seed. 
 
#define queso_require_not_equal_to_msg(expr1, expr2, msg)
 
TODO: Base class for basic PDFs (via either GSL or Boost). 
 
unsigned int checkingLevel() const 
Access function to private attribute m_checkingLevel. 
 
int seed() const 
Access to the RNG seed. 
 
std::string m_rngType
Type of the random number generator. 
 
ScopedPtr< GetPot >::Type m_input
 
unsigned int displayVerbosity() const 
 
RawType_MPI_Group m_fullGroup
 
const MpiComm & subComm() const 
Access function for MpiComm sub communicator. 
 
unsigned int m_checkingLevel
Checking level. 
 
const BasicPdfsBase * basicPdfs() const 
Access to Basic PDFs. 
 
#define UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT
 
#define queso_require_msg(asserted, msg)
 
The QUESO MPI Communicator Class. 
 
~FullEnvironment()
Destructor. 
 
const MpiComm & fullComm() const 
Access function for MpiComm full communicator. 
 
std::string m_identifyingString
Identifying string. 
 
~EmptyEnvironment()
Destructor. 
 
void queso_terminate_handler()
Function for unhandled exceptions in Queso. 
 
int m_seed
Seed of the random number generator. 
 
int seed() const 
Sets the seed. 
 
bool openUnifiedInputFile(const std::string &fileName, const std::string &fileType, FilePtrSetStruct &filePtrSet) const 
Opens the unified input file. 
 
void setOptionsInputFileAccessState(bool newState) const 
 
RawType_MPI_Group m_inter0Group
 
FullEnvironment(const char *passedOptionsInputFileName, const char *prefix, EnvOptionsValues *alternativeOptionsValues)
Parallel constructor. 
 
#define queso_error_msg(msg)
 
FilePtrSetStruct()
Struct constructor. 
 
#define UQ_ENV_FILENAME_FOR_NO_OUTPUT_FILE
 
TODO: Base class for basic PDFs using Boost library. 
 
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 QUESO_version_print(std::ostream &os)
 
BasicPdfsBase * m_basicPdfs
 
const MpiComm & inter0Comm() const 
Access function for MpiComm inter0-communicator. 
 
void construct(const char *prefix)
Named constructor backend for multiple constructor overloads. 
 
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file. 
 
const MpiComm & selfComm() const 
Access function for MpiComm self-communicator.