charm_misc#
Module defining some miscellaneous functions, macros, constants, etc.
Note
All functions that deal with numerics are written in double precision.
Defines
-
CHARM_VERSION_MAJOR 0#
Major version number of CHarm.
-
CHARM_VERSION_MINOR 3#
Minor version number of CHarm.
-
CHARM_VERSION_PATCH 1#
Patch number of CHarm.
-
CHARM_VERSION_STRING "0.3.1"#
Version of CHarm.
-
CHARM_MIN(a, b) (((a) < (b)) ? (a) : (b))#
Returns the minimum of
a
andb
.
-
CHARM_MAX(a, b) (((a) > (b)) ? (a) : (b))#
Returns the maximum of
a
andb
.
Functions
-
void charm_misc_print_version(void)#
Prints library info to
stdout
(library name, version, compilation date, precision, etc).
-
int charm_misc_buildopt_precision(void)#
Returns:
1
if CHarm was compiled in single precision (--enable-single-precision
),2
if CHarm was compiled in double precision (--enable-double-precision
or no precision flag),3
if CHarm was compiled quadruple precision (--enable-quad-precision
).
-
int charm_misc_buildopt_omp_charm(void)#
Returns a non-zero value if CHarm was compiled with the OpenMP parallelization enabled (
--enable-openmp
). Otherwise, zero is returned.
-
int charm_misc_buildopt_omp_fftw(void)#
Returns a non-zero value if the host’s FFTW library supports OpenMP parallelization. Otherwise, zero is returned.
If non-zero, all FFTW computations are parallelized.
-
int charm_misc_buildopt_simd(void)#
Returns:
0
if CHarm was compiled with SIMD instructions disabled,1
if CHarm was compiled with AVX instructions enabled (--enable-avx
),2
if CHarm was compiled with AVX2 instructions enabled (--enable-avx2
),3
if CHarm was compiled with AVX-512 instructions enabled (--enable-avx-512
).
-
int charm_misc_buildopt_isfinite(void)#
Returns a non-zero value if correctly working
isfinite
macro was found in the system’smath.h
header file before the compilation. Otherwise, zero is returned.On some systems, the
isfinite
macro is available inmath.h
but is not working correctly with__float128
floating point data type (quadruple precision). In that case, zero is returned.