charm_misc#
Module defining some miscellaneous functions, macros, constants, etc.
Note
This documentation is written for double precision version of CHarm.
Defines
-
CHARM_VERSION_MAJOR 0#
Major version number of CHarm.
-
CHARM_VERSION_MINOR 4#
Minor version number of CHarm.
-
CHARM_VERSION_PATCH 7#
Patch number of CHarm.
-
CHARM_VERSION_STRING "0.4.7"#
Version of CHarm.
-
CHARM_MIN(a, b) (((a) < (b)) ? (a) : (b))#
Returns the minimum of
aandb.
-
CHARM_MAX(a, b) (((a) > (b)) ? (a) : (b))#
Returns the maximum of
aandb.
Functions
-
const char *charm_misc_get_version(void)#
Returns a string specifying the CHarm version number determined on compilation time.
-
void charm_misc_print_info(void)#
Prints library info to
stdout(library name, version, compilation date, precision, etc).
-
int charm_misc_buildopt_precision(void)#
Returns:
1if CHarm was compiled in single precision (--enable-single-precision),2if CHarm was compiled in double precision (--enable-double-precisionor no precision flag),3if CHarm was compiled quadruple precision (--enable-quad-precision).
-
int charm_misc_buildopt_simd(void)#
Returns:
0if CHarm was compiled with SIMD instructions disabled,1if CHarm was compiled with AVX instructions enabled (--enable-avx),2if CHarm was compiled with AVX2 instructions enabled (--enable-avx2),3if CHarm was compiled with AVX-512 instructions enabled (--enable-avx-512),4if CHarm was compiled with NEON instructions enabled (--enable-neon),5if CHarm was compiled with SSE4.1 instructions enabled (--enable-sse4.1).
-
int charm_misc_buildopt_simd_vector_size(void)#
Returns the size of SIMD vectors if CHarm was compiled with SIMD instructions enabled and
1otherwise (SIMD instructions disabled).
-
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, FFTW computations are parallelized.
-
int charm_misc_buildopt_mpi(void)#
Returns a non-zero value if CHarm was compiled with the MPI parallelization enabled (
--enable-mpi). Otherwise, zero is returned.
-
int charm_misc_buildopt_mpfr(void)#
Returns a non-zero value if CHarm was compiled with the MPFR enabled (
--enable-mpfr). Otherwise, zero is returned.
-
const char *charm_misc_buildopt_version_fftw(void)#
Returns a string specifying the FFTW library version.
-
void charm_misc_buildopt_version_mpi(int *major_header, int *minor_header, int *major_lib, int *minor_lib)#
If CHarm was compiled with the MPI parallelization enabled (
--enable-mpi), setsmajor_header,major_libandminor_header,minor_libto the version (major_*) and subversion (minor_*) of the MPI standard that is being supported by the linked MPI implementation. The*_headervalues are taken from the included MPI’s header file on compile time and the*_libvalues are determined on runtime. If MPI parallelization is disabled, all four values are set to-1.Note
All four version numbers are related to the MPI standard. To see the version of the linked MPI implementation, call
charm_misc_print_info().
-
const char *charm_misc_buildopt_version_mpfr(int *major, int *minor, int *patch)#
If CHarm was compiled with the MPFR support (
--enable-mpfr), returns a string determined on runtime specifying the MPFR library version and setsmajor,minorandpatchto the symbolic constantsMPFR_VERSION_MAJOR,MPFR_VERSION_MINORandMPFR_VERSION_PATCHLEVELdetermined on compile time. Should any of the symbolic constants not be defined, the corresponding input parameter is set to-1.If CHarm was compiled without the MPFR support, returns the
n/astring and setsmajor,minorandpatchto-1.
-
const char *charm_misc_buildopt_version_gmp(int *major, int *minor, int *patch)#
The same as
charm_misc_buildopt_version_mpfr()but for the GMP library (note that--enable-gmpis not a valid installation flag, though).
-
int charm_misc_buildopt_isfinite(void)#
Returns a non-zero value if correctly working
isfinitemacro was found in the system’smath.hheader file before the compilation. Otherwise, zero is returned.On some systems,
isfiniteis available inmath.h, but it is not working correctly with__float128floating point data type (quadruple precision). The macro may also not work correctly with the-ffast-mathcompiler flag (e.g.,gccandclang). In these cases, zero is returned.