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 4#

Minor version number of CHarm.

CHARM_VERSION_PATCH 0#

Patch number of CHarm.

CHARM_VERSION_STRING "0.4.0"#

Version of CHarm.

CHARM_MIN(a, b) (((a) < (b)) ? (a) : (b))#

Returns the minimum of a and b.

CHARM_MAX(a, b) (((a) > (b)) ? (a) : (b))#

Returns the maximum of a and b.

Functions

const char *const 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:

  • 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).

const char *const charm_misc_buildopt_version_fftw(void)#

Returns a string specifying the FFTW library version.

int charm_misc_buildopt_isfinite(void)#

Returns a non-zero value if correctly working isfinite macro was found in the system’s math.h header file before the compilation. Otherwise, zero is returned.

On some systems, the isfinite macro is available in math.h but is not working correctly with __float128 floating point data type (quadruple precision). In that case, zero is returned.