pyharm.misc#

Module defining some miscellaneous functions, constants, etc.

Note

All functions that deal with numerics are written in double precision.

pyharm.misc.get_version()#

Returns a string specifying the CHarm version number determined on compilation time.

pyharm.misc.print_info()#

Prints library info (library name, version, compilation date, precision, etc).

pyharm.misc.buildopt_precision()#

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

pyharm.misc.buildopt_omp_charm()#

Returns a non-zero value if CHarm was compiled with the OpenMP parallelization enabled (--enable-openmp). Otherwise, zero is returned.

pyharm.misc.buildopt_omp_fftw()#

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.

pyharm.misc.buildopt_simd()#

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

pyharm.misc.buildopt_version_fftw()#

Returns a string specifying the FFTW version used to compile CHarm.

pyharm.misc.buildopt_isfinite()#

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.