4 #include <AMReX_Config.H>
18 #include <type_traits>
44 constexpr
bool NDebug =
false;
45 constexpr
bool Debug =
true;
74 [[nodiscard]] std::string
Version ();
78 std::ostream& a_osout = std::cout,
79 std::ostream& a_oserr = std::cerr,
85 const std::function<
void()>& func_parm_parse = {},
86 std::ostream& a_osout = std::cout,
87 std::ostream& a_oserr = std::cerr,
109 template <
class... Ts>
114 void Error (
const std::string& msg);
116 void Error_host (
const char* type,
const char* msg);
119 void Error (
const char* msg =
nullptr) {
132 void Warning (
const std::string& msg);
147 void Abort (
const std::string& msg);
150 void Abort (
const char * msg =
nullptr) {
168 void Assert_host (
const char* EX,
const char* file,
int line,
const char* msg);
171 void Assert (
const char* EX,
const char* file,
int line,
const char* msg =
nullptr) {
178 EX, file, line, msg);
201 [[nodiscard]]
int Verbose () noexcept;
204 [[nodiscard]]
bool InitSNaN () noexcept;
223 std::allocator<bool> a_b;
224 std::allocator<char> a_c;
225 std::allocator<int> a_i;
226 std::allocator<long> a_l;
227 std::allocator<long long> a_ll;
228 std::allocator<unsigned char> a_uc;
229 std::allocator<unsigned int> a_ui;
230 std::allocator<unsigned long> a_ul;
231 std::allocator<unsigned long long> a_ull;
232 std::allocator<float> a_f;
233 std::allocator<double> a_d;
234 std::allocator<std::string> a_s;
300 using T = std::underlying_type_t<FPExcept>;
301 return static_cast<FPExcept>(
static_cast<T
>(a) |
static_cast<T
>(
b));
306 using T = std::underlying_type_t<FPExcept>;
307 return static_cast<FPExcept>(
static_cast<T
>(a) &
static_cast<T
>(
b));
#define AMREX_FORCE_INLINE
Definition: AMReX_Extension.H:119
#define AMREX_EXPORT
Definition: AMReX_Extension.H:191
#define AMREX_DEVICE_ASSERT(flag)
Definition: AMReX_GpuAssert.H:16
#define AMREX_DEVICE_PRINTF(...)
Definition: AMReX_GpuPrint.H:21
#define AMREX_IF_ON_DEVICE(CODE)
Definition: AMReX_GpuQualifiers.H:56
#define AMREX_IF_ON_HOST(CODE)
Definition: AMReX_GpuQualifiers.H:58
#define AMREX_GPU_HOST_DEVICE
Definition: AMReX_GpuQualifiers.H:20
int MPI_Comm
Definition: AMReX_ccse-mpi.H:47
static constexpr int MPI_COMM_WORLD
Definition: AMReX_ccse-mpi.H:54
static bool empty() noexcept
Definition: AMReX.H:264
static int size() noexcept
Definition: AMReX.H:266
AMReX & operator=(AMReX const &)=delete
Geometry * getDefaultGeometry() noexcept
Definition: AMReX.H:279
AMReX(AMReX const &)=delete
Geometry * m_geom
Definition: AMReX.H:285
static void erase(AMReX *pamrex)
Definition: AMReX.cpp:932
static AMReX * top() noexcept
Definition: AMReX.H:268
static void push(AMReX *pamrex)
Definition: AMReX.cpp:919
~AMReX()
Definition: AMReX.cpp:913
AMReX()
Definition: AMReX.cpp:908
static AMREX_EXPORT std::vector< std::unique_ptr< AMReX > > m_instance
Definition: AMReX.H:283
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
std::ostream * oserr
Definition: AMReX.cpp:118
bool init_snan
Definition: AMReX.cpp:123
ErrorHandler error_handler
Definition: AMReX.cpp:119
bool abort_on_unused_inputs
Definition: AMReX.cpp:116
bool throw_exception
Definition: AMReX.cpp:114
bool signal_handling
Definition: AMReX.cpp:106
bool handle_sigint
Definition: AMReX.cpp:109
std::ostream * osout
Definition: AMReX.cpp:117
bool handle_sigterm
Definition: AMReX.cpp:108
bool call_addr2line
Definition: AMReX.cpp:113
std::string exename
Definition: AMReX.cpp:104
bool regtest_reduction
Definition: AMReX.cpp:115
bool handle_sigsegv
Definition: AMReX.cpp:107
bool handle_sigabrt
Definition: AMReX.cpp:110
constexpr bool NDebug
Definition: AMReX.H:41
int verbose
Definition: AMReX.cpp:105
constexpr bool Debug
Definition: AMReX.H:42
bool handle_sigfpe
Definition: AMReX.cpp:111
Definition: AMReX_Amr.cpp:49
std::string get_command()
Definition: AMReX.cpp:884
void write_to_stderr_without_buffering(const char *str)
This is used by amrex::Error(), amrex::Abort(), and amrex::Assert() to ensure that when writing the m...
Definition: AMReX.cpp:183
int command_argument_count()
Definition: AMReX.cpp:890
void SetVerbose(int v) noexcept
Definition: AMReX.cpp:166
AMReX * Initialize(MPI_Comm mpi_comm, std::ostream &a_osout=std::cout, std::ostream &a_oserr=std::cerr, ErrorHandler a_errhandler=nullptr)
Definition: AMReX.cpp:326
std::ostream & ErrorStream()
Definition: AMReX.cpp:878
FPExcept
Definition: AMReX.H:288
void ExecOnInitialize(std::function< void()>)
Definition: AMReX.cpp:320
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Assert(const char *EX, const char *file, int line, const char *msg=nullptr)
Definition: AMReX.H:171
void(*)() PTR_TO_VOID_FUNC
Definition: AMReX.H:35
void SetErrorHandler(ErrorHandler f)
Definition: AMReX.cpp:172
bool InitSNaN() noexcept
Definition: AMReX.cpp:168
std::string get_command_argument(int number)
Get command line arguments. The executable name is the zero-th argument. Return empty string if there...
Definition: AMReX.cpp:896
bool any(FPExcept a)
Definition: AMReX.H:296
FPExcept operator|(FPExcept a, FPExcept b)
Definition: AMReX.H:298
void Error_host(const char *type, const char *msg)
Definition: AMReX.cpp:237
void Assert_host(const char *EX, const char *file, int line, const char *msg)
Prints assertion failed messages to cerr and exits via abort(). Intended for use by the BL_ASSERT() m...
Definition: AMReX.cpp:267
FPExcept setFPExcept(FPExcept excepts)
Definition: AMReX.cpp:954
void Finalize(AMReX *pamrex)
Definition: AMReX.cpp:739
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition: AMReX.H:111
void GccPlacater()
Definition: AMReX.H:221
void Error(const std::string &msg)
Print out message to cerr and exit via amrex::Abort().
Definition: AMReX.cpp:219
void Warning_host(const char *msg)
Definition: AMReX.cpp:259
void SetInitSNaN(bool v) noexcept
Definition: AMReX.cpp:170
FPExcept operator&(FPExcept a, FPExcept b)
Definition: AMReX.H:304
int Verbose() noexcept
Definition: AMReX.cpp:164
void Warning(const std::string &msg)
Print out warning message to cerr.
Definition: AMReX.cpp:231
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition: AMReX.cpp:225
void ExecOnFinalize(std::function< void()>)
We maintain a stack of functions that need to be called in Finalize(). The functions are called in LI...
Definition: AMReX.cpp:314
std::string Version()
Definition: AMReX_Version.cpp:9
std::ostream & OutStream()
Definition: AMReX.cpp:872
FPExcept getFPExcept()
Return currently enabled FP exceptions. Linux only.
Definition: AMReX.cpp:942
FPExcept disableFPExcept(FPExcept excepts)
Disable FP exceptions. Linux Only.
Definition: AMReX.cpp:971
FPExcept enableFPExcept(FPExcept excepts)
Enable FP exceptions. Linux Only.
Definition: AMReX.cpp:986
void(*)(const char *) ErrorHandler
Definition: AMReX.H:36
bool Initialized()
Returns true if there are any currently-active and initialized AMReX instances (i....
Definition: AMReX.cpp:727