queso-0.51.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 
31 #ifdef QUESO_HAVE_GLPK
32 #define QUESO_HAS_GLPK
33 #endif
34 
35 #ifdef QUESO_HAVE_HDF5
36 #define QUESO_HAS_HDF5
37 #endif
38 
39 #ifdef QUESO_HAVE_TRILINOS
40 #define QUESO_HAS_TRILINOS
41 #endif
42 
43 #ifdef QUESO_HAVE_ANN
44 #define QUESO_HAS_ANN
45 #endif
46 
48 #define QUESO_HAS_MPI
49 
51 #define QUESO_EXPECTS_LN_LIKELIHOOD_INSTEAD_OF_MINUS_2_LN
52 
53 #include <iostream>
54 #include <stdlib.h> // For exit()
55 #include <set>
56 #include <vector>
57 #include <mpi.h>
58 #include <queso/asserts.h> // for queso_error handler
59 
60 namespace QUESO {
61 
63 int MyWorldfullRank();
64 
65 #define ML_CODE_HAS_NEW_RESTART_CAPABILITY
66 #undef QUESO_MEMORY_DEBUGGING
67 #undef UQ_DEBUG_PARALLEL_RUNS_IN_DETAIL
68 #undef UQ_ALSO_COMPUTE_MDFS_WITHOUT_KDE
69 #define QUESO_CLASSES_INSTANTIATE_NEW_MAPS
70 #undef QUESO_USES_SEQUENCE_STATISTICAL_OPTIONS
71 #undef QUESO_COMPUTES_EXTRA_POST_PROCESSING_STATISTICS
72 #define QUESO_USES_NEW_RNG_CLASS
73 
74 const int UQ_UNAVAILABLE_RANK = -1;
75 
76 const int UQ_OK_RC = 0;
80 const int UQ_INVALID_QOI_SPEC_RC = -4;
87 const int UQ_MATRIX_SVD_FAILED_RC = -11;
88 
89 #define UQ_FILE_EXTENSION_FOR_MATLAB_FORMAT "m"
90 #define UQ_FILE_EXTENSION_FOR_HDF_FORMAT "h5"
91 
92 
106 {
107 public:
109 
110  EnvOptionsValues ();
112 
114  EnvOptionsValues (const EnvOptionsValues& src);
115 
119 
121 
125 
128  unsigned int m_numSubEnvironments;
129 
131  std::string m_subDisplayFileName;
132 
135 
138 
140  std::set<unsigned int> m_subDisplayAllowedSet;
141 
143  unsigned int m_displayVerbosity;
144 
146  unsigned int m_syncVerbosity;
147 
149  unsigned int m_checkingLevel;
150 
152  std::string m_rngType;
153 
155 
157  int m_seed;
158 
160  std::string m_platformName;
161 
163  std::string m_identifyingString;
164 
166  unsigned int m_numDebugParams;
167 
169  std::vector<double> m_debugParams;
171 
172 private:
174  void copy(const EnvOptionsValues& src);
175 };
176 
178 #define UQ_RC_MACRO(macroIRc,givenRank,where,what,retValue) \
179  if (macroIRc) { \
180  int macroRank = givenRank; \
181  if (macroRank < 0) { \
182  macroRank = QUESO::MyWorldfullRank(); \
183  } \
184  std::cerr << "UQ RC ERROR" \
185  << ", rank " << macroRank \
186  << ", in " << where \
187  << ": " << what \
188  << ", iRc = " << macroIRc \
189  << std::endl; \
190  return retValue; \
191  }
192 
193 #define UQ_TEST_MACRO(test,givenRank,where,what,retValue) \
194  if (test) { \
195  int macroRank = givenRank; \
196  if (macroRank < 0) { \
197  macroRank = QUESO::MyWorldfullRank(); \
198  } \
199  std::cerr << "UQ TEST ERROR" \
200  << ", rank " << macroRank \
201  << ", in " << where \
202  << ": " << what \
203  << std::endl; \
204  return retValue; \
205  }
206 
207 #define UQ_FATAL_RC_MACRO(macroIRc,givenRank,where,what) \
208  if (macroIRc) { \
209  int macroRank = givenRank; \
210  if (macroRank < 0) { \
211  macroRank = QUESO::MyWorldfullRank(); \
212  } \
213  std::cerr << "UQ RC FATAL ERROR" \
214  << ", rank " << macroRank \
215  << ", in " << where \
216  << ": " << what \
217  << ", iRC = " << macroIRc \
218  << ". Exiting..." \
219  << std::endl; \
220  queso_error(); \
221  }
222 
223 #define UQ_FATAL_TEST_MACRO(test,givenRank,where,what) \
224  if (test) { \
225  int macroRank = givenRank; \
226  if (macroRank < 0) { \
227  macroRank = QUESO::MyWorldfullRank(); \
228  } \
229  std::cerr << "UQ TEST FATAL ERROR" \
230  << ", rank " << macroRank \
231  << ", in " << where \
232  << ": " << what \
233  << ". Exiting..." \
234  << std::endl; \
235  queso_error(); \
236  }
237 
238 } // End namespace QUESO
239 
240 #endif // UQ_DEFINES_H
const int UQ_INVALID_INTERNAL_RESULT_RC
Definition: Defines.h:81
void copy(const EnvOptionsValues &src)
Makes an exact copy of an existing EnvOptionsValues instance.
std::string m_platformName
Platform name.
Definition: Defines.h:160
int MyWorldfullRank()
Returns the rank of the calling process in the communicator.
Definition: Defines.C:30
const int UQ_FAILED_TO_OPEN_FILE_RC
Definition: Defines.h:83
const int UQ_INVALID_PARAMETER_SPEC_RC
Definition: Defines.h:78
unsigned int m_numDebugParams
Number of debug parameters.
Definition: Defines.h:166
const int UQ_MATRIX_SVD_FAILED_RC
Definition: Defines.h:87
const int UQ_INVALID_INTERNAL_STATE_RC
Definition: Defines.h:82
const int UQ_INVALID_SPACE_COMPONENT_ID_RC
Definition: Defines.h:86
const int UQ_UNAVAILABLE_RANK
Definition: Defines.h:74
bool m_subDisplayAllowAll
Allows (or not) all sub-environments to write to output file.
Definition: Defines.h:134
bool m_subDisplayAllowInter0
Allows (or not) all inter0 nodes to write to output file.
Definition: Defines.h:137
unsigned int m_numSubEnvironments
Number of sub-environments.
Definition: Defines.h:128
EnvOptionsValues()
Default constructor.
const int UQ_FAILED_READING_FILE_RC
Definition: Defines.h:85
int m_seed
Seed of the random number generator.
Definition: Defines.h:157
unsigned int m_syncVerbosity
Synchronized verbosity.
Definition: Defines.h:146
const int UQ_MATRIX_IS_NOT_POS_DEFINITE_RC
Definition: Defines.h:84
This class provides a suite options one can pass to a QUESO environment.
Definition: Defines.h:105
std::set< unsigned int > m_subDisplayAllowedSet
Sub-environments that will write to output.
Definition: Defines.h:140
EnvOptionsValues & operator=(const EnvOptionsValues &rhs)
Operator for copying the options of an environment.
unsigned int m_checkingLevel
Checking level.
Definition: Defines.h:149
const int UQ_INVALID_OBSERVABLE_SPEC_RC
Definition: Defines.h:79
const int UQ_INCOMPLETE_IMPLEMENTATION_RC
Definition: Defines.h:77
const int UQ_OK_RC
Definition: Defines.h:76
const int UQ_INVALID_QOI_SPEC_RC
Definition: Defines.h:80
std::string m_rngType
Type of the random number generator.
Definition: Defines.h:152
unsigned int m_displayVerbosity
Verbosity.
Definition: Defines.h:143
std::string m_subDisplayFileName
Output filename for sub-screen writing.
Definition: Defines.h:131
std::string m_identifyingString
Identifying string.
Definition: Defines.h:163
std::vector< double > m_debugParams
Debug parameters.
Definition: Defines.h:169

Generated on Thu Apr 23 2015 19:26:15 for queso-0.51.1 by  doxygen 1.8.5