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

Patch number of CHarm.

CHARM_VERSION_STRING "0.4.3"#

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 *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_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),

  • 4 if CHarm was compiled with NEON instructions enabled (--enable-neon).

int charm_misc_buildopt_simd_vector_size(void)#

Returns the size of SIMD vectors if CHarm was compiled with SIMD instructions enabled and 1 otherwise (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, all 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.

const char *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, isfinite is available in math.h, but it is not working correctly with __float128 floating point data type (quadruple precision). The macro may also not work correctly with the -ffast-math compiler flag (e.g., gcc and clang). In these cases, zero is returned.