queso-0.50.1
Defines.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008,2009,2010,2011,2012,2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_DEFINES_H
26 #define UQ_DEFINES_H
27 
28 #include <queso/config_queso.h>
29 #include <queso/asserts.h>
30 
32 
33 #ifdef QUESO_HAVE_GLPK
34 #define QUESO_HAS_GLPK
35 #endif
36 
37 #ifdef QUESO_HAVE_HDF5
38 #define QUESO_HAS_HDF5
39 #endif
40 
41 #ifdef QUESO_HAVE_TRILINOS
42 #define QUESO_HAS_TRILINOS
43 #endif
44 
45 #ifdef QUESO_HAVE_ANN
46 #define QUESO_HAS_ANN
47 #endif
48 
49 #define QUESO_HAS_MPI
50 
51 #include <iostream>
52 #include <stdlib.h> // For exit()
53 #include <set>
54 #include <vector>
55 #include <mpi.h>
56 #include <queso/asserts.h> // for queso_error handler
57 
58 namespace QUESO {
59 
61 int MyWorldfullRank();
62 
63 #define ML_CODE_HAS_NEW_RESTART_CAPABILITY
64 #undef QUESO_MEMORY_DEBUGGING
65 #undef UQ_DEBUG_PARALLEL_RUNS_IN_DETAIL
66 #undef UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE
67 #define QUESO_EXPECTS_LN_LIKELIHOOD_INSTEAD_OF_MINUS_2_LN
68 #define QUESO_CLASSES_INSTANTIATE_NEW_MAPS
69 #undef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
70 #undef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
71 #define QUESO_USES_NEW_RNG_CLASS
72 
73 const int UQ_UNAVAILABLE_RANK = -1;
74 
75 const int UQ_OK_RC = 0;
79 const int UQ_INVALID_QOI_SPEC_RC = -4;
86 const int UQ_MATRIX_SVD_FAILED_RC = -11;
87 
88 #define UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT "m"
89 #define UQ_FILE_EXTENSION_FOR_HDF_FORMAT "h5"
90 
91 
105 {
106 public:
108 
109  EnvOptionsValues ();
111 
113  EnvOptionsValues (const EnvOptionsValues& src);
114 
118 
120 
124 
127  unsigned int m_numSubEnvironments;
128 
130  std::string m_subDisplayFileName;
131 
134 
137 
139  std::set<unsigned int> m_subDisplayAllowedSet;
140 
142  unsigned int m_displayVerbosity;
143 
145  unsigned int m_syncVerbosity;
146 
148  unsigned int m_checkingLevel;
149 
151  std::string m_rngType;
152 
154 
156  int m_seed;
157 
159  std::string m_platformName;
160 
162  std::string m_identifyingString;
163 
165  unsigned int m_numDebugParams;
166 
168  std::vector<double> m_debugParams;
170 
171 private:
173  void copy(const EnvOptionsValues& src);
174 };
175 
177 #define UQ_RC_MACRO(macroIRc,givenRank,where,what,retValue) \
178  if (macroIRc) { \
179  int macroRank = givenRank; \
180  if (macroRank < 0) { \
181  macroRank = QUESO::MyWorldfullRank(); \
182  } \
183  std::cerr << "UQ RC ERROR" \
184  << ", rank " << macroRank \
185  << ", in " << where \
186  << ": " << what \
187  << ", iRc = " << macroIRc \
188  << std::endl; \
189  return retValue; \
190  }
191 
192 #define UQ_TEST_MACRO(test,givenRank,where,what,retValue) \
193  if (test) { \
194  int macroRank = givenRank; \
195  if (macroRank < 0) { \
196  macroRank = QUESO::MyWorldfullRank(); \
197  } \
198  std::cerr << "UQ TEST ERROR" \
199  << ", rank " << macroRank \
200  << ", in " << where \
201  << ": " << what \
202  << std::endl; \
203  return retValue; \
204  }
205 
206 #define UQ_FATAL_RC_MACRO(macroIRc,givenRank,where,what) \
207  if (macroIRc) { \
208  int macroRank = givenRank; \
209  if (macroRank < 0) { \
210  macroRank = QUESO::MyWorldfullRank(); \
211  } \
212  std::cerr << "UQ RC FATAL ERROR" \
213  << ", rank " << macroRank \
214  << ", in " << where \
215  << ": " << what \
216  << ", iRC = " << macroIRc \
217  << ". Exiting..." \
218  << std::endl; \
219  queso_error(); \
220  }
221 
222 #define UQ_FATAL_TEST_MACRO(test,givenRank,where,what) \
223  if (test) { \
224  int macroRank = givenRank; \
225  if (macroRank < 0) { \
226  macroRank = QUESO::MyWorldfullRank(); \
227  } \
228  std::cerr << "UQ TEST FATAL ERROR" \
229  << ", rank " << macroRank \
230  << ", in " << where \
231  << ": " << what \
232  << ". Exiting..." \
233  << std::endl; \
234  queso_error(); \
235  }
236 
237 } // End namespace QUESO
238 
239 #endif // UQ_DEFINES_H
const int UQ_FAILED_READING_FILE_RC
Definition: Defines.h:84
EnvOptionsValues()
Default constructor.
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
Definition: Defines.h:136
std::string m_rngType
Type of the random number generator.
Definition: Defines.h:151
const int UQ_MATRIX_IS_NOT_POS_DEFINITE_RC
Definition: Defines.h:83
EnvOptionsValues & operator=(const EnvOptionsValues &rhs)
Operator for copying the options of an environment.
unsigned int m_checkingLevel
Checking level.
Definition: Defines.h:148
unsigned int m_numSubEnvironments
Number of sub-environments.
Definition: Defines.h:127
const int UQ_INVALID_OBSERVABLE_SPEC_RC
Definition: Defines.h:78
const int UQ_INCOMPLETE_IMPLEMENTATION_RC
Definition: Defines.h:76
const int UQ_OK_RC
Definition: Defines.h:75
const int UQ_INVALID_QOI_SPEC_RC
Definition: Defines.h:79
std::string m_identifyingString
Identifying string.
Definition: Defines.h:162
std::string m_platformName
Platform name.
Definition: Defines.h:159
const int UQ_INVALID_INTERNAL_RESULT_RC
Definition: Defines.h:80
int MyWorldfullRank()
Returns the rank of the calling process in the communicator.
Definition: Defines.C:30
unsigned int m_numDebugParams
Number of debug parameters.
Definition: Defines.h:165
const int UQ_MATRIX_SVD_FAILED_RC
Definition: Defines.h:86
const int UQ_FAILED_TO_OPEN_FILE_RC
Definition: Defines.h:82
unsigned int m_displayVerbosity
Verbosity.
Definition: Defines.h:142
const int UQ_INVALID_INTERNAL_STATE_RC
Definition: Defines.h:81
const int UQ_INVALID_PARAMETER_SPEC_RC
Definition: Defines.h:77
std::string m_subDisplayFileName
Output filename for sub-screen writing.
Definition: Defines.h:130
const int UQ_UNAVAILABLE_RANK
Definition: Defines.h:73
std::vector< double > m_debugParams
Debug parameters.
Definition: Defines.h:168
int m_seed
Seed of the random number generator.
Definition: Defines.h:156
const int UQ_INVALID_SPACE_COMPONENT_ID_RC
Definition: Defines.h:85
void copy(const EnvOptionsValues &src)
Makes an exact copy of an existing EnvOptionsValues instance.
unsigned int m_syncVerbosity
Synchronized verbosity.
Definition: Defines.h:145
This class provides a suite options one can pass to a QUESO environment.
Definition: Defines.h:104
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
Definition: Defines.h:133
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
Definition: Defines.h:139

Generated on Thu Apr 23 2015 19:18:34 for queso-0.50.1 by  doxygen 1.8.5